]> git.saurik.com Git - bison.git/blame - ChangeLog
gnulib: update.
[bison.git] / ChangeLog
CommitLineData
92d7a23a
AD
12009-06-10 Akim Demaille <demaille@gostai.com>
2
3 gnulib: update.
4 * gnulib: Update to latest.
5 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
6 * m4/.gitignore: Regen.
7 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
8 Call xalloc_die on hash_insert failures.
9 Requested by the new __warn_unused_result__ attribute of
10 hash_insert.
11
12cf133f
AD
122009-06-10 Akim Demaille <demaille@gostai.com>
13
14 deterministic user-token-number redeclaration errors.
15 Address nondeterminism reported by Joel E. Denny.
16 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
17
18 * src/uniqstr.h: Comment changes.
19 * src/location.h (boundary_cmp, location_cmp): New.
20 * src/symtab.c (user_token_number_redeclaration): New.
21 (symbol_translation): Use it.
22 * tests/input.at (Numbered tokens): Adjust the expected output.
23
796a2b0a
AD
242009-05-25 Akim Demaille <demaille@gostai.com>
25
26 build: avoid ignored errors.
27 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
28 errors, they pollute the output.
29
0b6d43c5
JD
302009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
31
32 Convert multiple variable definition warnings to complaints.
33 * NEWS (2.5): Add a new entry for that change.
34 * doc/bison.texinfo (Decl Summary): Update %define entry.
35 (Bison Options): Update -D/--define/-F/--force-define entry.
36 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
37 * src/muscle-tab.h (muscle_percent_define_insert): Update
38 comments.
39 * tests/input.at (`%define errors'): Update.
40 (`%define, --define, --force-define'): Update.
41
de5ab940
JD
422009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
43
44 -F/--force-define and relative %define/-D/--define priorities.
45 * NEWS (2.5): Add documentation to -D/--define entry.
46 * build-aux/cross-options.pl: Hard-code association of
47 --force-define with %define.
48 * doc/bison.texinfo (Decl Summary): In %define entry,
49 cross-reference command-line options.
50 (Bison Options): Add documentation to -D/--define entry.
51 (Option Cross Key): Widen column for --force-define row.
52 * src/getargs.c (usage): Document -F/--force-define. Realign
53 options in output.
54 (short_options, long_options, getargs): Parse -F/--force-define,
55 and update muscle_percent_define_insert invocations.
56 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
57 (muscle_percent_define_insert): Add argument with that type.
58 * src/muscle-tab.c (muscle_percent_define_insert): Implement
59 -F/--force-define behavior and priorities.
60 (muscle_percent_define_ensure): Update
61 muscle_percent_define_insert invocation.
62 * src/parse-gram.y (prologue_declaration): Update
63 muscle_percent_define_insert invocations.
64 * tests/input.at (`%define, --define'): Rename to...
65 (`%define, --define, --force-define'): ... this and extend.
66
f8e7258f
JD
672009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
68
69 Update some comments to make sense for -D.
70 * data/bison.m4 (b4_check_user_names): In header comments, say
71 "user occurrence" instead of "grammar occurrence".
72 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
73 (muscle_percent_code_grow): Likewise just for consistency.
74
b987342b
JD
752009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
76
77 * data/c++.m4 (b4_namespace_close): Simplify slightly.
78
4977e0a7
JD
792009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
80
81 Handle a trailing `:' in a user-supplied C++ namespace better.
82 * data/c++.m4 (b4_namespace_close): Don't let it be printed
83 among the closing braces here. This fix might make the
84 generated code easier to debug, but otherwise it should be
85 insignificant because a trailing `:' is a C++ error already.
86
9b04dad7
AD
872009-05-19 Akim Demaille <demaille@gostai.com>
88
89 remove useless variable.
90 * src/getargs.c (skeleton_arg): Remove now useless variable.
91 Should help the compiler see that this printf-like call is sane.
92
4c6622c2
AD
932009-05-15 Akim Demaille <demaille@gostai.com>
94
95 Rename token.prefix as api.tokens.prefix.
96 Discussed here.
97 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
98
99 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
100 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
101 (token.prefix): Rename as...
102 (api.tokens.prefix): this.
103
3c248d70
AD
1042009-05-11 Akim Demaille <demaille@gostai.com>
105
106 doc: use C++ headers.
107 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
108 headers.
109
99c08fb6
AD
1102009-05-11 Akim Demaille <demaille@gostai.com>
111
112 doc: token.prefix
113 * doc/bison.simple (Decl Summary): Document token.prefix.
114 (Calc++ Parser): Various fixes.
115 Formatting changes.
116 Use token.prefix.
117 Introduce a macro TOKEN to shorten the code and make it more
118 readable.
119 (Calc++ Scanner): Adjust.
120 * NEWS (Variable token.prefix): New.
121
84a1cb5a
AD
1222009-05-04 Akim Demaille <demaille@gostai.com>
123
124 bison: catch bad symbol names.
125 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
126 * tests/input.at: Adjust.
127
cdf3f113
AD
1282009-05-04 Akim Demaille <demaille@gostai.com>
129
130 identifiers: dashes are letters.
131 Dashes can now start identifiers (symbols and directives).
84a1cb5a 132
cdf3f113
AD
133 * src/scan-gram.l ({letter}): Add dash.
134 ({id}): Remove it.
135 * tests/input.at (Symbols): Adjust.
136 Remove stray comment.
137 * tests/regression.at (Invalid inputs): Adjust error message.
138 * doc/bison.texinfo (Symbols): Update.
139
98a345a2
JD
1402009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
141
142 Declare %code to be a permanent feature.
143 * NEWS (2.4.2): Here.
144 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
145 experimental.
146 (Decl Summary): Likewise.
147
67212941
JD
1482009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
149
150 Convert underscores to dashes in some %define variable names.
151 For now, just api.push-pull and lr.keep-unreachable-states.
152 Maintain old names for backward compatibility.
153 * NEWS (2.5): Document.
154 * data/c.m4 (b4_identification): Update comment.
155 * data/yacc.c: Update access.
156 * doc/bison.texinfo: Update.
157 * etc/bench.pl.in (bench_push_parser): Update use.
158 * src/files.c (tr): Move to...
159 * src/getargs.c, src/getargs.h (tr): ... here because I can't
160 think of a better place to expose it. My logic is that, for all
161 uses of tr so far, command-line arguments can be involved, and
162 getargs.h is already included.
163 * src/main.c (main): Update access.
164 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
165 variable names to new variable names before assigning value.
166 * src/reader.c (reader): Update setting default.
167 * tests/calc.at: Update uses.
168 * tests/conflicts.at (Unreachable States After Conflict
169 Resolution): Update use.
170 * tests/input.at (%define enum variables): Update use.
171 (%define backward compatibility): New test group.
172 * tests/push.at: Update uses.
173 * tests/reduce.at: Update uses.
174 * tests/torture.at: Update uses.
175
ba5c6d94
JD
1762009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
177
178 Set all front-end %define defaults in one place.
179 * src/main.c (main): Move lr.keep_unreachable_states default...
180 * src/reader.c (reader): ... to here.
181
5bab9d08
JD
1822009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
183
184 Rename lr.default_reductions to lr.default-reductions.
185 * NEWS (2.5): Here.
186 * doc/bison.texinfo: Here.
187 * src/lalr.c (initialize_LA): Here.
188 * src/print.c (print_reductions): Here.
189 * src/reader.c (reader): Here.
190 * src/tables.c (action_row): Here.
191 * tests/input.at (%define enum variables): Here.
192 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
193
d521ee19
JD
1942009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
195
196 Pacify ./configure --enable-gcc-warnings.
197 * tests/input.at (Symbols): Prototype yyerror and yylex.
198
1992009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
200
201 Document how `%define "var" "value"' is not M4-friendly.
202 * src/parse-gram.y (variable): In comments here.
203
8f0d265e
JD
2042009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
205
206 Clean up recent patches a little.
207 Reported by Akim Demaille.
208 * doc/bison.texinfo (Understanding): Fix typos.
209 * src/print.c (print_reductions): Don't use negated variable.
210
f4909773
JD
2112009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
212
213 List accepted values for a %define enum variable with an invalid value.
214 Suggested by Akim Demaille at
215 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
216 * data/bison.m4 (_b4_percent_define_check_values): Implement.
217 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
218 * tests/input.at (%define lr.default_reductions invalid values): Merge
219 into...
220 (%define enum variables): ... here, and update output.
221
110ef36a
JD
2222009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
223
224 Rename "default rule" to "default reduction".
225 This includes changing variable names in code, changing
226 comments, and renaming %define lr.default_rules to %define
227 lr.default_reductions.
228 * NEWS (2.5): Update IELR documentation.
229 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
230 documentation.
231 * data/glr.c, data/lalr1.java: Sync copyright dates.
232 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
233 and lr.type documentation. Make some other wording
234 improvements.
235 (Glossary): Adjust cross-references and Default Reduction
236 definition.
237 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
238 Remove a confusing comment pointed out by Akim Demaille.
239 (initialize_LA): Adjust code.
240 * src/print-xml.c (print_reductions): Adjust code.
241 * src/print.c (print_reductions): Adjust code.
242 * src/reader.c (reader): Adjust code.
243 * src/tables.c (action_row): Adjust code.
244 (token_actions): Adjust code.
245 * src/tables.h: Adjust YYDEFACT documentation.
246 * tests/input.at (%define lr.default_rules invalid values):
247 Rename test group to...
248 (%define lr.default_reductions invalid values): ... this, and
249 update grammar file and expected output.
250 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
251 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
252
746ee38c
AD
2532009-04-21 Akim Demaille <demaille@gostai.com>
254
255 tests: check the use of dashes and periods in symbols.
256 * tests/input.at (Symbol): New test group.
257
eb45ef3b
JD
2582009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
259
260 Document %define lr.type and lr.default_rules.
261 * NEWS (2.5): Add an entry.
262 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
263 besides just LALR(1) and GLR(1).
264 * doc/bison.texinfo (Introduction): Likewise.
265 (Language and Grammar): Bison is no longer limited to LALR(1)
266 restrictions.
267 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
268 when trying to distinguish from GLR. Talk about LR(1) grammars
269 rather than LALR(1) grammars.
270 (Decl Summary): In %define api.push_pull entry, say it applies
271 to deterministic parsers in C rather than LALR(1) parsers in C.
272 Add lr.default_rules entry.
273 Add lr.type entry.
274 (Mystery Conflicts): Bison is no longer limited to LALR(1)
275 restrictions.
276 (Generalized LR Parsing): Same changes as for the previous GLR
277 section.
278 (Memory Management): Say deterministic rather than LALR(1).
279 (Understanding): Correct some bison output.
280 Index discussion of "accepting state".
281 Say deterministic rather than LALR(1).
282 (Bison Options): In --yacc entry, say deterministic rather than
283 LALR(1).
284 In --report, --graph, and --xml entries, just don't mention
285 LALR(1).
286 (C++ Parsers): Say deterministic rather than LALR(1).
287 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
288 (Glossary): Add Accepting State, Consistent State, Default Rule,
289 and IELR(1) definitions.
290 In Generalized LR (GLR) definition, make same changes as in
291 previous GLR sections.
292 In LALR(1) definition, say Bison uses LALR(1) by default rather
293 than implying Bison is limited to LALR(1).
294 (LocalWords): Add IELR.
295
db34f798
JD
2962009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
297
298 Finish implementing %define lr.type.
299 Its value can be "LALR", "IELR", or "canonical LR".
300 * lib/timevar.def (TV_IELR_PHASE1): New var.
301 (TV_IELR_PHASE2): New var.
302 (TV_IELR_PHASE3): New var.
303 (TV_IELR_PHASE4): New var.
304 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
305 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
306 Sbitset.h, ielr.h, and ielr.c.
307 * src/getargs.h, src/getargs.c (enum trace, trace_args,
308 trace_types): Add trace_ielr.
309 * src/lalr.h, src/lalr.c (ngotos): Export it.
310 (F): Rename to...
311 (goto_follows): ... this, update all uses, and export it.
312 (set_goto_map): Export it.
313 (map_goto): Export it.
314 (compute_lookahead_tokens): Don't free goto_follows yet. Now
315 handled in ielr.
316 (initialize_LA): Export it. Move lookback allocation to...
317 (lalr): ... here because, for canonical LR, initialize_LA must
318 be invoked but lookback and much of the rest of LALR isn't
319 needed.
320 * main.c (main): Instead of lalr, invoke ielr, which invokes
321 lalr.
322 * src/reader.c (reader): Default lr.type to "LALR".
323 Default lr.default_rules to "accepting" if lr.type is "canonical
324 LR". Leave the default as "all" otherwise.
325 Check for a valid lr.type value.
326 * src/state.h, src/state.c (struct state_list): Add state_list
327 member.
328 (state_new): Initialize state_list member to NULL.
329 (state_new_isocore): New function, exported.
330 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
331 exercises all values of lr.type.
332 (GNU AWK Grammar): Rename test group to...
333 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
334 AT_TEST_EXISTING_GRAMMAR.
335 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
336 (GNU pic Grammar): Rename test group to...
337 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
338 AT_TEST_EXISTING_GRAMMAR.
339 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
340 all values of lr.type.
341 (Single State Split): New test groups using AT_TEST_LR_TYPE.
342 (Lane Split): Likewise.
343 (Complex Lane Split): Likewise.
344 (Split During Added Lookahead Propagation): Likewise.
345
7fe11bb5
JD
3462009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
347
348 Add new files for IELR and canonical LR implementation.
349 * src/AnnotationList.c: New.
350 * src/AnnotationList.h: New.
351 * src/InadequacyList.c: New.
352 * src/InadequacyList.h: New.
353 * src/Sbitset.c: New.
354 * src/Sbitset.h: New.
355 * src/ielr.c: New.
356 * src/ielr.h: New.
357
7254f6a8
JD
3582009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
359
360 Implement %define lr.default_rules.
361 Its value describes the states that are permitted to contain
362 default rules: "all", "consistent", or "accepting".
363 * src/reader.c (reader): Default lr.default_rules to "all".
364 Check for a valid lr.default_rules value.
365 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
366 is "accepting", then only mark the accepting state as
367 consistent.
368 (initialize_LA): Tell state_lookahead_tokens_count whether
369 lr.default_rules is "accepting".
370 * src/tables.c (action_row): If lr.default_rules is not "all",
371 then disable default rules in inconsistent states.
372 * src/print.c (print_reductions): Use this opportunity to
373 perform some assertions about whether lr.default_rules was
374 obeyed correctly.
375 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
376 helps with checking the parser tables for a grammar.
377 * tests/input.at (%define lr.default_rules invalid values): New
378 test group.
379 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
380 AT_TEST_TABLES_AND_PARSE.
381 (`no %define lr.default_rules'): New test group generated by
382 AT_TEST_LR_DEFAULT_RULES.
383 (`%define lr.default_rules "all"'): Likewise.
384 (`%define lr.default_rules "consistent"'): Likewise.
385 (`%define lr.default_rules "accepting"'): Likewise.
386
72e727f2
AD
3872009-04-20 Akim Demaille <demaille@gostai.com>
388
389 Formatting change.
390
90462b8d
AD
3912009-04-20 Akim Demaille <demaille@gostai.com>
392
393 bison: factoring.
394 * src/output.c (token_definitions_output): Use symbol_id_get
395 instead of duplicating its logic.
396 * TODO (YYERRCODE): Extend.
397
4f646c37
AD
3982009-04-20 Akim Demaille <demaille@gostai.com>
399
71b00ed8
AD
400 variables: prefer error-verbose to error_verbose.
401 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
402 instead of error_verbose.
403 * src/scan-gram.l (%error-verbose): Map to the error-verbose
404 variable.
405 * doc/bison.texinfo: Promote %define error-verbose instead of
406 %error-verbose.
407 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
408
4092009-04-15 Akim Demaille <demaille@gostai.com>
410
4f646c37
AD
411 variables: accept dashes.
412 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
413 underscores.
414 * src/scan-gram.l ({id}): Also accept dashes after the initial
415 letter.
416 ({directive}): Use {id}.
417 * src/parse-gram.y: Comment and formatting changes.
418 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
419 symbols.
420 * src/complain.h, src/complain.c (yacc_at): New.
421 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
422 symbol names.
423 * src/output.c (token_definitions_output): Do not #define token
424 names with dashes.
425
184e3179
AD
4262009-04-20 Akim Demaille <demaille@gostai.com>
427
428 Consistently refer to Yacc, not YACC.
429 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
430
41253c3a
JD
4312009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
432
433 Pacify make maintainer-check-posix.
434 * tests/input.at (%define, --define): Move bison command-line
435 options before grammar file name.
436
197b82ba
JD
4372009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
438
439 Document semicolon warnings.
440 * NEWS (2.5): Here.
441
0c90a1f5
AD
4422009-04-14 Akim Demaille <demaille@gostai.com>
443
444 variables: use `parse.assert' instead of `assert'.
445 * TODO (assert): Remove.
446 * data/bison.m4 (b4_assert_if): Replace with...
447 (b4_parse_assert_if): this.
448 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
449 * doc/bison.texinfo (Decl Summary): Document parse.assert.
450
fa819509
AD
4512009-04-14 Akim Demaille <demaille@gostai.com>
452
16dc0d90 453 variables: use `parse.trace' instead of `debug'.
fa819509
AD
454 * src/getargs.c (getargs): Map -t to %define trace.parse.
455 * src/scan-gram.l (%debug): Map to %define trace.parse.
456 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
457 names to `_' in macro names.
458 (b4_debug_if): Replace with...
459 (b4_parse_trace_if): this.
460 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
461 * data/yacc.c: Adjust.
462 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
463 Use @code to label the variable list.
464 Document the variable parse.trace.
465 (Tracing): Promote the parse.trace variable.
466 * TODO: %printer is not documented.
467
f7dae1ea
AD
4682009-04-14 Akim Demaille <demaille@gostai.com>
469
470 doc: minor fixes.
471 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
472 (Table of Symbols): Remove duplicate entry for %debug.
473
3535c071
EB
4742009-04-10 Eric Blake <ebb9@byu.net>
475
476 submodules: update to latest
477 * submodules/autoconf: Use latest upstream Autoconf.
478
cf48f675
EB
4792009-04-06 Eric Blake <ebb9@byu.net>
480
481 Work around autoconf 2.63b bug in testsuite.
482 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
483 autoconf bug related to # in test.
484
50cca368
JD
4852009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
486
487 * NEWS (2.5): New section. Describe new -D/--define feature.
488
3583d96b
AD
4892009-04-06 Akim Demaille <demaille@gostai.com>
490
491 Regen.
492 * src/parse-gram.h, src/parse-gram.c: Regen.
493
00f5d575
AD
4942009-04-06 Akim Demaille <demaille@gostai.com>
495
496 rename muscle_tab.* as muscle-tab.* for consistency.
497 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
498 * src/muscle-tab.h, src/muscle-tab.c: these.
499 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
500 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
501
76bf5102
AD
5022009-04-06 Akim Demaille <demaille@gostai.com>
503
504 Makefile: introduce $(BISON).
505 * src/local.mk (BISON): New.
506 (YACC): Use it.
507
bc0f5737
AD
5082009-04-06 Akim Demaille <demaille@gostai.com>
509
510 parser: handle %locations as %define locations.
511 * src/getargs.h, src/getargs.c (locations_flag): Remove.
512 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
513 to set "locations" to true.
514 * src/output.c (prepare): Don't output "locations".
515 * src/scan-gram.l (%locations): Handle it as a %<flag>.
516 * src/parse-gram.y: It's no longer a token.
517 Don't handle it.
518 * data/bison.m4 (b4_locations_if): Define it with
519 b4_percent_define_if_define.
520 * data/c.m4, data/glr.cc: Adjust.
521
697c912f
AD
5222009-04-06 Akim Demaille <demaille@gostai.com>
523
524 Regen.
525 * src/parse-gram.c: Regen.
526
4920ae8b
AD
5272009-04-06 Akim Demaille <demaille@gostai.com>
528
529 muscle: factor the handling of obsolete of obsolete directives.
530 Suggested by Joel E. Denny.
50cca368 531
4920ae8b
AD
532 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
533 New, extracted from...
534 * src/parse-gram.y (prologue_declaration: pure-parser): here.
535 Remove it.
536 (prologue_declaration: "%<flag>"): Use
537 muscle_percent_define_ensure.
538 (%error-verbose, %pure-parser): No longer tokens.
539 * src/scan-gram.l (pure-parser): Return as a %<flag>.
540
1d5b3c08
JD
5412009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
542
543 Fix options documentation.
544 * build-aux/cross-options.pl: As in --help output, write optional
545 arguments as [=ARG] not =[ARG].
546 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
547
62c99cf4
JD
5482009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
549
550 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
551 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
552 requirements for a correct m4 are stricter.
553 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
554 * configure.ac: Update to use AC_PROG_GNU_M4.
555 Reported by Eric Blake.
556
1c93f35b
JD
5572009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
558
559 Help with updating web manual.
560 * HACKING: Incorporate instructions from gnulib/doc/README.
561 * bootstrap.conf (gnulib_modules): Add gendocs.
562
86cfae0a
AD
5632009-04-03 Akim Demaille <demaille@gostai.com>
564
565 Regen.
566 * src/parse-gram.h, src/parse-gram.c: Regen.
567
ba061fa6
AD
5682009-04-03 Akim Demaille <demaille@gostai.com>
569
570 Factor %FLAG at scan level.
571 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
572 definitions and associated rules, replaced by....
573 (PERCENT_FLAG): this new token type, and rule.
574 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
575 Use it for %debug and %error-verbose.
576
b19ebeb3
AD
5772009-04-03 Akim Demaille <demaille@gostai.com>
578
579 Regen.
580 * src/parse-gram.h, src/parse-gram.c: Regen.
581
001a16a9
AD
5822009-04-03 Akim Demaille <demaille@gostai.com>
583
584 Treat %debug as %define debug.
585 * data/bison.m4 (b4_debug_if): New.
586 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
587 * data/lalr1.java: Use it instead of b4_debug_flag.
588 * src/getargs.h, src/getargs.c (debug_flag): Remove.
589 * src/output.c (prepare): Don't output it.
590 * src/parse-gram.y: Treat %debug as %define debug.
591
5922009-04-03 Akim Demaille <demaille@gostai.com>
593
594 Treat %error-verbose as %define error_verbose.
595 This allows to pass -Derror_verbose on the command line. Better
596 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
597 ERROR_VERBOSE being defined as false or true.
598 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
599 on b4_percent_define_ifdef, for does not check the defined value,
600 but only whether the symbol is defined, rely on
601 b4_percent_define_flag_if, so that a value of "false" is processed
602 as a false.
603 If not defined, define the flag to "false".
604 (b4_error_verbose_if): New.
605 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
606 b4_error_verbose_flag.
607 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
608 * src/output.c (prepare): Don't output it.
609 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
610
92822aff
JD
6112009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
612
613 Fix strange %define locations for default values.
614 Reported by Akim Demaille at
615 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
616 and discussed again starting at
617 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
618 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
619 because location information is bogus.
620 Use angle brackets to delimit fake file name because square brackets
621 look like underexpanded m4. Choose a better fake file name.
622 Use negative line numbers.
623 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
624 * src/location.c (location_print): If line for a boundary is negative,
625 only print that boundary's file name.
626 * src/location.h: Document that.
627 * tests/skeletons.at (%define Boolean variables: invalid skeleton
628 defaults): Update output.
629
e021191b
JD
6302009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
631
632 Pacify ./configure --enable-gcc-warnings.
633 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
634 in lib won't compile with it.
635 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
636
78f65418
AD
6372009-03-31 Akim Demaille <demaille@gostai.com>
638
639 bootstrap: --help to stdout.
640 * bootstrap (usage): Don't send --help to stderr.
641 Use a here doc instead of a long string.
642
f7e241f4
AD
6432009-03-31 Akim Demaille <demaille@gostai.com>
644
645 bootstrap: README-hacking no longer exists
646 * bootstrap (checkout_only_file): Set to HACKING.
647
31d3e510
AD
6482009-03-26 Akim Demaille <demaille@gostai.com>
649
650 doc: merge HACKING and README-hacking.
651 Two files is confusing.
652 Reported by Alexandre Duret-Lutz.
1f9d8248 653
31d3e510
AD
654 * README-hacking: Merge into...
655 * HACKING (Working from the repository): here.
656
81535bfa
AD
6572009-03-26 Akim Demaille <demaille@gostai.com>
658
659 doc: update README-hacking.
660 * README-hacking: We now use git and git submodules.
661 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
662
56f772e9
AD
6632009-03-26 Akim Demaille <demaille@gostai.com>
664
665 lalr1.cc: avoid GCC 4.3 warnings.
666 GCC 4.3 now warns about "a || b && c" and asks for explicit
667 parentheses.
668 Reported by Alexandre Duret-Lutz.
669 * data/location.cc: Update copyright years.
670 (Position::operator==): Use parens to make precedence explicit.
671 Compare lines and columns first, as they are more likely to be
672 different, and they are faster to compare.
673
11c073b7
AD
6742009-03-26 Akim Demaille <demaille@gostai.com>
675
676 gnulib: update.
677 * gnulib: Update to latest.
678 * src/local.mk (AM_CFLAGS): Move to...
679 * Makefile.am: here.
680 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
681 AM_CFLAGS.
682
91be6b28
AD
6832009-03-02 Akim Demaille <demaille@gostai.com>
684
685 Comment changes.
686
cbf25ce7
AD
6872009-03-02 Akim Demaille <demaille@gostai.com>
688
689 Share b4_yytranslate_define.
690 * data/lalr1.cc (b4_yytranslate_define): Move to...
691 * data/c++.m4: here.
692
882f02ed
AD
6932009-03-02 Akim Demaille <demaille@gostai.com>
694
695 Use locations in the variant example.
1f9d8248
AD
696 Yes, this obfuscates the point of this example, variants only.
697 But glr.cc cannot work (yet?) without locations. This change
698 makes it easier to use this example with glr.cc.
11c073b7 699
882f02ed
AD
700 * examples/variant.yy (assert): %define it.
701 (locations): Request them.
702 (yylex): Bind the location to the stage.
703
0623bacc
AD
7042009-03-02 Akim Demaille <demaille@gostai.com>
705
706 Dub make_TOKEN as a public type interface.
707 * data/c++.m4 (b4_symbol_constructor_declare)
708 (b4_symbol_constructor_define): New empty stubs.
709 (b4_public_types_declare, b4_public_types_define): Use them.
710 * data/lalr1.cc (b4_symbol_constructor_declare)
711 (b4_symbol_constructor_declare_)
712 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
713 Move to...
714 * data/variant.hh: here.
715 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
716 needed.
717 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
718 b4_symbol_constructor_declare, as it is now done by
719 b4_public_types_define and b4_public_types_declare.
720
5f5a90df
AD
7212009-03-02 Akim Demaille <demaille@gostai.com>
722
723 Coding style changes.
724 * data/lalr1.cc (b4_symbol_constructor_declaration_)
725 (b4_symbol_constructor_declarations)
726 (b4_symbol_constructor_definition_)
727 (b4_symbol_constructor_definitions)
728 (b4_yytranslate_definition): Rename as...
729 (b4_symbol_constructor_declare_)
730 (b4_symbol_constructor_declare)
731 (b4_symbol_constructor_define_)
732 (b4_symbol_constructor_define)
733 (b4_yytranslate_define): these.
734 * data/variant.hh (b4_variant_definition): Rename as...
735 (b4_variant_define): this.
736
b47b6ff7
AD
7372009-03-02 Akim Demaille <demaille@gostai.com>
738
739 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
740 * data/bison.m4 (b4_percent_define_if_define): New.
741 * data/c++.m4 (b4_variant_if): Move to...
742 * data/bison.m4: Here, using b4_percent_define_if_define.
743 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
744 * data/bison.m4: Here, using b4_percent_define_if_define.
745
1d6b689b
AD
7462009-03-02 Akim Demaille <demaille@gostai.com>
747
748 Dub symbol_type_base as a public type.
749 * data/c++.m4 (b4_public_types_declare): Now define
750 symbol_type_base and symbol_type.
751 (b4_public_types_define): New.
752 In both cases, the definitions are taken verbatim from lalr1.cc.
753 * data/lalr1.cc: Adjust.
754
4f84717d
AD
7552009-03-02 Akim Demaille <demaille@gostai.com>
756
757 b4_public_types_declare.
758 * data/c++.m4 (b4_public_types_declare): New.
759 * data/glr.cc, data/lalr1.cc: Use it.
760
b9e4eb5b
AD
7612009-03-02 Akim Demaille <demaille@gostai.com>
762
763 b4_semantic_type_declare.
764 * data/c++.m4 (b4_semantic_type_declare): New.
765 Factors and generalizes what was in glr.cc and lalr1.cc.
766 * data/variant.hh (b4_semantic_type_declare): Redefine it for
767 variants.
768 * data/lalr1.cc, data/glr.cc: Use it.
769
6a6e7f0c
AD
7702009-02-26 Akim Demaille <demaille@gostai.com>
771
772 Upgrade gnulib.
773 * gnulib: Upgrade from master.
774 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
775 Regen.
776
e9e61b00
AD
7772009-02-25 Akim Demaille <demaille@gostai.com>
778
779 Remove useless arguments.
780 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
781 relevant.
782
3eead995
AD
7832009-02-25 Akim Demaille <demaille@gostai.com>
784
785 Comment changes.
786 * data/lalr1.cc: here.
787
87f28efe
AD
7882009-02-25 Akim Demaille <demaille@gostai.com>
789
790 Fix glr.cc's debug level handling.
791 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
792 glr.c which is used.
793 (debug_level, set_debug_level): Adjust.
794
9be2a009
AD
7952009-02-25 Akim Demaille <demaille@gostai.com>
796
797 Copyright years.
798 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
799
07a6e87d
AD
8002009-02-25 Akim Demaille <demaille@gostai.com>
801
802 Style changes.
803 * etc/bench.pl.in (generate_grammar_list): Consitently use
804 location_type, not yy::location.
805
33c78bd2
AD
8062009-02-25 Akim Demaille <demaille@gostai.com>
807
808 Comment change.
809 * data/lalr1.cc: here.
810
49572920
AD
8112009-02-19 Akim Demaille <demaille@gostai.com>
812
813 Make yyparser::error public.
814 * data/lalr1.cc: here.
815 There is no good reason to keep it private (and it is convenient
816 to use it from the scanner for instance). It is already public in
817 glr.cc.
818
88654b47
AD
8192009-02-19 Akim Demaille <demaille@gostai.com>
820
821 Comment changes.
822 * data/glr.cc: here.
823
4524c55b
AD
8242009-02-19 Akim Demaille <demaille@gostai.com>
825
826 Remove trailing blanks.
6a6e7f0c
AD
827 The epilogue has its own ending \n, no need to add another.
828
4524c55b
AD
829 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
830 epilogue.
831 * data/glr.cc: dnl when extending the epilogue.
832 Remove stray "private:".
833
6ceccee8
AD
8342009-02-19 Akim Demaille <demaille@gostai.com>
835
836 Use b4_c_modern.
837 * data/c.m4 (b4_c_function_decl): Here.
838
9c6a8966
AD
8392009-02-19 Akim Demaille <demaille@gostai.com>
840
841 Comment changes.
842 * data/lalr1.cc: here.
843
507aa0e2
AD
8442009-02-19 Akim Demaille <demaille@gostai.com>
845
846 Extract variant.hh
847 * data/variant.hh: New, extracted from...
848 * data/lalr1.cc: here.
849 Adjust.
850 * data/local.mk: Adjust.
851
51bacae6
AD
8522009-02-19 Akim Demaille <demaille@gostai.com>
853
854 Extract stack.hh from lalr1.cc.
855 * data/stack.hh: New.
856 * data/lalr1.cc: Extract from here.
857 * data/local.mk: Adjust.
858
06c3084f
JD
8592009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
860
861 Add reminder about uploading public key to keys.gnupg.net.
862 * HACKING (Release Procedure): Here.
863
0ea583d2
AD
8642009-01-28 Akim Demaille <demaille@gostai.com>
865
866 * NEWS: Update information about 2.4.1 and 2.4.2.
867
402b123d
AD
8682008-11-04 Akim Demaille <demaille@gostai.com>
869
870 Reformat NEWS.
871 * NEWS: Use more outline-mode markup.
872 Suggested by Jim Meyering.
873
74553c98
AD
8742009-01-08 Akim Demaille <demaille@gostai.com>
875
876 Fix grep portability issues.
877 Grep on Solaris does not support -q.
878 Reported by Summum Bonum.
879
880 * NEWS: Add a stub for 2.4.2.
881 * THANKS: Add Summum Bonum.
882 * tests/atlocal.in (EGREP): New.
883 (CC, CXX, XSLTPROC): Make it possible to override them via
884 envvars.
885 * tests/java.at: Use $EGREP instead of egrep.
886 Use AT_CHECK's ignore instead of grep's -q.
887
84eedf86
AD
8882008-12-11 Akim Demaille <demaille@gostai.com>
889
890 Pass the token type to yysyntax_error.
891 * data/yacc.c (yysyntax_error): Take the transated token instead
892 of the raw number.
893 Adjust callers.
894 * TODO: Update.
895
5860cc8c
AD
8962008-12-11 Akim Demaille <demaille@gostai.com>
897
898 Formatting changes.
899 * data/glr.c: Formatting changes.
900
2b008529
AD
9012008-12-11 Akim Demaille <demaille@gostai.com>
902
903 Propagate i18n changes into glr.c.
904 * TODO: Update.
905 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
906 building the error message format dynamically.
907 * data/lalr1.java: Formatting changes.
908
2cd1af95
AD
9092008-12-11 Akim Demaille <demaille@gostai.com>
910
911 Use testsuite -C.
912 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
913 Solves problems when top_srcdir is an absolute path.
914 Suggested by Eric Blake.
915 * configure.ac: Require Autoconf 2.62.
916
eeb29422
AD
9172008-12-11 Akim Demaille <demaille@gostai.com>
918
919 Simplify the i18n of the error messages.
920 * data/lalr1.cc: Comment changes.
921 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
922 lalr1.cc instead of building dynamically the format string.
923
6617622c
AD
9242008-12-08 Akim Demaille <demaille@gostai.com>
925
926 Fix portability issue in the test suite.
927 * tests/local.at (AT_MATCHES_CHECK): New.
928 Based on Perl instead of Sed. Sed has too many portability
929 pitfalls, not ever Sed is GNU Sed.
930 * tests/actions.at (Fix user actions without a trailing semicolon):
931 Use it.
932
2ca1136c
AD
9332008-12-08 Akim Demaille <demaille@gostai.com>
934
935 Update data/README.
936 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
937
6c63b895
AD
9382008-12-08 Akim Demaille <demaille@gostai.com>
939
940 Install autoconf as a submodule to get m4sugar.
941 * .gitmodules: Add submodules/autoconf.
942 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
943 submodules/autoconf.
944
417e31d2
AD
9452008-12-08 Akim Demaille <demaille@gostai.com>
946
947 Test token.prefix in all the skeletons.
948 * data/java.m4 (b4_token_enum): Use the token.prefix.
949 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
950 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
951 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
952 * tests/java.at: Comment changes.
953 (AT_CHECK_JAVA_MINIMAL): Define the END token.
954 (Java parser class and package names): Add token.prefix check.
955
97abf544
AD
9562008-12-08 Akim Demaille <demaille@gostai.com>
957
958 Fix regeneration of atconfig.
959 * tests/local.mk (tests/atconfig): The rule was incorrect, but
960 remove it: now that there is no tests/Makefile.am, the top-level
961 Makefile properly updates atconfig when needed.
962
e8cd1ad6
DJ
9632008-12-07 Di-an Jan <dianj@freeshell.org>
964
965 Implement the FIXME that ends an user action with a semicolon
966 if it seems necessary.
967 * src/scan-code.l (flex rules section): Flag cpp directive from
968 any `#' to the first unescaped end-of-line. Semicolon is not
969 needed after `;', `{', '}', or cpp directives and is needed after
970 any other token (whitespaces and comments have no effect).
971 * tests/actions.at (Fix user actions without a trailing semicolon):
972 New test.
973 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
974 to make user actions complete statements.
975 Adjust column numbers in error messages.
976 * tests/regression.at (Fix user actions without a trailing semicolon):
977 Remove. Covered by new test.
978
ce9447fc
AD
9792008-12-07 Akim Demaille <demaille@gostai.com>
980
981 Update gnulib.
982 * gnulib: Update from master.
983
d333175f
EB
9842008-12-05 Eric Blake <ebb9@byu.net>
985
986 Avoid compiler warning.
987 * src/output.c (muscle_insert_item_number_table): Delete unused
988 function.
989
215b40ac
EB
9902008-12-02 Eric Blake <ebb9@byu.net>
991
992 Build testsuite with newer autoconf.
993 * tests/output.at (m4_expand): Don't override in newer autoconf,
994 where the underlying implementation changed.
995 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
996 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
997 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
998 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
999 since some of them contain unbalanced ')'.
1000
3bb21113
AD
10012008-12-01 Akim Demaille <demaille@gostai.com>
1002
1003 Use b4_symbol for printers and destructors everywhere.
1004 * data/bison.m4 (b4_symbol_action_location): New.
1005 * data/c.m4 (b4_symbol_actions): Remove.
1006 Adjust all callers to use by b4_symbol_foreach and the corresponding
1007 b4_symbol_printer/destructor macro.
1008 * data/glr.cc: Adjust.
1009 * data/lalr1.java: Adjust the %destructor sanity check.
1010 * src/output.c (symbol_code_props_output): Remove, we no longer
1011 need the b4_symbol_printers/destructors tables.
1012
fb7c5b1f
AD
10132008-12-01 Akim Demaille <demaille@gostai.com>
1014
1015 Use b4_symbol_case_.
1016 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1017 b4_symbol_case_.
1018
cf6fb222
AD
10192008-12-01 Akim Demaille <demaille@gostai.com>
1020
1021 Move b4_symbol based macro to bison.m4.
1022 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1023 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1024 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1025 (b4_type_foreach): Move to...
1026 * data/bison.m4: Here.
1027 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1028 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 1029
e3c52a63
AD
10302008-12-01 Akim Demaille <demaille@gostai.com>
1031
1032 b4_symbol/type_foreach.
1033 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1034 Use them.
1035
2bde9113
AD
10362008-12-01 Akim Demaille <demaille@gostai.com>
1037
1038 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
1039 Instead of defining complex list of tuples to define various
1040 properties of the symbols, we now prefer to define symbols as
1041 "structs" in m4: using the symbol key (its number), and the
1042 property name, b4_symbol gives it value. Use this to handle
1043 destructors and printers.
1044
2bde9113
AD
1045 * src/output.c (CODE_PROP): New.
1046 (prepare_symbol_definitions): Use it to define the printer and
1047 destructor related attributes of the symbols.
1048 * data/lalr1.cc (b4_symbol_actions): Rename as...
1049 (b4_symbol_action): this.
1050 Use b4_symbol instead of 6 arguments.
1051 (b4_symbol_printer, b4_symbol_destructor): New.
1052 Use them instead of b4_symbol_actions.
1053
44494bf6
AD
10542008-12-01 Akim Demaille <demaille@gostai.com>
1055
1056 Avoid capturing variables too easily.
1057 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1058 v__ and p__ instead of v and p.
1059
fad814bd
AD
10602008-12-01 Akim Demaille <demaille@gostai.com>
1061
1062 Remove spurious empty line before syncline.
1063 * data/bison.m4 (b4_syncline): Don't output an empty line before
1064 the output.
1065
feda5527
AD
10662008-11-26 Akim Demaille <demaille@gostai.com>
1067
1068 Convert lib/Makefile.am into lib/local.mk.
1069 The real problem is rather gnulib.mk, which itself is extracted
1070 from a Makefile.am that gnulib expects to the "recursive". The
1071 tool prefix-gnulib-mk converts such a gnulib.mk to be
1072 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1073
1074 * etc/prefix-gnulib-mk: New.
1075 * bootstrap (slurp): Use it to convert further gnulib.mk.
1076 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1077 are deeper.
1078 * lib/Makefile.am: Rename as...
1079 * lib/local.mk: this.
1080 Adjust to be prefixed.
1081 * Makefile.am, configure.ac: Adjust.
1082 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1083
56ddee7f
AD
10842008-11-26 Akim Demaille <demaille@gostai.com>
1085
1086 s/_FLAGS/FLAGS/.
1087 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1088 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1089 Reported by Eric Blake.
1090
728e89a0
AD
10912008-11-26 Akim Demaille <demaille@gostai.com>
1092
1093 Use b4_parser_tables_define in glr.cc.
1094 * data/glr.c: Use b4_parser_tables_define instead of defining the
1095 (deterministic integral) tables by hand.
1096
2c1bf9bd
AD
10972008-11-26 Akim Demaille <demaille@gostai.com>
1098
1099 Use b4_parser_tables_define in Java.
1100 * data/java.m4 (b4_typed_parser_table): Rename as...
1101 (b4_typed_parser_table_define): this, for consistency.
1102 Accept a comment as $4.
1103 Move $2 into yy*_.
1104 (b4_integral_parser_table): Rename as...
1105 (b4_integral_parser_table_define): this.
1106 * data/lalr1.java: Adjust all uses.
1107 Use b4_parser_tables_define instead of generation by hand.
1108
ba206cf4
AD
11092008-11-26 Akim Demaille <demaille@gostai.com>
1110
1111 Prepare the convergence bw C style and Java table generation.
1112 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1113 (b4_tables_define): Rename as...
1114 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1115 (b4_parser_tables_define): these.
1116 * data/c.m4 (b4_table_define): Rename as...
1117 (b4_integral_parser_table_define): this.
1118 * data/lalr1.cc: Adjust.
1119 (b4_table_define, b4_table_declare): Rename as...
1120 (b4_integral_parser_table_define)
1121 (b4_integral_parser_table_declare): these.
1122 (yyrline_): Move the comment where it is actually used.
1123 * data/yacc.c: Adjust.
1124 (yyrline): Use b4_integral_parser_table_define.
1125
d12f8e49
AD
11262008-11-26 Akim Demaille <demaille@gostai.com>
1127
1128 Regen.
1129 * src/parse-gram.h, src/parse-gram.c: Regen.
1130
0991e29b
AD
11312008-11-26 Akim Demaille <demaille@gostai.com>
1132
1133 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1134 * data/lalr1.cc (b4_tables_map): Move to...
1135 * data/bison.m4: here.
1136 Update the comment for yytable during the flight.
1137 (b4_tables_declare, b4_tables_define): New.
1138 * data/lalr1.cc: Use them.
1139 * data/c.m4 (b4_table_define): New.
1140 * data/yacc.c: Use b4_tables_define instead of output the tables
1141 by hand.
1142 * tests/regression.at (Web2c Actions): Adjust the expected output,
1143 the order of the tables changed.
1144
3d3bc1fe
AD
11452008-11-26 Akim Demaille <demaille@gostai.com>
1146
1147 Get rid of (yy)rhs and (yy)prhs.
1148 These tables are no longer needed in the parsers, and they don't seem to
1149 be useful. They are not documented either.
feda5527 1150
3d3bc1fe
AD
1151 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1152 Adjust the computation of (yy)r2.
1153
08c81469
AD
11542008-11-26 Akim Demaille <demaille@gostai.com>
1155
1156 Rule length is unsigned.
1157 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1158
932b0c96
AD
11592008-11-26 Akim Demaille <demaille@gostai.com>
1160
1161 Get rid of lalr1-split.cc.
1162 It was no longer maintainer.
feda5527 1163
932b0c96
AD
1164 * data/lalr1-split.cc: Remove.
1165 * etc/bench.pl.in (bench_fusion_parser): Remove.
1166 Adjust.
1167
8452c667
AD
11682008-11-26 Akim Demaille <demaille@gostai.com>
1169
1170 Use yy* consistently.
1171 * data/glr.c: Now that yyrhs no longer exists as a global
1172 variable, rename local "rhs" variables into "yyrhs" for
1173 consistency.
1174
783aa653
AD
11752008-11-25 Akim Demaille <demaille@gostai.com>
1176
1177 Get rid of yyrhs and yyprhs in glr.c.
1178 * data/glr.c (yyrhs, yyprhs): Remove.
1179 Instead, use the state stack and yystos.
1180
6130b755
AD
11812008-11-25 Akim Demaille <demaille@gostai.com>
1182
1183 Flag glr tests.
1184 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1185 as an Autotest keyword.
1186
95a7b1c9
AD
11872008-11-25 Akim Demaille <demaille@gostai.com>
1188
1189 Prefer TESTSUITE_FLAGS.
1190 TESTSUITEFLAGS is barely readable.
feda5527 1191
95a7b1c9
AD
1192 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1193 for backward compatibility.
1194 Use the former instead of the latter.
1195
b4f18401
AD
11962008-11-25 Akim Demaille <demaille@gostai.com>
1197
1198 Get rid of yyrhs and yyprhs in larl1.java.
1199 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1200 (yy_reduce_print): Rather, use yystos_ and the state stack.
1201
c265fd6b
AD
12022008-11-25 Akim Demaille <demaille@gostai.com>
1203
1204 Formatting changes.
1205
68dbdee8
AD
12062008-11-25 Akim Demaille <demaille@gostai.com>
1207
1208 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
1209 They were used to get the symbol types, given a rule number, when
1210 displaying the top of the stack before a reduction. But the
1211 symbol type is available from the state stack. This has two be
1212 benefits: two tables less in the parser (making it smaller), and a
1213 more consistent use of the three stacks which will help to fuse
1214 them.
feda5527 1215
68dbdee8
AD
1216 * data/yacc.c (yyprhs, yyrhs): Remove.
1217 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1218 (yy_reduce_print): Take yyssp as argument.
1219 Use it, together with yystos, to get the symbol type.
1220 * tests/regression.at (Web2c Report): Remove these tables from the
1221 expected output.
1222
6ab1adbe
AD
12232008-11-25 Akim Demaille <demaille@gostai.com>
1224
1225 b4_tables_map.
1226 The point is to factor the generation of the tables across skeletons.
1227 This is language dependant.
feda5527 1228
6ab1adbe
AD
1229 * data/c.m4 (b4_comment_): New.
1230 Should be usable to define how to generate tables independently of
1231 the language.
1232 (b4_c_comment): New.
1233 (b4_comment): Bounce to b4_c_comment.
1234 Now support $2 = [PREFIX] for indentation.
1235 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1236 there is no comment.
1237 Indent it properly when there is one.
1238 Output the ending semicolon.
1239 (b4_table_define): Space changes.
1240 Output the ending semicolon.
1241 (b4_tables_map): New.
1242 Use it twice instead of declaring and defining the (integral)
1243 tables by hand.
1244
0fddb3d5
AD
12452008-11-25 Akim Demaille <demaille@gostai.com>
1246
1247 b4_table_declare.
1248 * data/lalr1.cc (b4_table_declare): New.
1249 Use it to declare the tables defined with b4_table_define.
1250 (b4_table_define): Declare a third arg to match b4_table_declare
1251 signature.
1252 Move all the comments around invocations of b4_table_define into
1253 the invocations itselves.
1254 Move things around to have the order for declarations and
1255 definitions.
1256
c4ddc0fb
AD
12572008-11-25 Akim Demaille <demaille@gostai.com>
1258
1259 Formatting changes.
1260 * data/lalr1.java: here.
1261
e0c653e7
AD
12622008-11-25 Akim Demaille <demaille@gostai.com>
1263
1264 b4_args is more general than only C++.
1265 * data/lalr1.cc (b4_args, _b4_args): Move to...
1266 * data/bison.m4: here.
1267
4182a0a1
DJ
12682008-11-21 Di-an Jan <dianj@freeshell.org>
1269
1270 Implement no-XXX arguments for --warnings, --report, --trace.
1271 * src/getargs.c (flags_argmatch): Handles no-XXX.
1272 Fix typo in doxygen comment.
1273
01466c3e
AD
12742008-11-21 Akim Demaille <demaille@gostai.com>
1275
1276 Display the changes in cross-options.texi.
1277 * build-aux/cross-options.pl ($sep): New, to separate items.
1278 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1279 changes.
1280
a7c09cba
DJ
12812008-11-20 Di-an Jan <dianj@freeshell.org>
1282
1283 Improves options in the manual.
1284 * doc/bison.texinfo (-g, -x): Add space before argument.
1285 (Option Cross Key): Implement FIXME: listing directives also.
1286 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1287 (Short Option): Special case -d. Put arguments inside @option.
feda5527 1288 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
1289 src/scan-gram.l (actual name passed as the first argument)
1290 with special case for %define.
1291 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
1292 to build-aux/cross-options.pl.
1293 * src/getargs.c (usage): Document limitations of cross-options.pl.
1294 * src/scan-gram.l: Likewise.
1295
6c88b51e
JD
12962008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1297
1298 Fix unexpanded macros in GLR defines file.
1299 Reported by Csaba Raduly at
1300 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1301 * THANKS (Csaba Raduly): Add.
1302 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1303 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1304 lexer in a separate module that includes the defines file.
1305 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
1306 source.
1307 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1308 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1309 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1310 (AT_DATA_SOURCE_PROLOGUE): New.
1311 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1312 (AT_DATA_SOURCE): New.
1313 (AT_FULL_COMPILE): Extend to support an additional source file.
1314
1e034807
AD
13152008-11-18 Akim Demaille <demaille@gostai.com>
1316
1317 More TODO.
1318 * TODO: More short term issues.
1319
e3dda35c
AD
13202008-11-18 Akim Demaille <demaille@gostai.com>
1321
1322 Regen.
1323 * src/parse-gram.h, src/parse-gram.c: Regen.
1324
bd187d7b
AD
13252008-11-18 Akim Demaille <demaille@gostai.com>
1326
1327 Use b4_subtract where possible.
1328 * data/lalr1.cc (b4_subtract): Move to...
1329 * data/bison.m4: here.
1330 * data/glr.c (b4_rhs_data): Use it.
1331 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
1332
6085ab0d
AD
13332008-11-18 Akim Demaille <demaille@gostai.com>
1334
1335 Remove incorrect mode specification.
1336 * data/glr.cc: Don't pretend it's C code.
1337
9ce405ce
JD
13382008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1339
1340 Simplify last patch slightly.
1341 * src/getargs.c (getargs): Here.
1342
a8beef7e
JD
13432008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1344
1345 Fix last warning from --enable-gcc-warnings.
1346 * src/getargs.c (getargs): Don't assign const address to non-const
1347 pointer.
1348
d50eea6d
JD
13492008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1350
1351 Don't let maintainer-*-check targets force a version update.
1352 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1353 handled.
1354
f5f419de
DJ
13552008-11-17 Di-an Jan <dianj@freeshell.org>
1356
1357 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1358 Align menus. Adjust word wrapping. Use node names for menu names.
1359 (Examples): Don't abbreviate node names.
1360 (LocalWords): Remove abbreviations.
1361 (Copying): Make description a sentence.
d50eea6d 1362 (Java Action Features): Remove period to match the rest of menu.
f5f419de 1363
d73e55e0
DJ
13642008-11-17 Di-an Jan <dianj@freeshell.org>
1365
1366 Handles several --enable-gcc-warnings.
1367 * src/getargs.c (command_line_location): Set parameters to void.
1368 * src/output.c (symbol_type_name_cmp): Make static.
1369 (symbols_by_type_name): Set parameters to void.
1370 (symbol_definitions_output): Remove unused parameter. Rename as...
1371 (prepare_symbol_definitions): this.
1372 (muscles_output): Move symbol_definitions_output to...
1373 (output): here as prepare_symbol_definitions.
1374 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 1375 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 1376
68c989de
DJ
13772008-11-17 Di-an Jan <dianj@freeshell.org>
1378
1379 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
1380 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
1381
23ce6f4c
AD
13822008-11-16 Akim Demaille <demaille@gostai.com>
1383
1384 Add missing $(EXEEXT).
1385 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
1386 "src/bison$(EXEEXT)".
1387 Reported by Di-an Jan.
1388
dd704c35
AD
13892008-11-15 Akim Demaille <demaille@gostai.com>
1390
1391 * TODO: Update.
1392
dab244d5
AD
13932008-11-15 Akim Demaille <demaille@gostai.com>
1394
1395 Formatting changes.
1396 * tests/input.at: here.
1397
4b4da9fb
AD
13982008-11-15 Akim Demaille <demaille@gostai.com>
1399
1400 Remove duplicate header inclusion.
1401 * src/LR0.c: here.
1402
4ea3f53d
AD
14032008-11-15 Akim Demaille <demaille@gostai.com>
1404
1405 * src/parse-gram.h, src/parse-gram.c: Regen.
1406
cb823b6f
AD
14072008-11-15 Akim Demaille <demaille@gostai.com>
1408
1409 Support parametric types.
b06df3c2
AD
1410
1411 There are two issues to handle: first scanning nested angle
1412 bracket pairs to support types such as std::pair< std::string,
1413 std::list<std::string> > >.
1414
1415 Another issue is to address idiosyncracies of C++: do not glue two
1416 closing angle brackets together (otherwise it's operator>>), and
1417 avoid sticking blindly a TYPE to the opening <, as it can result
1418 in '<:' which is a digraph for '['.
1419
cb823b6f
AD
1420 * src/scan-gram.l (brace_level): Rename as...
1421 (nesting): this.
1422 (SC_TAG): New.
1423 Implement support for complex tags.
b06df3c2 1424 (tag): Accept
cb823b6f
AD
1425 , but not <.
1426 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
1427 (b4_symbol_variant): Leave space around types as parameters.
1428 * examples/variant.yy: Use nested template types and leading ::.
1429 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
1430 Rename as...
1431 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
1432 * tests/c++.at: Test parametric types.
1433
7b6e6753
AD
14342008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1435
1436 Test token.prefix.
1437 This is not sufficient, but we test at least that the make_SYMBOL
1438 interface is not affected by token.prefix. A more general test
1439 will be implemented when the support of token.prefix is generalized
1440 to more skeletons.
b06df3c2 1441
7b6e6753
AD
1442 * tests/c++.at: One more variant test, using token.prefix.
1443
dddec537
AD
14442008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1445
1446 Test the make_TOKEN interface.
1447 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
1448 Factor the common code in yylex.
1449 Use it to test "%define lex_symbol".
1450
7d3e21ba
AD
14512008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1452
1453 Formatting change.
1454
4fc55348
AD
14552008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1456
1457 Simplify code for variants bench marks.
1458 * etc/bench.pl.in (&generate_grammar_list): Define and use
1459 location_type.
1460 Factor the common code in yylex.
1461
070e6509
AD
14622008-11-15 Akim Demaille <demaille@gostai.com>
1463
1464 Better error message.
1465 * bootstrap (find_tool): Fix the error message.
1466
0078681b
AD
14672008-11-15 Akim Demaille <demaille@gostai.com>
1468
1469 Update variant.yy to newest interface.
1470 * examples/variant.yy: Define lex_symbol.
1471 Adjust.
1472
ff084799
AD
14732008-11-15 Akim Demaille <demaille@gostai.com>
1474
1475 Don't use locations in variant.yy.
1476 * examples/variant.yy: Adjust to not using locations.
1477
b0d79ec6
AD
14782008-11-15 Akim Demaille <demaille@gostai.com>
1479
1480 Comment changes.
1481 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1482 comments for the license.
1483
d4977ce3
AD
14842008-11-15 Akim Demaille <demaille@gostai.com>
1485
1486 Remove tests/Makefile.am.
1487 * tests/Makefile.am: Rename as...
1488 * tests/local.mk: this.
1489 * Makefile.am, configure.ac: Adjust.
1490 * Makefile.am (DISTCLEANFILES): Define.
1491 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1492 Remove, we no longer need to bounce to the real targets.
1493
87f1149a
AD
14942008-11-15 Akim Demaille <demaille@gostai.com>
1495
1496 Comment changes.
1497
36415906
AD
14982008-11-15 Akim Demaille <demaille@gostai.com>
1499
1500 djgpp/local.mk.
1501 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1502 * djgpp/local.mk: this new file.
1503
e2c2f696
AD
15042008-11-15 Akim Demaille <demaille@gostai.com>
1505
1506 Remove doc/Makefile.am.
1507 * doc/Makefile.am: Rename as...
1508 * doc/local.mk: this.
1509 Adjust paths
1510 * Makefile.am, configure.ac: Adjust.
1511 * Makefile.am (MOSTLYCLEANFILES): New.
1512 * src/local.mk: Adjust.
1513
2ead32e6
AD
15142008-11-15 Akim Demaille <demaille@gostai.com>
1515
1516 Move sc_tight_scope into maint.mk.
b06df3c2
AD
1517 It does not work, and I don't know how it was supposed to work: it
1518 seems to be looking for sources in the build tree. I just moved
1519 it at a better place, fixing it is still required.
1520
2ead32e6
AD
1521 * src/local.mk (echo): Remove.
1522 (sc_tight_scope): Move to...
1523 * maint.mk: here.
1524
2df9ec37
AD
15252008-11-15 Akim Demaille <demaille@gostai.com>
1526
1527 Regen.
1528 * src/parse-gram.h, src/parse-gram.h: Regen.
1529
0305d25e
AD
15302008-11-15 Akim Demaille <demaille@gostai.com>
1531
1532 Remove src/Makefile.am.
1533 * src/Makefile.am: Rename as...
1534 * src/local.mk: this.
1535 Prefix all the paths with src/.
1536 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1537 (AM_CPPFLAGS): Find find in builddir/src.
1538 (YACC): Move the flags into...
1539 (AM_YFLAGS): here.
1540 * maint.mk (sc_tight_scope): Disable.
1541 It used to bounce to the version in src/Makefile.am which is now
1542 part of this very Makefile.
1543 * Makefile.am, configure.ac: Adjust.
1544 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1545 include "..." to find files "here": we are no longer in src/, so
1546 qualify the includes with src/.
1547 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1548 prefix.
1549 (.x.1): Adjust to be able to create src/foo from the top level
1550 Makefile, instead of going bounce to src/Makefile the creation of
1551 foo.
1552
5277c0a3
AD
15532008-11-15 Akim Demaille <demaille@gostai.com>
1554
1555 Remove useless variable.
1556 * doc/Makefile.am (srcsrcdir): Remove.
1557
6a5aa0cd
AD
15582008-11-15 Akim Demaille <demaille@gostai.com>
1559
1560 Remove data/Makefile.am.
1561 * data/Makefile.am: Rename as...
1562 * data/local.mk: this.
1563 Adjust paths.
1564 * Makefile.am, configure.ac: Adjust.
1565
7cb794dc
AD
15662008-11-15 Akim Demaille <demaille@gostai.com>
1567
1568 Remove etc/Makefile.am.
1569 * etc/Makefile.am: Rename as...
1570 * etc/local.mk: this.
1571 Adjust.
1572 * Makefile.am, configure.ac: Adjust.
1573
cd409e3b
AD
15742008-11-15 Akim Demaille <demaille@gostai.com>
1575
1576 Remove examples/local.mk.
1577 examples/calc++/Makefile.am might be interesting to keep as is, since
1578 it is an example in itself.
2df9ec37 1579
cd409e3b
AD
1580 * examples/Makefile.am: Rename as...
1581 * examples/local.mk: this.
1582 Adjust.
1583 * Makefile.am, configure.ac: Adjust.
1584
9a1e4214
AD
15852008-11-15 Akim Demaille <demaille@gostai.com>
1586
1587 Remove build-aux/Makefile.am.
1588 Recursive Makefiles are really way too slow, let's get rid of some of
1589 them.
2df9ec37 1590
9a1e4214
AD
1591 * build-aux/Makefile.am: Rename as...
1592 * build-aux/local.mk: this.
1593 Adjust paths.
1594 * Makefile.am, configure.ac: Adjust.
1595
0634493c
AD
15962008-11-15 Akim Demaille <demaille@gostai.com>
1597
1598 Provide convenience constructors for locations and positions.
1599 * data/location.cc (position::position): Accept file, line and
1600 column as arguments with default values.
1601 Always qualify initial line and column literals as unsigned.
1602 (location::location): Provide convenience constructors.
1603
fe1b448a
AD
16042008-11-15 Akim Demaille <demaille@gostai.com>
1605
b06df3c2
AD
1606 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1607 token type.
fe1b448a
AD
1608 Using template buys us nothing, and makes it uselessly complex to
1609 construct a symbol. Besides, it could not be generalized to other
1610 languages, while make_FOO would work in C/Java etc.
2df9ec37 1611
fe1b448a
AD
1612 * data/lalr1.cc (b4_symbol_): New.
1613 (b4_symbol): Use it.
1614 (b4_symbol_constructor_declaration_)
1615 (b4_symbol_constructor_definition_): Instead of generating
1616 specializations of an overloaded template function, just generate
1617 several functions whose names are forged from the token names
1618 without the token.prefix.
1619 (b4_symbol_constructor_declarations): Generate them for all the
1620 symbols, not just by class of symbol type, now that instead of
1621 specializing a function template by the token, we generate a
1622 function named after the token.
1623 (b4_symbol_constructor_specialization_)
1624 (b4_symbol_constructor_specializations): Remove.
1625 * etc/bench.pl.in: Adjust to this new API.
1626
5679f311
AD
16272008-11-13 Akim Demaille <demaille@gostai.com>
1628
1629 %define token.prefix.
b06df3c2
AD
1630 Provide a means to add a prefix to the name of the tokens as
1631 output in the generated files. Because of name clashes, it is
1632 good to have such a prefix such as TOK_ that protects from names
1633 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 1634
5679f311
AD
1635 * data/bison.m4 (token.prefix): Empty by default.
1636 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1637 * data/lalr1.cc (b4_symbol): Ditto.
1638
3204049e
AD
16392008-11-13 Akim Demaille <demaille@gostai.com>
1640
1641 Compute at M4 time some of the subtractions.
90290ce5 1642 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
1643 (b4_rhs_data): Use it.
1644
202598d3
AD
16452008-11-13 Akim Demaille <demaille@gostai.com>
1646
1647 symbol::token.
b06df3c2 1648 This allows the user to get the type of a token returned by yylex.
2df9ec37 1649
202598d3
AD
1650 * data/lalr1.cc (symbol::token): New.
1651 (yytoknum_): Define when %define lex_symbol, independently of
1652 %debug.
1653 (yytoken_number_): Move into...
1654 (symbol::token): here, since that's the only use.
1655 The other one is YYPRINT which was not officially supported
1656 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1657 array under a different name (yytoknum).
1658
fc2476c7
AD
16592008-11-13 Akim Demaille <demaille@gostai.com>
1660
1661 YYERRCODE.
1662 * TODO (YYERRCODE): Mention the case of $undef.
1663
865f1e9f
AD
16642008-11-13 Akim Demaille <demaille@gostai.com>
1665
1666 TODO: YYPRINT.
1667 * TODO (YYPRINT): New.
1668
cb0b136a
AD
16692008-11-13 Akim Demaille <demaille@gostai.com>
1670
1671 Comment changes.
1672 * data/lalr1.cc, data/yacc.c: Fix the description of the
1673 yytranslate and yytoknum tables.
1674
2c086d29
AD
16752008-11-13 Akim Demaille <demaille@gostai.com>
1676
1677 Define make_symbol in the header.
b06df3c2
AD
1678 To reach good performances these functions should be inlined (yet
1679 this is to measure precisely). To this end they must be available
1680 to the caller.
2df9ec37 1681
2c086d29
AD
1682 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1683 location_type with the class name.
1684 Since will now be output in the header, declare "inline".
1685 No longer use b4_symbol_constructor_specializations, but
1686 b4_symbol_constructor_definitions in the header.
1687 Don't call it in the *.cc file.
1688
1c4af381
AD
16892008-11-13 Akim Demaille <demaille@gostai.com>
1690
1691 Define yytranslate in the header for lex_symbol.
1692 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1693 into the header file when using %define lex_symbol.
1694 (yytranslate_): Declare inline.
1695
e51b0a82
AD
16962008-11-13 Akim Demaille <demaille@gostai.com>
1697
b06df3c2
AD
1698 Define the constructors of symbol_type in
1699 b4_symbol_constructor_definitions.
e51b0a82 1700 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
1701 forthcoming patch will move elsewhere. Hence the interest of
1702 putting them together.
2df9ec37 1703
b06df3c2
AD
1704 The stack_symbol_type does not need to be moved, it is used only
1705 by the parser.
2df9ec37 1706
e51b0a82
AD
1707 * data/lalr1.cc: Move symbol_type and symbol_base_type
1708 constructors into...
1709 (b4_symbol_constructor_definitions): here.
1710 Adjust.
1711
78835571
AD
17122008-11-13 Akim Demaille <demaille@gostai.com>
1713
1714 Make it easier to move the definition of yytranslate_.
1715 Forthcoming changes will make it possible to use yytranslate_
1716 from outside the parser implementation file.
2df9ec37 1717
78835571
AD
1718 * data/lalr1.cc (b4_yytranslate_definition): New.
1719 Use it.
1720
c1e6c88c
AD
17212008-11-13 Akim Demaille <demaille@gostai.com>
1722
1723 Remove useless class specification.
1724 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1725 to refer to the class name to use a type defined by the class for
1726 arguments of member functions.
1727
4654b0c0
AD
17282008-11-13 Akim Demaille <demaille@gostai.com>
1729
1730 Finer input type for yytranslate.
1731 This patch is debatable: the tradition expects yylex to return an int
1732 which happens to correspond to token_number (which is an enum). This
1733 allows for instance to return characters (such as '*' etc.). But this
1734 goes against the stronger typing I am trying to have with the new
1735 lex interface which return a symbol_type. So in this case, feed
1736 yytranslate_ with a token_type.
2df9ec37 1737
4654b0c0
AD
1738 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1739 expect a token_type.
1740
dd735e4e
AD
17412008-11-13 Akim Demaille <demaille@gostai.com>
1742
1743 Honor lex-params in %define lex_symbol mode.
1744 * data/lalr1.cc: Use b4_lex_param.
1745
6659366c
AD
17462008-11-13 Akim Demaille <demaille@gostai.com>
1747
1748 Simplify names.
1749 * src/output.c (symbol_definitions_output): Rename symbol
1750 attributes type_name and has_type_name as type and has_type.
1751 * data/lalr1.cc: Adjust uses.
1752
e9805e57
AD
17532008-11-13 Akim Demaille <demaille@gostai.com>
1754
1755 Use b4_type_names for the union type.
b06df3c2
AD
1756 The union used to compute the size of the variant used to iterate
1757 over the type of all the symbols, with a lot of redundancy. Now
1758 iterate over the lists of symbols having the same type-name.
2df9ec37 1759
e9805e57
AD
1760 * data/lalr1.cc (b4_char_sizeof_): New.
1761 (b4_char_sizeof): Use it.
1762 Adjust to be called with a list of numbers instead of a single
1763 number.
1764 Adjust its caller for new-line issues.
1765
aea10ef4
AD
17662008-11-13 Akim Demaille <demaille@gostai.com>
1767
1768 Define the "identifier" of a symbol.
b06df3c2
AD
1769 Symbols may have several string representations, for instance if
1770 they have an alias. What I call its "id" is a string that can be
1771 used as an identifier. May not exist.
2df9ec37 1772
b06df3c2
AD
1773 Currently the symbols which have the "tag_is_id" flag set are
1774 those that don't have an alias. Look harder for the id.
2df9ec37 1775
aea10ef4
AD
1776 * src/output.c (is_identifier): Move to...
1777 * src/symtab.c (is_identifier): here.
1778 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1779 * src/output.c (symbol_definitions_output): Use it to define "id"
1780 and "has_id".
1781 Remove the definition of "tag_is_id".
1782 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1783 "tag_is_id" were used to produce code.
1784 We still use "tag" for documentation.
1785
2ea7730c
AD
17862008-11-11 Akim Demaille <demaille@gostai.com>
1787
1788 Locations are no longer required by lalr1.cc.
1789 * data/lalr1.cc (_b4_args, b4_args): New.
1790 Adjust all uses of locations to make them optional.
1791 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1792 (AT_CHECK_NAMESPACE): Check the use of locations.
1793 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1794 without locations with lalr1.cc.
1795 Test these cases.
1796 * tests/output.at: Check lalr1.cc with and without location
1797 support.
1798 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1799 Don't use locations.
1800
7ca2266a
AD
18012008-11-11 Akim Demaille <demaille@gostai.com>
1802
1803 AT_FULL_COMPILE.
1804 * tests/local.at (AT_FULL_COMPILE): New.
1805 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1806
1a7a65f9
AD
18072008-11-11 Akim Demaille <demaille@gostai.com>
1808
1809 Support parens in calc++.
1810 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1811 * examples/calc++/test (run): Check the expected output.
1812 Adjust callers.
1813 Check parens too.
1814
c944f7f2
AD
18152008-11-11 Akim Demaille <demaille@gostai.com>
1816
1817 Simplify lalr1.cc since %defines is mandatory.
1818 * data/lalr1.cc: Remove useless calls to b4_defines_if.
1819
dada3cd1
AD
18202008-11-11 Akim Demaille <demaille@gostai.com>
1821
1822 TODO: yyfmt.
1823 * TODO (yysyntax_error): New item.
1824
422c18f4
AD
18252008-11-11 Akim Demaille <demaille@gostai.com>
1826
1827 Prefer M4 to CPP.
1828 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1829 YYERROR_VERBOSE.
1830
a0ffc175
AD
18312008-11-11 Akim Demaille <demaille@gostai.com>
1832
1833 Support i18n of the parse error messages.
1834 * TODO (lalr1.cc/I18n): Remove.
1835 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1836 error messages, as done in yacc.c.
1837 Stay within the yy* pseudo namespace.
1838
00a8a083
AD
18392008-11-11 Akim Demaille <demaille@gostai.com>
1840
1841 More TODO.
1842 * TODO (single stack, yysyntax_error): New.
1843
09277875
AD
18442008-11-11 Akim Demaille <demaille@gostai.com>
1845
1846 Make it possible to return a symbol_type from yylex.
1847 * data/lalr1.cc (b4_lex_symbol_if): New.
1848 (parse): When lex_symbol is defined, expected yylex to return the
1849 complete lookahead.
1850 * etc/bench.pl.in (generate_grammar_list): Extend to support this
1851 yylex interface.
1852 (bench_variant_parser): Exercise it.
1853
64c1b92a
AD
18542008-11-11 Akim Demaille <demaille@gostai.com>
1855
1856 Remove useless bench case.
1857 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
1858 no longer used.
1859
2722aa42
AD
18602008-11-11 Akim Demaille <demaille@gostai.com>
1861
1862 Improve display of directives.
1863 * etc/bench.pl.in (parse_term): Don't add useless eol.
1864
918eb7c5
AD
18652008-11-11 Akim Demaille <demaille@gostai.com>
1866
1867 Use string_cast in the bench.
1868 * etc/bench.pl.in (generate_grammar_list): Define and use
1869 string_cast.
1870
39be9022
AD
18712008-11-11 Akim Demaille <demaille@gostai.com>
1872
1873 Replace yychar with a Boolean.
1874 * data/lalr1.cc (parse::yychar): Replace by...
1875 (parse::yyempty): this.
1876
a2e3fa77
AD
18772008-11-11 Akim Demaille <demaille@gostai.com>
1878
1879 Factor the tables.
1880 * TODO: New item.
1881
aba12ad1
AD
18822008-11-11 Akim Demaille <demaille@gostai.com>
1883
1884 Let yytranslate handle the eof case.
1885 * data/lalr1.cc (yytranslate_): Handle the EOF case.
1886 Adjust callers.
1887 No longer expect yychar to be equal to yyeof_, rather, test the
1888 lookahead's (translated) kind.
1889
27cb5b59
AD
18902008-11-11 Akim Demaille <demaille@gostai.com>
1891
1892 yychar cannot be empty in yyerrlab.
1893 * TODO (yychar == yyempty_): New.
1894 * data/lalr1.cc: Remove the handling of this case.
1895 This eases forthcoming changes related to yychar and yytranslate.
1896
fce629c0
AD
18972008-11-11 Akim Demaille <demaille@gostai.com>
1898
1899 Bench: syntactic sugar for %define/#define.
1900 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
1901 (&bench_push_parser, bench_variant_parser): Use this feature.
1902 (&eat): New.
1903 Use it.
1904
ce671960
AD
19052008-11-11 Akim Demaille <demaille@gostai.com>
1906
1907 Less memory pressure on the "list" bench.
1908 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
1909 the values, to limit memory pressure.
1910
2873fdf8
AD
19112008-11-11 Akim Demaille <demaille@gostai.com>
1912
1913 Introduce make_symbol.
b06df3c2
AD
1914 make_symbol provides a means to construct a full symbol (kind,
1915 value, location) in a single shot. It is meant to be a Symbol
1916 constructor, parameterized by the symbol kind so that overloading
1917 would prevent incorrect kind/value pairs. Unfortunately
1918 parameterized constructors do not work well in C++ (unless the
1919 parameter also appears as an argument, which is not acceptable),
1920 hence the use of a function instead of a constructor.
2df9ec37 1921
2873fdf8
AD
1922 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1923 (b4_symbol_constructor_declarations)
1924 (b4_symbol_constructor_specialization_)
1925 (b4_symbol_constructor_specializations)
1926 (b4_symbol_constructor_definition_)
1927 (b4_symbol_constructor_definitions): New.
1928 Use them where appropriate to generate declaration, declaration of
1929 the specializations, and implementations of the templated
1930 overloaded function "make_symbol".
1931 (variant::variant): Always define a default ctor.
1932 Also provide a copy ctor.
1933 (symbol_base_type, symbol_type): New ctor overloads for value-less
1934 symbols.
1935 (symbol_type): Now public, so that functions such as yylex can use
1936 it.
1937
8be046d7
AD
19382008-11-11 Akim Demaille <demaille@gostai.com>
1939
1940 Inform m4 whether a tag is a valid id.
1941 * src/output.c (is_identifier): New.
1942 (symbol_definitions_output): Use it to define tag_is_id.
1943 But maybe this should be done at m4 level?
1944
de62edee
AD
19452008-11-11 Akim Demaille <demaille@gostai.com>
1946
1947 Test 214 was failing: it greps with a pattern containing [ ]*
1948 which obviously meant to catch spaces and tabs, but contained only
1949 spaces. Tabulations in sources are a nuisance, so to simplify the
1950 matter, get rid of all the tabulations in the Java sources. The
1951 other skeletons will be treated equally later.
1952
1953 * data/java.m4, data/lalr1.java: Untabify.
1954 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
1955 tabulations are no longer generated.
1956
905f0697
PB
19572008-11-11 Paolo Bonzini <bonzini@gnu.org>
1958
1959 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1960 * configure.ac: Adjust usage.
1961 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1962 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1963 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1964
09ccae9b
DJ
19652008-11-10 Di-an Jan <dianj@freeshell.org>
1966
1967 Workaround Java's ``code too large'' problem for parser tables
1968 in most cases, by using one function per initialization.
1969 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
1970 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
1971 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
1972 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
1973 (yytname_): Use b4_typed_parser_table.
1974 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
1975 ``code too large'' error.
1976
1979121c
DJ
19772008-11-10 Di-an Jan <dianj@freeshell.org>
1978
1979 * NEWS: Document them.
de62edee 1980
1979121c
DJ
1981 General Java skeleton improvements.
1982 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
1983 using gcj < 4.3 in the testsuite, according to comments in
1984 gnulib/m4/javacomp.m4.
1985 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
1986 location_type, position_type): Remove extraneous brackets from
1987 b4_percent_define_default.
1988 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
1989 m4_define and m4_define_default.
1990 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
1991 which marks the end of user code with appropriate syncline, like all
1992 the other skeletons.
1993 (b4_user_post_prologue): Add. Don't silently drop.
1994 (yylex): Remove.
1995 (parse): Inline yylex.
1996 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
1997 (%{...%}): Fix typo of %code imports.
1998 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
1999
2000 Support annotations on parser class with %define annotations.
2001 * data/lalr1.java (annotations): Add to parser class modifier.
2002 * doc/bison.texinfo (Java Parser Interface): Document
2003 %define annotations.
2004 (Java Declarations Summary): Document %define annotations.
2005 * tests/java.at (Java parser class modifiers): Test annotations.
2006
2007 Do not generate code for %error-verbose unless requested.
2008 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2009 Make private. Make conditional on %error-verbose.
2010 (getErrorVerbose, setErrorVerbose): New.
2011 (yytnamerr_): Make conditional on %error-verbose.
2012 (yysyntax_error): Make some code conditional on %error-verbose.
2013 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2014 about %error-verbose having no effect.
2015 (getErrorVerbose, setErrorVerbose): Document.
2016
2017 Move constants for token names to Lexer interface.
2018 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2019 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2020 (parse): Qualify EOF to Lexer.EOF.
2021 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2022 EOF and token names to Java Lexer Interface.
2023 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2024
2025 Make yyerror public.
2026 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2027 (yyerror): Change to public. Add Javadoc comments. Use longer
2028 parameter names. Make the body rather than the declarator
2029 conditional on %locations.
2030 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2031
2032 Allow user to add code to the constructor with %code init.
2033 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2034 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2035 Add %code init to the front of the constructor body.
2036 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2037 and %define init_throws.
2038 (Java Declarations Summary): Document %code init and
2039 %define init_throws.
2040 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2041 (Java constructor init and init_throws): Add tests.
de62edee 2042
42f832d6
AD
20432008-11-10 Akim Demaille <demaille@gostai.com>
2044
2045 Update TODO.
2046 * TODO (-D): is implemented.
2047 (associativity): Same precedence must have the same associativity.
2048 For instance, how can a * b / c be parsed if * is %left and / is
2049 %right?
2050 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2051
247efe34
AD
20522008-11-10 Akim Demaille <demaille@gostai.com>
2053
2054 Formatting changes.
2055
5d731440
AD
20562008-11-10 Akim Demaille <demaille@gostai.com>
2057
2058 More information about the symbols.
2059 * src/output.c (type_names_output): Document all the symbols,
2060 including those that don't have a type-name.
2061 (symbol_definitions_output): Define "is_token" and
2062 "has_type_name".
2063 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2064 type-name, now that they are defined too in b4_type_names.
2065
21db118b
AD
20662008-11-10 Akim Demaille <demaille@gostai.com>
2067
2068 Regen.
2069
6ed15cde
AD
20702008-11-10 Akim Demaille <demaille@gostai.com>
2071
2072 Make parser::yytranslate static.
b06df3c2
AD
2073 Small speedup (1%) on the list grammar. And makes yytranslate_
2074 available in non member functions.
de62edee 2075
6ed15cde
AD
2076 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2077 function.
2078
30bb2edc
AD
20792008-11-10 Akim Demaille <demaille@gostai.com>
2080
2081 Avoid trailing spaces.
2082 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2083 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2084 they can be empty, and anyway this incorrectly indents the first
2085 action.
2086
b3a28fd4
AD
20872008-11-10 Akim Demaille <demaille@gostai.com>
2088
2089 Comment changes.
2090
914202bd
AD
20912008-11-10 Akim Demaille <demaille@gostai.com>
2092
2093 Use "enum" for integral constants.
2094 This is just nicer to read, I observed no speedup.
de62edee 2095
914202bd
AD
2096 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2097 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2098 (yyuser_token_number_max_, yyundef_token_): Move into...
2099 (yytranslate_): here.
2100
c17f9a4a
AD
21012008-11-10 Akim Demaille <demaille@gostai.com>
2102
2103 Shortcuts in bench directives.
2104 * etc/bench.pl.in (parse_dirs): New.
2105 Use it.
2106 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2107 Create the benches in "benches/".
2108
b9855ea5
AD
21092008-11-10 Akim Demaille <demaille@gostai.com>
2110
2111 Formatting changes.
2112 * data/lalr1.cc: here.
2113
6e097787
AD
21142008-11-10 Akim Demaille <demaille@gostai.com>
2115
2116 Adjust verbose message to using emacs.
2117 * etc/bench.pl.in: Inform compilation-mode when we change the
2118 directory.
2119 (generate_grammar_list): Recognize %define "variant" in addition
2120 to %define variant.
2121
4c3cc7da
AD
21222008-11-10 Akim Demaille <demaille@gostai.com>
2123
2124 Classify symbols by type-name.
2125 * src/uniqstr.h (UNIQSTR_CMP): New.
2126 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2127 (type_names_output): New.
2128 (muscles_output): Use it.
2129 * data/lalr1.cc (b4_symbol_action_): Remove.
2130 (b4_symbol_case_, b4_type_action_): New.
2131 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2132
d69c9694
AD
21332008-11-10 Akim Demaille <demaille@gostai.com>
2134
2135 Change the handling of the symbols in the skeletons.
2136 Before we were using tables which lines were the symbols and which
2137 columns were things like number, tag, type-name etc. It is was
2138 difficult to extend: each time a column was added, all the numbers had
2139 to be updated (you asked for colon $2, not for "tag"). Also, it was
2140 hard to filter these tables when only a subset of the symbols (say the
2141 tokens, or the nterms, or the tokens that have and external number
2142 *and* a type-name) was of interest.
de62edee 2143
d69c9694
AD
2144 Now instead of monolithic tables, we define one macro per cell. For
2145 instance "b4_symbol(0, tag)" is a macro name which contents is
2146 self-decriptive. The macro "b4_symbol" provides easier access to
2147 these cells.
de62edee 2148
d69c9694
AD
2149 * src/output.c (type_names_output): Remove.
2150 (symbol_numbers_output, symbol_definitions_output): New.
2151 (muscles_output): Call them.
2152 (prepare_symbols): Define b4_symbols_number.
2153
5263bea9
AD
21542008-11-10 Akim Demaille <demaille@gostai.com>
2155
2156 --trace=muscles
2157 * src/getargs.h, src/getargs.c (trace_muscle): New.
2158 (trace_types, trace_args): Support it.
2159 * src/output.c (output_skeleton): Use it.
2160
4175f6bb
AD
21612008-11-10 Akim Demaille <demaille@gostai.com>
2162
2163 muscles_output.
2164 * src/output.c (muscles_output): New, extracted from...
2165 (output_skeleton): here.
2166 Adjust.
2167
1de69d6a
AD
21682008-11-10 Akim Demaille <demaille@gostai.com>
2169
2170 Formatting changes.
2171
36db78a7
AD
21722008-11-10 Akim Demaille <demaille@gostai.com>
2173
2174 Update the variant example.
2175 * examples/variant.yy: Formatting changes.
2176 One stage build.
2177
e5eb92e7
AD
21782008-11-10 Akim Demaille <demaille@gostai.com>
2179
2180 Support constructor with an argument.
2181 This improves the "list" bench by 2%.
de62edee 2182
e5eb92e7
AD
2183 * data/lalr1.cc (variant::build): Add an overloaded version with
2184 an argument.
2185 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2186
76307410
AD
21872008-11-10 Akim Demaille <demaille@gostai.com>
2188
2189 Test variants.
2190 * tests/c++.at (AT_CHECK_VARIANTS): New.
2191 Use it with and without %define assert.
2192
d78f0ac9
AD
21932008-11-10 Akim Demaille <demaille@gostai.com>
2194
2195 Add %precedence support.
2196 Unfortunately it is not possible to reuse the %prec directive. This
2197 is because to please POSIX, we do not require to end the rules with a
2198 semicolon. As a result,
de62edee 2199
d78f0ac9 2200 foo: bar %prec baz
de62edee 2201
d78f0ac9
AD
2202 is ambiguous: either a rule which precedence is that of baz, or a rule,
2203 and then a declaration of the precedence of the token baz.
de62edee 2204
d78f0ac9
AD
2205 * doc/bison.texinfo: Document %precedence.
2206 (Precedence Only): New.
2207 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2208 * src/conflicts.c (resolve_sr_conflict): Support it.
2209 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2210 Parse it.
2211 * tests/calc.at: Use %precedence for NEG.
2212 * tests/conflicts.at (%precedence does not suffice)
2213 (%precedence suffices): New tests.
2214
c85be41a
AD
22152008-11-09 Akim Demaille <demaille@gostai.com>
2216
2217 Make benches in a sub dirs.
2218 * etc/bench.pl.in ($dir): New.
2219 Use it.
2220 Check the use of constructors with an argument.
2221 (bench_variant_parser): Fix.
2222
db65ca1f
AD
22232008-11-09 Akim Demaille <demaille@gostai.com>
2224
2225 fix eof condition
2226
9b0efa5b
AD
22272008-11-09 Akim Demaille <demaille@gostai.com>
2228
2229 Fix --help.
2230
432ac57a
AD
22312008-11-09 Akim Demaille <demaille@gostai.com>
2232
2233 Require the generation of parse-gram.output.
2234 * src/Makefile.am (YACC): Pass --report=all.
2235
deef2a0a
AD
22362008-11-09 Akim Demaille <demaille@gostai.com>
2237
2238 Formatting changes.
2239
df72984a
AD
22402008-11-09 Akim Demaille <demaille@gostai.com>
2241
2242 Update TODO.
2243 * TODO: Remove obsolete items.
2244 Update others.
2245
f10e19fd
AD
22462008-11-09 Akim Demaille <demaille@gostai.com>
2247
2248 Enhance bench.pl.
2249 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2250 (@token, $grammar, $bench): New.
2251 (generate_grammar_variant): Rename as...
2252 (generate_grammar_list): this.
2253 (generate_grammar): Adjust.
2254 (bench_grammar): Rename as...
2255 (bench): this.
2256 Use it in the various bench-marking routines.
2257 (-b, -g): New options.
2258
5de9c593
AD
22592008-11-09 Akim Demaille <demaille@gostai.com>
2260
2261 Use a static hierarchy for symbols in the C++ parser.
2262 * data/lalr1.cc (symbol_base_type, symbol_type)
2263 (stack_symbol_type): Make it a static hierarchy.
2264 Adjust dependencies.
2265
757f8f98
AD
22662008-11-09 Akim Demaille <demaille@gostai.com>
2267
2268 bench.pl -d, --directive.
2269 * etc/bench.pl.in (@directive): New.
2270 (&bench_grammar): Use it.
2271 (&bench_list_grammar): New, to provide access to the "variant"
2272 grammar.
2273 Use it.
2274 (getopts): Support -d, --directive.
2275
d3be4f6d
AD
22762008-11-09 Akim Demaille <demaille@gostai.com>
2277
2278 Use inline for small operations.
2279 * data/lalr1.cc (symbol_base_type, symbol_type)
2280 (stack_symbol_type): Declare constructor and other operations as
2281 inline.
2282 (yy_destroy_): Inline.
2283
1f7d007b
AD
22842008-11-09 Akim Demaille <demaille@gostai.com>
2285
2286 Introduce a hierarchy for symbols.
2287 * data/lalr1.cc (symbol_base_type, symbol_type): New.
2288 (data_type): Rename as...
2289 (stack_symbol_type): this.
2290 Derive from symbol_base_type.
2291 (yy_symbol_value_print_): Merge into...
2292 (yy_symbol_print_): this.
2293 Rename as...
2294 (yy_print_): this.
2295 (yydestruct_): Rename as...
2296 (yy_destroy_): this.
2297 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
2298 (parser::parse): yyla is now of symbol_type.
2299 Use its type member instead of yytoken.
2300
bc0b0477
AD
23012008-11-09 Akim Demaille <demaille@gostai.com>
2302
2303 Rename data_type and stack_symbol_type.
2304 * data/lalr1.cc (data_type): Rename as...
2305 (stack_symbol_type): this.
2306
57295d14
AD
23072008-11-09 Akim Demaille <demaille@gostai.com>
2308
2309 Handle semantic value and location together.
2310 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
2311 yydata.value and yydata.location.
2312 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
2313 (YY_SYMBOL_PRINT): Now take semantic value and location as a
2314 single arg.
2315 Adjust all callers.
2316 (yydestruct_): New overload for a stack symbol.
2317
e9b0834e
AD
23182008-11-09 Akim Demaille <demaille@gostai.com>
2319
2320 Push a complete symbol, not connected parts.
2321 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
2322 state, value and location.
2323 Adjust callers.
2324
6082531a
AD
23252008-11-09 Akim Demaille <demaille@gostai.com>
2326
2327 Agregate yylval and yylloc.
2328 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
2329 (parser::yyla): this.
2330
33c195cc
AD
23312008-11-09 Akim Demaille <demaille@gostai.com>
2332
2333 Rely on the state stack to display reduction traces.
b06df3c2
AD
2334 To display rhs symbols before a reduction, we used information
2335 about the rule reduced, which required the tables yyrhs and
2336 yyprhs. Now use rely only on the state stack to get the same
2337 information.
de62edee 2338
33c195cc
AD
2339 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
2340 Use them.
2341 (parser::yyrhs_, parser::yyprhs_): Remove.
2342 (parser::yy_reduce_print_): Use the state stack.
2343
e1f93869
AD
23442008-11-09 Akim Demaille <demaille@gostai.com>
2345
2346 Fuse yyval and yyloc into yylhs.
2347 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
2348 yylhs.
2349 (parse): Replace yyval and yyloc with yylhs.value and
2350 yylhs.location.
2351 After a user action, compute yylhs.state earlier.
2352 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
2353 fresh error_token.
2354
2935744b
DJ
23552008-11-09 Di-an Jan <dianj@freeshell.org>
2356
2357 Remove unused variable.
2358 * src/output.c (type_names_output): Remove unused variable sep.
2359
bbf9ca37
PB
23602008-11-09 Paolo Bonzini <bonzini@gnu.org>
2361
2362 Change tests/output.at quoting.
2363 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
2364 expanding arguments.
2365
d9a9b96b
JD
23662008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2367
2368 Don't add a semicolon to actions for %skeleton or %language.
2369 It breaks Java test cases as reported by Akim Demaille.
2370 * src/scan-code.l: Implement.
2371
51365192
JD
23722008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2373
2374 Clean up %skeleton and %language priority implementation.
2375 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2376 remove static qualifier because others will soon need to see it.
2377 (language_prio): Likewise.
2378 (getargs): Use command_line_prio rather than 0.
2379 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2380 enum fields.
2381 (skeleton_prio): Extern it.
2382 (language_prio): Extern it.
2383 * src/parse-gram.y: Use grammar_prio rather than 1.
2384
9380cfd0
AD
23852008-11-07 Akim Demaille <demaille@gostai.com>
2386
2387 Moving push traces into yypush_.
2388 * data/lalr1.cc (yypush_): Now takes a optional trace message.
2389 Adjust all uses.
2390
8901f32e
AD
23912008-11-07 Akim Demaille <demaille@gostai.com>
2392
2393 The single-stack C++ parser is now the standard one.
2394 * data/lalr1.cc: Rename as...
2395 * data/lalr1-split.cc: this.
2396 * data/lalr1-fusion.cc: Rename as...
2397 * data/lalr1.cc: this.
2398 * etc/bench.pl.in: Adjust.
2399
8cdabf02
AD
24002008-11-07 Akim Demaille <demaille@gostai.com>
2401
2402 Avoid empty-if warnings.
2403 Reported by Quentin Hocquet.
de62edee 2404
8cdabf02
AD
2405 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
2406 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
2407
5a893c2b
AD
24082008-11-07 Akim Demaille <demaille@gostai.com>
2409
2410 Pass command line location to skeleton_arg and language_argmatch.
2411 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2412 The location argument is now mandatory.
2413 Adjust all dependencies.
2414 (getargs): Use command_line_location.
2415
58697c6d
AD
24162008-11-07 Akim Demaille <demaille@gostai.com>
2417
2418 -D, --define.
2419 * src/getargs.c (usage): Document -D.
2420 Fix help string for --locations.
2421 (command_line_location): New.
2422 (short_options, long_options, getargs): Support -D, --define.
2423 (getargs): Move -d support at the right place.
2424 * doc/bison.texinfo (Bison Options): Update.
2425 * tests/input.at (%define, --define): New.
2426
9fe5a457
AD
24272008-11-07 Akim Demaille <demaille@gostai.com>
2428
2429 Initialize the muscle table before parsing the command line.
2430 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2431 (getargs): Define file_name.
2432 * src/main.c (main): Initialize muscle_tab before calling
2433 getargs.
2434 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2435 its value is not available yet.
2436
56c5eca9
AD
24372008-11-07 Akim Demaille <demaille@gostai.com>
2438
2439 Locations without columns for command line arguments.
2440 * src/location.c (location_print): Don't display negative columns.
2441 * src/location.h: Document this.
2442
9b9e0a7d
AD
24432008-11-07 Akim Demaille <demaille@gostai.com>
2444
2445 Fix --help.
2446 * src/getargs.c (usage): Fix help string for -W.
2447
74eae918
AD
24482008-11-07 Akim Demaille <demaille@gostai.com>
2449
2450 Handle more general types of option arguments.
2451 * build-aux/cross-options.pl: The argument ends at the first
2452 space, not the first non-symbol character.
2453 Use @var for each word appearing the argument description.
2454
a3d4c6fb
AD
24552008-11-07 Akim Demaille <demaille@gostai.com>
2456
2457 Destroy the variants that remain on the stack in case of error.
2458 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
2459 destructor.
2460 Display the value only if yymsg is nonnull.
2461 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
2462
2d32fc9f
AD
24632008-11-07 Akim Demaille <demaille@gostai.com>
2464
2465 Add "%define assert" to variants.
2466 This is used to help the user catch cases where some value gets
2467 ovewritten by a new one. This should not happen, as this will
2468 probably leak.
de62edee 2469
2d32fc9f
AD
2470 Unfortunately this uncovered a bug in the C++ parser itself: the
2471 lookahead value was not destroyed between two calls to yylex. For
2472 instance if the previous lookahead was a std::string, and then an int,
2473 then the value of the std::string was correctly taken (i.e., the
2474 lookahead was now an empty string), but std::string structure itself
2475 was not reclaimed.
de62edee 2476
2d32fc9f
AD
2477 This is now done in variant::build(other&) (which is used to take the
2478 value of the lookahead): other is not only stolen from its value, it
2479 is also destroyed. This incurs a new performance penalty of a few
2480 percent, and union becomes faster again.
de62edee 2481
2d32fc9f
AD
2482 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2483 (b4_variant_if): New.
2484 (variant::built): New.
2485 Use it whereever the status of the variant changes.
2486 * etc/bench.pl.in: Check the penalty of %define assert.
2487
f6038cb8
AD
24882008-11-07 Akim Demaille <demaille@gostai.com>
2489
2490 Use "%define variant" in bench.pl.
2491 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2492 just use %define variants.
2493
ccde1f98
AD
24942008-11-07 Akim Demaille <demaille@gostai.com>
2495
2496 Regen.
2497 * src/parse-gram.h, src/parse-gram.c: Regen.
2498
58bd33b7
JD
24992008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2500
2501 Fix user actions without a trailing semicolon.
2502 Reported by Sergei Steshenko at
2503 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2504 * THANKS (Sergei Steshenko): Add.
2505 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2506 * tests/regression.at (Fix user actions without a trailing semicolon):
2507 New test case.
2508
639867b5
AD
25092008-11-04 Akim Demaille <demaille@gostai.com>
2510
2511 Use b4_copyright_years.
2512 * data/yacc.c (b4_copyright_years): New.
2513 Fix its value according to the comments in the file.
2514 Use it and undefine it.
2515
3c262606
AD
25162008-11-04 Akim Demaille <demaille@gostai.com>
2517
2518 Formatting changes.
2519 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2520
a2b93d52
AD
25212008-11-04 Akim Demaille <demaille@gostai.com>
2522
2523 Formatting changes.
2524 * data/lalr1-fusion.cc: here.
2525
3a2803df
AD
25262008-11-04 Akim Demaille <demaille@gostai.com>
2527
2528 Use strict on bench.pl.
2529 * etc/bench.pl.in (&run, &generate_grammar): New.
2530 Rename the grammar generating functions for consistency.
2531 Change the interface so that the list of benches to run is passed
2532 as (optionless) arguments.
2533 (&compile): Use &run.
2534
a0d4650a
AD
25352008-11-04 Akim Demaille <demaille@gostai.com>
2536
2537 Remove spurious initial empty lines.
2538 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2539 * data/yacc.c: End the @output lines with an @.
2540
cac9e09b
AD
25412008-11-04 Akim Demaille <demaille@gostai.com>
2542
2543 Improve the display of sizes.
2544 * etc/bench.p.in: Higher precision.
2545 Sort by decreasing size.
2546
4af4348a
AD
25472008-11-04 Akim Demaille <demaille@gostai.com>
2548
2549 Don't memcpy C++ structures.
2550 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2551 arguments.
2552 (variant::build): New overload for
2553 copy-construction-that-destroys.
2554 (variant::swap): New.
2555 (parser::yypush_): Use it in variant mode.
2556
ef05c4d6
AD
25572008-11-04 Akim Demaille <demaille@gostai.com>
2558
2559 Better defaults for bench.pl.
2560 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2561 default values.
2562 Adjust &verbose uses.
2563 (-q, --quiet): New.
2564
9718cfa9
AD
25652008-11-04 Akim Demaille <demaille@gostai.com>
2566
2567 Make variant.yy more complex.
2568 std::list cannot be copied via memcpy, they are more demanding than
2569 std::string. Use one std::list to strengthen the test.
de62edee 2570
9718cfa9
AD
2571 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2572 Adjust.
2573 Create a list of strings, instead of a single large string.
2574
a6df593d
AD
25752008-11-04 Akim Demaille <demaille@gostai.com>
2576
2577 bench.pl --bench.
2578 * etc/bench.pl.in (--bench, $bench): New.
2579
006a0303
AD
25802008-11-04 Akim Demaille <demaille@gostai.com>
2581
2582 Sort methods.
2583 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2584 Define it after as().
2585
faef3466
AD
25862008-11-04 Akim Demaille <demaille@gostai.com>
2587
2588 Useless parens.
2589 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2590
2141aded
AD
25912008-11-04 Akim Demaille <demaille@gostai.com>
2592
2593 Issue missing synclines after user actions.
2594 * data/c.m4 (b4_case): Issue synclines on the output file.
2595
e426d17b
AD
25962008-11-04 Akim Demaille <demaille@gostai.com>
2597
2598 Remove trailing empty line.
2599 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2600 epilogue.
2601
a9ce3f54
AD
26022008-11-04 Akim Demaille <demaille@gostai.com>
2603
2604 Fix output of copyright years.
2605 * data/bison.m4 (b4_copyright): Fix the indentation of the
2606 copyright year paragraph.
2607 Use b4_copyright_years when no years are given.
2608 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2609 (b4_copyright_years): New.
2610 Use it.
2611
59c544c2
AD
26122008-11-04 Akim Demaille <demaille@gostai.com>
2613
2614 Avoid the spurious initial empty line.
2615 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2616 the end of @output request to suppress the empty line that
2617 results.
2618
96b15448
AD
26192008-11-04 Akim Demaille <demaille@gostai.com>
2620
2621 Remove parser::rhs_number_type.
2622 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2623 (yyrhs_): Use b4_table_define.
2624
f0633174
AD
26252008-11-04 Akim Demaille <demaille@gostai.com>
2626
2627 Fix iteration type.
2628 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2629
417b8004
AD
26302008-11-04 Akim Demaille <demaille@gostai.com>
2631
2632 Factor the declaration of the integer tables.
2633 * data/lalr1-fusion.cc (b4_table_define): New.
2634 Use it.
2635
1a5246c6
AD
26362008-11-03 Akim Demaille <demaille@gostai.com>
2637
2638 Fix indentation of tables in lalr1.cc
2639 * data/lalr1-fusion.cc: Fix the indentation.
2640
f8a95c9c
AD
26412008-11-03 Akim Demaille <demaille@gostai.com>
2642
2643 Destroy the lhs symbols after reduction.
2644 * data/lalr1-fusion.cc (parse): After the user action, when in
2645 variant mode, destroy the lhs symbols.
2646
d7f4d823
AD
26472008-11-03 Akim Demaille <demaille@gostai.com>
2648
2649 Simplify yysyntax_error_ use.
2650 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2651 type, but make it unnamed in the declaration when it is not used.
2652
8b9c89fb
AD
26532008-11-03 Akim Demaille <demaille@gostai.com>
2654
2655 Let yy::variant::build return an lvalue.
2656 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2657 object.
2658
83243c24
AD
26592008-11-03 Akim Demaille <demaille@gostai.com>
2660
2661 Define yy::variant only when needed.
2662 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2663 used.
2664
429b4848
AD
26652008-11-03 Akim Demaille <demaille@gostai.com>
2666
2667 Bench the three-stack lalr1.cc.
2668 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2669 one-stack one.
2670
414c76a4
AD
26712008-11-03 Akim Demaille <demaille@gostai.com>
2672
2673 Fail on parse error in calc++.
2674 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2675 status.
2676 * examples/calc++/test ($me, $number, $exit, run): New.
2677 Use them to propagate errors to the exit status.
2678
8a5783fd
AD
26792008-11-03 Akim Demaille <demaille@gostai.com>
2680
2681 Don't specify the skeleton twice in the example.
2682 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2683 file does what is needed.
2684
0cc5bead
AD
26852008-11-03 Akim Demaille <demaille@gostai.com>
2686
2687 bench: Improve output.
2688 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2689
5b421a4e
AD
26902008-11-03 Akim Demaille <demaille@gostai.com>
2691
2692 bench: check impact of %debug on variants.
2693 * etc/bench.pl.in (variant_grammar): Fix the computation of
2694 $variant.
2695 Generate a grammar file that can work with or without %debug.
2696 Do use the @directive.
2697 (bench_variant_parser): Check impact of %debug.
2698 (@directives): Rename all the occurrences to...
2699 (@directive): this, for consistency.
2700
d11ee647
AD
27012008-11-03 Akim Demaille <demaille@gostai.com>
2702
2703 bench: report the size too.
2704 * etc/bench.pl.in ($iterations): Defaults to -3.
2705 (&bench_grammar): Require hireswallclock.
2706 Compute and display the size of the result.
2707 More comments.
2708
e1b74b92
AD
27092008-11-03 Akim Demaille <demaille@gostai.com>
2710
2711 bench: More use of the verbosity level.
2712 * etc/bench.pl.in ($verbose, &verbose): New.
2713 Use them.
2714 More POD documentation.
2715
7e5f9c54
AD
27162008-11-03 Akim Demaille <demaille@gostai.com>
2717
2718 bench.pl: a command line interface
2719 * etc/bench.pl.in: More doc.
2720 Some fixes in the documentation.
2721 ($cflags, $iterations, &help, &getopt): New.
2722 Use them.
2723 (&variant_grammar): Let the number of stages be 10 times what is
2724 specified.
2725
7109a18d
AD
27262008-11-03 Akim Demaille <demaille@gostai.com>
2727
2728 Bench the use of Boost.Variants.
2729 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2730 New.
2731 (&compile): Be ready to compile C++ parsers.
2732 (&bench_push_parser): Move debug information to the outermost
2733 level.
2734 * THANKS: Add Michiel De Wilde.
2735
922730fe
AD
27362008-11-03 Akim Demaille <demaille@gostai.com>
2737
2738 bench.pl: Pass directives as a list instead of as a string.
2739 * etc/bench.pl.in (&directives): New.
2740 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2741 directives.
2742 (&triangular_grammar): Do use the directives (were ignored).
2743 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2744 directives.
2745
7484f1d4
AD
27462008-11-03 Akim Demaille <demaille@gostai.com>
2747
2748 Improve genericity of bench.pl.
2749 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2750 argument.
2751 (&bench_push_parser): New.
2752 Call it.
2753
15129f25
AD
27542008-11-03 Akim Demaille <demaille@gostai.com>
2755
2756 Add documentation to bench.pl.
2757 * etc/bench.pl.in: Comment changes.
2758
0e0ed236
AD
27592008-11-03 Akim Demaille <demaille@gostai.com>
2760
2761 Fuse the three stacks into a single one.
de62edee 2762
b06df3c2
AD
2763 In order to make it easy to perform benchmarks to ensure that
2764 there are no performance loss, lalr1.cc is forked into
2765 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2766 lalr1.cc.
2767
2768 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2769 exercized by the test suite, the user must install a symbolic link
2770 from lalr1.cc to it.
de62edee 2771
b06df3c2
AD
2772 Instead of having three stacks (state, value, location), use a
2773 stack of triples. This considerably simplifies the code (and it
2774 will be easier not to require locations as currently does the C++
2775 parser), and also gives a 10% speedup according to
2776 etc/bench (probably mainly since memory allocation is done once
2777 instead of three times).
de62edee 2778
0e0ed236
AD
2779 Another motivation is to make it easier to destruct properly
2780 semantic values: now that they are bound to their state (hence
2781 symbol type) it will be easier to call the appropriate destructor.
de62edee 2782
0e0ed236 2783 These changes should probably benefit the C parser too.
de62edee 2784
b06df3c2
AD
2785 * data/lalr1.cc: Copy as...
2786 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
2787 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2788 from c++.m4.
2789 (state_stack_type, semantic_stack_type, location_stack_type)
2790 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2791 (data_type, stack_type, yystack_): New.
2792 (YYLLOC_DEFAULT, yypush_): Adjust.
2793 (yyerror_range): Now based on data_type, not location_type.
2794
7dedf26e
AD
27952008-11-03 Akim Demaille <demaille@gostai.com>
2796
2797 Push the state, value, and location at the same time.
2798 This is needed to prepare a forthcoming patch that fuses the three
2799 stacks into one.
de62edee 2800
7dedf26e
AD
2801 * data/lalr1.cc (parser::yypush_): New.
2802 (parser::yynewstate): Change the semantics: instead of arriving to
2803 this label when value and location have been pushed, but yystate
2804 is to be pushed on the state stack, now the three of them must
2805 have been pushed before. yystate still must be the new state.
2806 This allows to use yypush_ everywhere instead of individual
2807 handling of the stacks.
2808
c4585f1e
AD
28092008-11-03 Akim Demaille <demaille@gostai.com>
2810
2811 Prefer references to pointers.
2812 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2813 definition to use references instead of pointers.
2814 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2815 Take the value and location as references.
2816 Adjust callers.
2817
56017c17
AD
28182008-11-03 Akim Demaille <demaille@gostai.com>
2819
2820 stack::size instead of stack::height.
2821 * data/lalr1.cc (stack::height): Rename as...
2822 (stack::size): this.
2823 Fix the output type.
2824 Comment changes.
2825
5ab8c47b
AD
28262008-11-03 Akim Demaille <demaille@gostai.com>
2827
2828 Use variants to support objects as semantic values.
b06df3c2
AD
2829 This patch was inspired by work by Michiel De Wilde. But he used
2830 Boost variants which (i) requires Boost on the user side, (ii) is
2831 slow, and (iii) has useless overhead (the parser knows the type of
2832 the semantic value there is no reason to duplicate this
2833 information as Boost.Variants do).
2834
2835 This implementation reserves a buffer large enough to store the
2836 largest objects. yy::variant implements this buffer. It was
2837 implemented with Quentin Hocquet.
de62edee 2838
5ab8c47b
AD
2839 * src/output.c (type_names_output): New.
2840 (output_skeleton): Invoke it.
2841 * data/c++.m4 (b4_variant_if): New.
2842 (b4_symbol_value): If needed, provide a definition for variants.
2843 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
2844 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
2845 (b4_char_sizeof, yy::variant): New.
2846 (parser::parse): If variants are requested, define
2847 parser::union_type, parser::variant, change the definition of
2848 semantic_type, construct $$ before running the user action instead
2849 of performing a default $$ = $1.
2850 * examples/variant.yy: New.
2851 Based on an example by Michiel De Wilde.
2852
1fa5d8bb
AD
28532008-11-03 Akim Demaille <demaille@gostai.com>
2854
2855 Parameterize the extraction of semantic values.
2856 To make future changes easier, no longer rely on ".TYPE" being the
2857 way to get a semantic value.
de62edee 2858
1fa5d8bb
AD
2859 * data/c.m4 (b4_symbol_value): New.
2860 Use it.
2861 * data/c++.m4, data/yacc.c: Use it.
2862 * data/glr.c: Use b4_symbol_value.
2863 (b4_rhs_data): New.
2864 Use it.
2865
91ba8a55
AD
28662008-11-03 Akim Demaille <demaille@gostai.com>
2867
2868 Prepare easier M4 changes.
2869 * data/lalr1.cc: Use escaped [] instead of literals to prepare
2870 future changes.
2871
c9ba9e59
JD
28722008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2873
2874 Initiate further development.
2875 * NEWS: Create an empty section for new entries.
2876 * gnulib: Update submodule to HEAD.
2877
bfb40910
JD
28782008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2879
2880 * NEWS: Version 2.4.
2881
241fda7a
JD
28822008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2883
2884 Prepare for next release.
2885 * NEWS: Briefly mention changes since 2.3b.
2886 * README: Say GNU m4 1.4.6, which we've been requiring in release
2887 announcements already, not 1.4.3, which breaks the build.
2888
ed4d67dc
JD
28892008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2890
2891 Say %language is experimental.
2892 We're thinking of extending it's effect on output file naming. See the
2893 thread at
2894 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2895 * NEWS: Say it's experimental.
2896 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2897 recommend it over %skeleton for now.
2898 (Bison Options): Likewise.
2899 (C++ Bison Interface): Use %skeleton not %language.
2900 (Calc++ Parser): Use %skeleton not %language.
2901 * src/getargs.c (usage): Say it's experimental.
2902
e254a580
DJ
29032008-11-01 Di-an Jan <dianj@freeshell.org>
2904 Paolo Bonzini <bonzini@gnu.org>
2905
2906 Support all Java parser class modifiers.
2907 * data/java.m4 (b4_percent_define_get3): New.
2908 (b4_final_if, b4_strictfp_if): New.
2909 * data/lalr1.java (final, strictfp, extends, implements): Support.
2910 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2911 documentation.
2912 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2913 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2914 (AT_CHECK_JAVA_GREP): New.
2915 (Java parser class modifiers): New test.
2916 (Java parser class extends and implements): New test.
2917
2918 Model exception propagation better with throws and lex_throws.
2919 * data/java.m4 (b4_list2): New.
2920 (throws): Change default.
2921 * data/lalr1.java (yyaction): Add throws.
2922 (parse): Add lex_throws in addition to throws.
2923 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2924 * tests/java.at (Java throws specifications): New test.
2925
2926 Improve documentation for Java parsers.
2927 * doc/bison.texinfo (Java Parsers): Add subsections.
2928 Don't quote first argument of %define.
2929 (Java Bison Interface): Document output files. Move documentation
2930 of parser class and merge into Java Parser Interface. Document
2931 features that error out. Document directives with no effect.
2932 Move note about Javadoc higher.
2933 (Java Semantic Values): Explicitly mention stype.
2934 Document that generic types cannot be used.
2935 (Java Location Values): Use @deftypeivar. Document constructors.
2936 Correct return value for toString.
2937 (Java Parser Interface): List undocumented constants/fields.
2938 Move documentation of fields added by %parse-param closer to list
2939 of members. Document that token names are added as fields.
2940 Document constructors accurately. Remove error method.
2941 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2942 Interface. Describe %code lexer and yylex accutately.
2943 Remove documentation that does not match the code.
2944 (Java Action Features): New.
2945 (Java Differences): Add reference. Add item on semantic values.
2946 Add note about @{ ... @}. Clarify %% epilogue placement.
2947 (Java Declarations Summary): New.
2948
2949 Fix Java skeleton.
2950 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2951 (b4_remove_comma): Quote test argument.
2952 (b4_identification): Remove "bison" field.
2953 * tests/java.at (Java parser class and package names): New test.
2954 (Java %parse-param and %lex-param): New test.
2955 (Java stype, position_class and location_class): New test.
2956
f259e4e6
PB
29572008-10-31 Di-an Jan <dianj@freeshell.org>
2958
2959 * data/lalr1.jave: Update copyright years.
2960 (YYParser): Correct name of "generated from" file in Javadoc:
2961 use b4_file_name instead of @ofile@.
2962 (Location constructor): Correct Javadoc parameter name.
2963 (yylloc): Add missing opening m4 quote after b4_location_if.
2964 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2965 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2966 (YYParser constructor): Correct Javadoc parameter name.
2967
cae5057f
JD
29682008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2969
2970 Always put auxiliary code files in the same dir as other output files.
2971 * src/files.c (compute_file_name_parts): When the user specifies
2972 --output but not --file-prefix, extract the directory prefix from the
2973 file prefix not from the grammar file name. This affects the location
2974 of files like location.hh generated by the C++ skeleton. The includes
2975 in the other output files require this fix.
2976 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2977 for expected output files.
2978 (Output files): Add a test for the above.
2979
4af432ba
JD
29802008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2981
2982 * gnulib: Update submodule to HEAD.
2983
e26d4e43
JD
29842008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2985
2986 Update copyright year.
2987 * src/files.c: Here.
2988
c0ee9e21
DJ
29892008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2990
2991 Don't overwrite the input file.
2992 * src/files.c (output_file_name_check): Fatal error if using input file
2993 for output.
2994 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2995 argument.
2996 (Conflicting output files): Add test.
2997
482dc52f
AD
29982008-10-28 Akim Demaille <demaille@gostai.com>
2999
3000 Space changes.
3001 * data/lalr1.cc: Formatting changes.
3002
52cbbe84
AD
30032008-10-28 Akim Demaille <demaille@gostai.com>
3004
3005 Don't define debugging functions when !YYDEBUG.
3006 * data/lalr1.cc (debug_stream, set_debug_stream)
3007 (debug_level_type, debug_level, set_debug_level): Don't
3008 declare them when YYDEBUG is not defined.
3009 The implementation are already YYDEBUG-aware.
3010
0925d5bf
AD
30112008-10-28 Akim Demaille <demaille@gostai.com>
3012
3013 Prefer "continue" for empty loop bodies.
3014 * etc/bench.pl.in: Use "continue" instead of {}.
3015
cf98343c
AD
30162008-10-28 Akim Demaille <demaille@gostai.com>
3017
3018 Space and comments changes.
3019 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3020 * data/c.m4, data/lalr1.cc: Space changes.
3021
9f467b7d
AD
30222008-10-28 Akim Demaille <demaille@gostai.com>
3023
3024 Make gnulib a submodule.
3025 * gnulib: New.
3026 * .gitmodules (gnulib): New.
3027
0f0e1ace
JD
30282008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3029
3030 Fix yyerror_range for user-defined location type in C++. Reported by
3031 Georg Sauthoff at
3032 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3033 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3034 * THANKS (Georg Sauthoff): Add.
3035
548e2104
JD
30362008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3037
3038 Update several administrative files mainly to facilitate releasing.
3039 * HACKING (Administrivia): Make the git-merge-changelog notes more
3040 helpful.
3041 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3042 (Release Procedure): Update for git and add numerous details that were
3043 previously missing.
3044 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3045 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3046 that announcements don't claim we bootstrapped with whatever bison
3047 happened to be in PATH. Add flex as a bootstrap tool.
3048 * Makefile.maint: Remove, previously replaced by maint.mk.
3049 * Makefile.cfg: Remove, and migrate settings to...
3050 * cfg.mk: ... here for the sake of `make announcement'.
3051 * bootstrap.conf (gnulib_modules): Add announce-gen.
3052 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3053 Berry.
3054
ddf17a6e
PB
30552008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3056
3057 Small but important bugfixes for the Java skeleton.
3058 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3059 (yy_symbol_print): Call toString on yyvaluep.
3060
e1145ad8
AD
30612008-08-29 Akim Demaille <demaille@gostai.com>
3062
3063 Clarify UPDATED use.
215b40ac 3064 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 3065 not to the release date of Bison.
215b40ac 3066 Reported by Joel E. Denny.
e1145ad8 3067
0df72d78
AD
30682008-08-29 Akim Demaille <demaille@gostai.com>
3069
3070 * README: Update FAQ pointer.
3071 Reported by Joel E. Denny.
3072
9a90b6bb
EB
30732008-08-27 Eric Blake <ebb9@byu.net>
3074
3075 Resync m4sugar from autoconf.
3076 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3077 (m4_init): Adjust to latest m4.git changes.
3078 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3079 effects.
3080 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3081 (_m4_list_cmp): Reduce side effects.
3082
65015668
AD
30832008-08-27 Akim Demaille <demaille@gostai.com>
3084
3085 Check yyerrok in calc.at.
215b40ac
EB
3086 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3087 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3088 expected.
65015668 3089
98e26a92
AD
30902008-08-27 Akim Demaille <demaille@gostai.com>
3091
3092 Support yyerrok in lalr1.cc.
3093 YYBACKUP is still to import back into lalr1.cc.
215b40ac 3094 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 3095
86c0e784
JD
30962008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3097
3098 For maintainer-check*, don't recompile for a $(VERSION) update.
3099 * cfg.mk: New file.
3100 (_is-dist-target): Override the one in GNUmakefile.
3101 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3102
88511166
JD
31032008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3104
3105 Update for recent change to gnulib.
3106 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3107 string.h now.
3108
6bbb2ed5
EB
31092008-08-15 Eric Blake <ebb9@byu.net>
3110
d67c52e8
EB
3111 Remaining m4sugar merge from autoconf.
3112 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3113 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3114 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3115 * src/output.c (output_skeleton): Tell m4 how to find it.
3116
6bbb2ed5
EB
3117 Partial m4sugar merge from autoconf: m4_map.
3118 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3119 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3120 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3121 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3122 for empty list.
3123 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3124 Likewise.
3125 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3126 declares it.
3127
8dce3875
JD
31282008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3129
3130 Keep .version and PACKAGE_VERSION in sync.
3131 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3132 dependency, and add comments justifying this in more detail. Discussed
3133 starting at
3134 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3135
882a1fbf
EB
31362008-08-06 Eric Blake <ebb9@byu.net>
3137
a3764451
EB
3138 Partial m4sugar merge from autoconf: m4_shiftn.
3139 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3140 (m4_shift2, m4_shift3): New macros.
3141 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3142 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3143 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3144 * data/java.m4 (b4_remove_comma): Likewise.
3145
882a1fbf
EB
3146 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3147 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3148 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3149 (m4_init): Consolidate wrapped text into single m4_wrap.
3150 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3151 in wrapped text.
3152
a30e920d
EB
31532008-08-05 Eric Blake <ebb9@byu.net>
3154
dfcc5959
EB
3155 Partial m4sugar merge from autoconf: builtins, version.m4.
3156 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3157 (m4_prepend): Remove, as it is unused and inherently quadratic,
3158 whereas m4_append is linear in newer m4.
3159 (m4_mkstemp): New builtin.
3160 (m4_symbols): Make rename conditional.
3161 (m4_version_prereq): Ensure fatal error if used in bison, which
3162 intentionally lacks version.m4.
3163
a30e920d
EB
3164 Fix comments in m4sugar.
3165 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3166
445b7470
JD
31672008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3168
3169 Update for recent .gitignore fix in Gnulib.
3170 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3171 anchored .gitignore entries.
3172
a1e50014
JD
31732008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3174
3175 Set gnu or gnits strictness.
3176 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3177 development and gnits strictness for releases. Based on Eric Blake's
3178 suggestion at
3179 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3180
d43f77e7
PB
31812008-07-31 Paolo Bonzini <bonzini@gnu.org>
3182
3183 * NEWS: Clarify documentation of %language.
3184
fee2ed87
PB
31852008-07-31 Paolo Bonzini <bonzini@gnu.org>
3186
3187 Support usage of git-merge-changelog.
3188 * .gitattributes: New.
3189 * HACKING: Document usage of git-merge-changelog.
3190 * bootstrap: Install git-merge-changelog entries in .git/config
3191 if appropriate.
3192
78029cd5
JD
31932008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3194
3195 Remove remaining dependence on CVS Id keyword.
3196 * ChangeLog: For the sake of people still using CVS, don't use dollars
3197 when mentioning Id.
3198 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3199 unusual anyway.
3200 * data/xslt/xml2dot.xsl: Likewise.
3201 * data/xslt/xml2text.xsl: Likewise.
3202 * data/xslt/xml2xhtml.xsl: Likewise.
3203 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3204 * doc/Makefile.am (neutralize): Remove, no longer needed.
3205 (.x.1): Don't use neutralize.
3206 (edit): Don't substitute for ID.
3207 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3208
c53d18b1
JD
32092008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3210
3211 Fix dependence on computed configure variables.
3212 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3213 $(top_srcdir)/configure.ac so that changes to computed variables, such
3214 as PACKAGE_VERSION, are seen.
3215 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3216
5523ac79
JD
32172008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3218
3219 Update copyright dates for recent changes.
3220 * Makefile.am: Here.
3221 * src/Makefile.am: Here.
3222 * src/reduce.c: Here.
3223 * tests/reduce.at: Here.
3224
8fa36911
JD
32252008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3226
3227 Use git-version-gen for version names between releases.
3228 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3229 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3230 * .prev-version: New.
3231 * .version.in: Remove.
78029cd5 3232 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3233 revision.
3234 * GNUmakefile: Remove, now copied from Gnulib.
3235 * Makefile.am: Add code suggested by comments in
3236 build-aux/git-version-gen.
3237 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3238 .prev-version, and .version.
3239 * NEWS (2.3b+): Rename to...
3240 (?.?): ... this because we're dropping the "+" version naming scheme,
3241 but, in general, we still can't be sure of our next release name.
3242 * bootstrap: Add a quick hack to remove from .gitignore the
3243 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3244 entry. This should really be fixed in gnulib instead.
3245 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3246 * configure.ac (AC_INIT): Set version name by invoking
3247 build-aux/git-version-gen.
3248 (AC_CONFIG_FILES): Remove .version, now generated by
3249 build-aux/git-version-gen.
3250 * maint.mk: New, copied from coreutils.
3251 * doc/.cvsignore (bison.1): Add.
3252 * doc/.gitignore (/bison.1): Add.
3253 * doc/bison.1: Remove, generated.
3254 * src/.cvsignore (revision.c): Remove.
3255 * src/.gitignore (/revision.c): Remove.
3256 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3257 (BUILT_SOURCES): Remove revision.c.
3258 (revision.c): Remove.
3259 * src/getargs.c (version): Don't print revision after the VERSION.
3260 * src/revision.h: Remove.
3261
bcf07cb7
JD
32622008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3263
3264 Fix untranslatable composition of sentences. Reported by Goran
3265 Uddeborg at
3266 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3267 * THANKS (Goran Uddeborg): Add.
3268 * src/reduce.c (reduce_print): Report the number of nonterminals and
3269 rules useless in the grammar in separate sentences.
3270 * tests/reduce.at (Useless Rules): Update output.
3271 (Reduced Automaton): Likewise.
3272 (Underivable Rules): Likewise.
3273 (Empty Language): Likewise.
3274
9aacab9a
JD
32752008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3276
3277 Fix some .gitignore and .cvsignore problems.
3278 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3279 (insert_vc_ignore): ... this new function, which prepends `/' to all
3280 .gitignore entries before passing them to insert_sorted_if_absent.
3281 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3282 .cvsignore files are maintained even though Bison developers run
3283 bootstrap while using Git.
3284 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3285 unneeded by Bison.
3286 (gnulib): Add.
3287 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3288 unneeded. Reported by Eric Blake.
3289 * lib/.gitignore (/*~): Add.
3290 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3291 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3292 Blake.
3293 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3294
a9fc7990
JD
32952008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3296
3297 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3298 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3299 * bootstrap.conf (gnulib_modules): Add unsetenv.
3300 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3301 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3302 (/setenv.m4): Add.
3303 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3304 the first argument because it may become position-dependent, and unset
3305 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3306 Add comments explaining these issues in more detail.
3307
0f1d6f10
JD
33082008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3309
3310 Add .gitignore everywhere based on .cvsignore.
3311 * .gitignore: New.
3312 * build-aux/.gitignore: New.
3313 * data/.gitignore: New.
3314 * doc/.gitignore: New.
3315 * etc/.gitignore: New.
3316 * examples/.gitignore: New.
3317 * examples/calc++/.gitignore: New.
3318 * lib/.gitignore: New.
3319 * m4/.gitignore: New.
3320 * po/.gitignore: New.
3321 * runtime-po/.gitignore: New.
3322 * src/.gitignore: New.
3323 * tests/.gitignore: New.
3324
7bd1665a
JD
33252008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3326
3327 * NEWS (2.3b+): New section, empty for now.
3328 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3329
72c5b982
JD
33302008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3331
3332 * NEWS (2.3b): Update release date since there has been a delay in
3333 getting the announcements and tarballs out.
3334
bd02cd5d
JD
33352008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3336
3337 * NEWS: Version 2.3b.
3338 * configure.ac (AC_INIT): Likewise.
3339 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3340
9126263e
JD
33412008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3342
3343 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3344 been doing it for years.
3345 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3346 (Release Procedure): Add FIXME about make alpha being unmaintained.
3347
fa6aa7b3
JD
33482008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3349
3350 * data/yacc.c: Reformat m4 a little for readability.
3351 * src/lalr.c (build_relations): Correct comment.
3352
d30b312d
JMG
33532008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3354
3355 DJGPP specific issue.
3356 * djgpp/config.sed: Fixes required to run configure scripts generated
3357 by autoconf 2.62.
3358
138d4cd9
JD
33592008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3360
3361 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3362 coordinator@translationproject.org.
3363
8f7e2e1f
JD
33642008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3365
3366 * THANKS: Add Eric Blake.
3367
f55efa38
JD
33682008-04-23 Eric Blake <ebb9@byu.net>
3369
3370 Revert prior patch, by working around autoconf regression.
3371 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3372 ("Output file name: ("): Uncomment test.
3373 ("Output file name: )"): Likewise.
3374 Based on an idea from Noah Misch.
3375
096c9f9d
JD
33762008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3377
3378 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3379 2.61. Reported by Juan Manuel Guerrero at
3380 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3381 * tests/output.at ("Output file name: ("): Comment out test case for
3382 now.
3383 ("Output file name: )"): Likewise.
3384
0f664b89
JD
33852008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3386
3387 * GNUmakefile: Update git-version-gen invocation so make dist
3388 succeeds.
3389
1cfe6375
JD
33902008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3391
3392 Update to the current gnulib CVS repository, and fix trigraph handling
3393 in Bison.
3394 * bootstrap: Update gnulib CVS repository URL.
3395 (symlink_to_dir): Encapsulate the code that guarantees the destination
3396 directory exists into...
3397 (check_dst_dir): ... this new function, and...
3398 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3399 fail when copying files into lib/uniwidth/.
3400 * src/output.c (prepare_symbols): When writing yytname muscles, where
3401 symbol names will be encoded in C-string literals, tell quotearg to
3402 escape trigraphs. This used to be the default in gnulib.
3403 * tests/regression.at (Token definitions): Because of the change in
3404 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3405 escapes trigraphs in symbol names. Thus, yytname no longer has
3406 trigraphs unnecessarily doubly escaped. Update test case output.
3407 Extend test case to be sure Bison's own error messages will no longer
3408 have trigraphs in symbol names unnecessarily escaped once.
3409
74c52fc8
JD
34102008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3411
3412 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3413 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3414 * .cvsignore: Add .version.
3415 * .version.in: New.
3416 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3417 * configure.ac (AC_CONFIG_FILES): Add .version.
3418 * build-aux/.cvsignore: Add git-version-gen.
3419
8e55b3aa
JD
34202008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3421
3422 * NEWS (2.3a+): Mention that -g now takes an argument.
3423 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3424 consistency. Update the -g and -x entries now that they take
3425 arguments. Use brackets to indicate optional arguments.
3426 * src/getargs.c (usage): Explain the relationship between arguments of
3427 long and short options more completely. Document --defines and -d
3428 separately since the former takes an argument but, for POSIX Yacc, the
3429 latter does not.
3430 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 3431 (getargs): Sort cases.
8e55b3aa 3432
59c5ac72
AD
34332008-02-28 Akim Demaille <demaille@gostai.com>
3434
3435 * doc/bison.texinfo: Fix a few typos.
3436
118d4978
AD
34372008-02-28 Akim Demaille <akim@epita.fr>
3438
3439 * doc/bison.texinfo (Bison Options): Document -W.
3440 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3441
7020f1e9
AD
34422008-02-28 Akim Demaille <akim@epita.fr>
3443
3444 * src/getargs.c (short_options): Split and sort for readability.
3445 -g and -x take optional arguments, just like their long options.
3446 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3447 understand.
3448 Fix the handling of $opt which resulted in all the argument to be
3449 considered as optional.
3450
59da312b
JD
34512008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3452
3453 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3454 say its interface is experimental.
3455 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3456 Java.
3457 (Bison Options): In the -L and --language entry, mention Java.
3458 (Java Bison Interface): Say the interface is experimental.
3459 * src/getargs.c (usage): Mention -L and --language.
3460
3461 * NEWS (2.3a+): Say the push parsing interface is experimental.
3462 * doc/bison.texinfo (Push Decl): Likewise.
3463 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3464 (Push Parser Function): Likewise.
3465 (Pull Parser Function): Likewise.
3466 (Parser Create Function): Likewise.
3467 (Parser Delete Function): Likewise.
3468 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3469 yypull_parse, and yypush_parse entries.
3470
3471 * NEWS (2.3a+): Mention XML support, and say the schema is
3472 experimental.
3473 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3474 * src/getargs.c (usage): Say the XML schema is experimental.
3475
3476 * NEWS (2.3a+): Say option instead of flag.
3477
2bb3ebec
WP
34782008-02-21 Wojciech Polak <polak@gnu.org>
3479
3480 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3481 text.
3482
333e670c
JD
34832008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3484
3485 Fix impure push parser compile error reported by Bob Rossi at
3486 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3487 * data/yacc.c: Clean up whitespace in the output a little.
3488 (yypstate_allocated): Define for impure push parsers regardless of
3489 whether the pull interface is also requested.
3490 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3491 check impure push parsers without the pull interface.
3492
3493 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3494 yyerror takes arguments specified by %parse-param while yypstate_new
3495 does not.
3496 * doc/bison.texinfo (Parser Create Function): Document that
3497 yypstate_new returns 0 for multiple impure parser instances.
3498 * tests/push.at (Push Parsing: Multiple impure instances): Update
3499 expected stderr output.
3500
798096e1
JD
35012008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3502
3503 * runtime-po/POTFILES.in (push.c): Remove.
3504
9ca7f077
JD
35052008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3506
3507 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3508 * data/push.c: Rename to...
3509 * data/yacc.c: ... this, overwriting it.
3510 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3511 `%push-pull-parser' -> `%define api.push_pull "both"'.
3512 Remove old yacc.c tests, and update push.c tests to yacc.c.
3513
42ee26bb
JD
35142008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3515
3516 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3517 `"%code top" blocks' instead of `%code "top" blocks'.
3518 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3519 Clean up whitespace in the output a little.
3520
b1cc23c4
JD
35212008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3522
3523 Fix documentation problems reported by Tim Josling at
3524 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3525 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3526 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3527 integers. Explain the effect of literal string aliases on error
3528 messages. Copy token 0 documentation from the C++ skeleton
3529 documentation.
3530
ab7f29f8
JD
35312008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3532
3533 Accept a token number in a %left, %right, or %nonassoc for POSIX
3534 conformance. Reported by Tim Josling at
3535 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3536 * NEWS (2.3a+): Mention.
3537 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3538 and code numbers are treated by precedence declarations.
3539 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3540 of symbols.1.
3541 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3542 of symbol.
3543 (symbol.prec): New, just like symbol but allows INT.
3544 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3545 longer holds.
3546 * tests/regression.at (Token number in precedence declaration): New
3547 test case.
3548
a924ef36
JMG
35492008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3550
3551 DJGPP specific issues.
3552 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3553 be changed. Copyright timestamp adjusted.
3554 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3555 be changed. Copyright timestamp adjusted.
3556 * djgpp/config.site: Copyright timestamp adjusted.
3557 * djgpp/config_h.sed: Copyright timestamp adjusted.
3558 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3559 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3560 filename translation list.
3561 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3562 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3563 files shall be created. Before trying to use the temp dir where the
3564 environment variable points to check that the dir really exists. If
3565 not default to the cwd as temp dir. Copyright timestamp adjusted.
3566 * djgpp/subpipe.h: Copyright timestamp adjusted.
3567 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3568
389c8cfd
PE
35692008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3570
3571 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3572
5d1cfef4
PE
35732008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3574
3575 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3576 Problem reported by Claudio Saavedra in
3577 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3578
e2dcf996
WP
35792008-01-05 Wojciech Polak <polak@gnu.org>
3580
3581 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3582 document's title with the input grammar file name.
3583
da730230
JD
35842007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3585
3586 Automate regression testing of the XML/XSLT implementation. Discussed
3587 starting at
3588 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3589 * configure.ac (XSLTPROC): New substitution.
3590 * Makefile.am (maintainer-xml-check): New phony target invoking...
3591 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3592 invoking make maintainer-check with BISON_TEST_XML=1.
3593 * tests/atlocal.in (XSLTPROC): New.
3594 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3595 not to report reachable memory when Bison is expected to have a
3596 non-zero exit status and (2) to compare XML/XSLT output with --graph
3597 and --report=all output for every working grammar when
3598 BISON_TEST_XML=1.
3599 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3600 (AT_BISON_CHECK_XML): New.
3601 (AT_QUELL_VALGRIND): New.
3602 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3603 (AT_CHECK): ... don't redefine this since this was the old way to
3604 quell Valgrind.
3605 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3606 AT_BISON_CHECK invocations.
3607 * tests/c++.at: Likewise.
3608 * tests/calc.at: Likewise.
3609 * tests/conflicts.at: Likewise.
3610 * tests/cxx-type.at: Likewise.
3611 * tests/existing.at: Likewise.
3612 * tests/glr-regression.at: Likewise.
3613 * tests/headers.at: Likewise.
3614 * tests/input.at: Likewise.
3615 * tests/java.at: Likewise.
3616 * tests/output.at: Likewise.
3617 * tests/push.at: Likewise.
3618 * tests/reduce.at: Likewise.
3619 * tests/regression.at: Likewise.
3620 * tests/sets.at: Likewise.
3621 * tests/skeletons.at: Likewise.
3622 * tests/synclines.at: Likewise.
3623 * tests/torture.at: Likewise.
3624 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3625 tends to hang xsltproc.
3626 (Big horizontal): Likewise.
3627
408476bc
JD
36282007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3629
3630 In XML output, remove redundant class attribute on symbol element.
3631 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3632 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3633 look up a symbol to determine whether it's a nonterminal or terminal.
3634 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3635 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3636
3637 Add prec/assoc information to XML output.
3638 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3639 %prec, add a percent_prec attribute.
3640 * src/print-xml.c (print_grammar): For each terminal that has a
3641 precedence or associativity, add a prec or assoc attribute.
3642 (xml_indent): New.
3643 (xml_puts): Use xml_indent.
3644 (xml_printf): Use xml_indent.
3645 * src/print-xml.h (xml_indent): Prototype.
3646
3647 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3648 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3649
d4a26c48
JD
36502007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3651
3652 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3653 (bison:ruleByNumber): ... this for clarity.
3654 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3655 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3656 (xsl:template match="reduction"): Update.
3657 (xsl:template match="item"): Update.
3658 (xsl:template match="reduction"): Update.
3659
3660 In the XML output, don't print the list of rules where symbols appear.
3661 Compute it in XSLT instead. Discussed at
3662 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3663 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3664 (bison:ruleByRhs): New.
3665 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3666 bison:ruleByRhs.
3667 (xsl:template match="terminal/rule"): Remove.
3668 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3669 bison:ruleByRhs.
3670 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3671 Remove.
3672 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3673 bison:ruleByRhs and mode="number-link" for rule template.
3674 (xsl:template match="terminal/rule"): Remove.
3675 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3676 bison:ruleByRhs and mode="number-link" for rule template.
3677 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3678 Rewrite as...
3679 (xsl:template match="rule" mode="number-link"): ... this.
3680 * src/print-xml.c (print_grammar): Don't print the list of rules.
3681
ef1b4273
JD
36822007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3683
3684 Don't let --report affect XML output; always print all information.
3685 Discussed at
3686 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3687 * src/conflicts.c (log_resolution): Implement.
3688 * src/print-xml.c (print_core): Implement.
3689 (print_state): Implement.
3690 (print_xml): Implement.
3691
3692 * NEWS (2.3a+): Fix quotes.
3693 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3694 don't let %verbose clear the list specified by --report.
3695
0f6cd9e3
AD
36962007-11-26 Akim Demaille <akim@epita.fr>
3697
3698 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3699
d80fb37a
JD
37002007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3701
3702 In the XML output, list useless and unused symbols and rules with the
3703 useful ones and add a "usefulness" attribute. Discussed starting at
3704 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3705 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3706 (grammar_rules_print_xml): Print all rules instead of just those
3707 useful in the grammar, and add a "usefulness" attribute.
3708 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3709 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3710 (print_grammar): Print all nonterminals instead of just useful ones,
3711 and add a "usefulness" attribute to nonterminals and terminals.
3712 (print_xml): Don't print a separate "reductions" or
3713 "rules-useless-in-parser" element.
3714 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3715 (reduce_xml): Remove.
3716 (reduce_token_unused_in_grammar): New.
3717 (reduce_nonterminal_useless_in_grammar): New.
3718 * src/reduce.h (reduce_xml): Remove prototype.
3719 (reduce_token_unused_in_grammar): Add prototype.
3720 (reduce_nonterminal_useless_in_grammar): Add prototype.
3721 * data/xslt/xml2text.xsl: Update for XML changes.
3722 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3723 * tests/reduce.at (Useless Terminals): Update output.
3724 (Useless Rules): Update output.
3725 (Reduced Automaton): Update output.
3726
3727 Say "Terminals unused in grammar" instead of "Unused terminals".
3728 * NEWS (2.3a+): Update.
3729 * doc/bison.texinfo (Understanding): Update example output.
3730 * src/reduce.c (reduce_output): Implement.
3731 * data/xslt/xml2text.xsl: Implement.
3732 * data/xslt/xml2xhtml.xsl: Implement.
3733
1bb2bd75
JD
37342007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3735
3736 Accept --report-file=FILE to override the default `.output' filename.
3737 * NEWS (2.3a+): Mention.
3738 * doc/bison.texinfo (Bison Options): Add an entry.
3739 * src/files.c (compute_output_file_names): Don't override
3740 spec_verbose_file if already set.
3741 * src/getargs.c (usage): Document --report-file.
3742 (REPORT_FILE_OPTION): New anonymous enum member.
3743 (long_options): Add entry for it.
3744 (getargs): Add case for it setting spec_verbose_file.
3745
3746 * build-aux/cross-options.pl: Don't record a short option just because
3747 there's an arg.
3748 * doc/.cvsignore: Add yacc.1.
3749
a005a9c4
AD
37502007-11-14 Akim Demaille <akim@epita.fr>
3751
3752 * doc/yacc.1.in: New.
3753 * configure.ac, doc/Makefile.am: Adjust.
3754 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3755 config.h symbol.
3756 Use AC_SUBST for assignments too.
3757 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3758
cff03fb2
JD
37592007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3760
3761 * src/gram.c: Remove comments that duplicate comments in gram.h.
3762
3763 When reporting useless rules and nonterminals, say "useless in grammar"
3764 instead of "useless", and say "useless in parser" instead of "never
3765 reduced". Discussed starting at
3766 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3767 * NEWS (2.3a+): Mention this change.
3768 * data/xslt/xml2text.xsl: Update output text and expected input XML
3769 element names to match changes below.
3770 * data/xslt/xml2xhtml.xsl: Likewise.
3771 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3772 Contents: "Rules useless in parser due to conflicts".
3773 * doc/bison.texinfo (Decl Summary): Reword a little.
3774 (Understanding): Update example output for changes below.
3775 * src/gram.c: (rule_useful_p): Rename to...
3776 (rule_useful_in_grammar_p): ... this.
3777 (rule_useless_p): Rename to...
3778 (rule_useless_in_grammar_p): ... this.
3779 (rule_never_reduced_p): Rename to...
3780 (rule_useless_in_parser_p): ... this.
3781 (grammar_rules_print): Update for renames.
3782 (grammar_rules_print_xml): Update for renames.
3783 (grammar_rules_never_reduced_report): Rename to...
3784 (grammar_rules_useless_report): ... this since it is used for either
3785 kind of useless rule.
3786 * src/gram.h: Reword comments and update function names in prototypes.
3787 * src/main.c (main): Say "rule useless in parser due to conflicts".
3788 * src/print-xml.c (print_rules_never_reduced): Rename to...
3789 (print_rules_useless_in_parser): ... this, and rename output XML
3790 element "rules-never-reduced" to "rules-useless-in-parser".
3791 (print_xml): Update for rename.
3792 * src/print.c (print_results): Say "Rules useless in parser due to
3793 conflicts".
3794 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3795 (nonterminals_reduce): Say "nonterminal useless in grammar".
3796 (reduce_output): Say "Nonterminals useless in grammar".
3797 Say "Rules useless in grammar".
3798 (reduce_xml): Rename output XML element "useless" to
3799 "useless-in-grammar".
3800 (reduce_print): Don't report the count of grammatically useless rules
3801 as "rules never reduced" just because %yacc is specified.
3802 In the correct report of this count, say nonterminal(s) and rule(s)
3803 "useless in grammar".
3804 * tests/conflicts.at (S/R in initial): Update expected output.
3805 (Defaulted Conflicted Reduction): Likewise.
3806 (Unreachable States After Conflict Resolution): Likewise.
3807 * tests/existing.at (GNU pic Grammar): Likewise.
3808 * tests/reduce.at (Useless Nonterminals): Likewise.
3809 (Useless Rules): Likewise.
3810 (Reduced Automaton): Likewise.
3811 (Underivable Rules): Likewise.
3812 (Empty Language): Likewise.
3813
66f0441d
JD
38142007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3815
3816 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3817 here document and before the EOF so that BSD's implementation of Bourne
3818 shell doesn't parse the delimiter as part of the here document.
3819 * doc/.cvsignore: Add cross-options.texi.
3820 * src/getargs.c (usage): Add a blank line after the warning categories.
3821
d0ee4105
PB
38222007-11-08 Paolo Bonzini <bonzini@gnu.org>
3823
3824 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3825
e8b1fb9b
AD
38262007-11-05 Akim Demaille <akim@epita.fr>
3827
3828 Remove Id: from bison.1.
3829 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3830 (perl -0777 -pi -e 's/\.PP\nId): New.
3831 (.x.1): Use it to ignore the version control revision.
3832
2f7a96b5
AD
38332007-11-05 Akim Demaille <demaille@gostai.com>
3834
3835 * build-aux/Makefile.am: Ship cross-options.pl.
3836 * doc/Makefile.am: Always refer to cross-options.texi with
3837 $(srcdir).
3838 (MAINTAINERCLEANFILES): Add it.
3839
f4101aa6
AD
38402007-11-04 Akim Demaille <demaille@gostai.com>
3841
3842 Generate the long/short option cross-table.
3843 * build-aux/cross-options.pl: New.
3844 * doc/Makefile.am (cross-options.texi): New.
3845 * doc/bison.texinfo: Use it.
3846
727a1401
AD
38472007-11-04 Akim Demaille <demaille@gostai.com>
3848
3849 Generate bison.1 using help2man.
3850 * doc/common.x, doc/bison.x: New.
3851 * doc/Makefile.am (bison.1, .x.1): New.
3852 The code is taken from autoconf-2.61/man/Makefile.am.
3853 * configure.ac: Look for help2man.
3854
6aeb9c57
AD
38552007-11-04 Akim Demaille <demaille@gostai.com>
3856
3857 Complete --help.
3858 * src/getargs.c (usage): Document -W, make it clear that -d,
3859 -g and -x have optional arguments.
3860
d7be4085
AD
38612007-11-04 Akim Demaille <demaille@gostai.com>
3862
3863 Find sha1sum when named gsha1sum.
3864 * bootstrap (find_tool): New.
3865 ($SHA1SUM): New.
3866
d9df47b6
JD
38672007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3868
3869 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3870 at
3871 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3872 * NEWS (2.3a+): Mention.
3873 * data/bison.m4 (b4_pure_if): Don't define it here.
3874 * data/c.m4 (b4_identification): Depend on individual skeletons to
3875 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3876 values of the %define variables api.pure or api.push_pull. Define
3877 YYPURE, YYPUSH, and YYPULL accordingly.
3878 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3879 glr.cc has already defined b4_pure_flag.
3880 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3881 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 3882 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
3883 * doc/bison.texinfo (Pure Decl): Update.
3884 (Push Decl): Update.
3885 (Decl Summary): Add api.pure to %define entry.
3886 In %pure-parser entry, say it's deprecated and reference %define.
3887 (Pure Calling): Update.
3888 (Error Reporting): Update.
3889 (C++ Scanner Interface): Update.
3890 (How Can I Reset the Parser): Update.
3891 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3892 reference %define.
3893 * src/getargs.c (pure_parser): Remove global variable.
3894 * src/getargs.h (pure_parser): Remove extern.
3895 * src/output.c (prepare): Don't define pure_flag muscle.
3896 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3897 wrapper around `%define api.pure'.
3898 * tests/calc.at (Simple LALR Calculator): Update.
3899 (Simple GLR Calculator): Update.
3900 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3901 Update.
3902 (GLR: Resolve ambiguity, pure, locations): Update.
3903 (GLR: Merge conflicting parses, pure, no locations): Update.
3904 (GLR: Merge conflicting parses, pure, locations): Update.
3905 * tests/glr-regression.at (Uninitialized location when reporting
3906 ambiguity): Update
3907 * tests/input.at (Unused %define api.pure): New test case.
3908 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3909 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3910 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3911
c373bf8b
JD
39122007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3913
3914 %define push_pull -> %define api.push_pull. Discussed starting at
3915 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3916 * data/push.c: Expect the new name.
3917 * data/yacc.c: Likewise.
3918 * doc/bison.texinfo (Push Decl): Update.
3919 (Decl Summary): Update %define entry.
3920 (Push Parser Function): Update.
3921 (Pull Parser Function): Update.
3922 (Parser Create Function): Update.
3923 (Parser Delete Function): Update.
3924 * tests/calc.at (Simple LALR Calculator): Update.
3925 * tests/input.at (%define enum variables): Update.
3926 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3927 (Push Parsing: Multiple impure instances): Update.
3928 (Push Parsing: Unsupported Skeletons): Update.
3929 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3930 (Exploding the Stack Size with Malloc): Update.
3931
3932 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3933 other entries some.
3934
32f19b6b
JD
39352007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3936
3937 For the XML output's terminal element, rename @number to @token-number,
3938 and add @symbol-number. In the nonterminal element, rename @number to
3939 @symbol-number. Discussed starting at
3940 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3941 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3942 renames.
3943 (xsl:template match="nonterminal"): Likewise.
3944 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3945 (xsl:template match="nonterminal"): Likewise.
3946 * src/print-xml.c (print_grammar): Implement.
3947
255a6b90
JD
39482007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3949
3950 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3951 2007-10-11 change, the child elements here are items not rules.
408476bc 3952 (xsl:template match="item"): New.
255a6b90
JD
3953 (xsl:template match="rule"): Update for new reduced itemset.
3954 (xsl:template match="point"): Remove.
3955 (xsl:template match="empty"): For consistency with --graph, don't
3956 output "/* empty */".
3957 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3958 line-wrap, don't pass a negative value as first-line-length since this
3959 won't work with the following changes.
3960 (xsl:template name="line-wrap"): Simplify slightly.
3961 (xsl:template name="ws-search"): Eliminate recursion.
3962 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3963 set next to an item whose dot is not at the end of the RHS even if it
3964 happens to be associated with the same rule.
3965
88c78747
JD
39662007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3967
31984206
JD
3968 Add %define lr.keep_unreachable_states.
3969 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3970 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3971 * src/main.c (main): Implement it.
3972 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3973 Extend to test it, and fix a typo.
3974
39752007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3976
3977 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
3978 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3979 the example .output text.
3980 * tests/regression.at (Extra lookahead sets in report): Improve wording
3981 of comments.
3982
b7a70162
WP
39832007-10-17 Wojciech Polak <polak@gnu.org>
3984
3985 * src/print-xml.c (print_grammar): Renamed
3986 <terminal> and <nonterminal> attributes:
3987 "type" to "number" and "symbol" to "name".
3988 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3989 Use new attribute names.
3990 (xsl:template match="nonterminal"): Likewise.
3991 * data/xslt/xml2xhtml.xsl: Likewise.
3992
a0de5091
JD
39932007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3994
3995 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3996 (Option Cross Key): Likewise.
3997
3998 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3999 next to an item whose dot is not at the end of the RHS even if it
4000 happens to be associated with the same rule.
4001 * src/print.c (print_core): Likewise.
4002 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4003 (Resolved SR Conflicts): Update output.
4004 * tests/regression.at (Extra lookahead sets in report): New test case.
4005
4c20d18d
WP
40062007-10-11 Wojciech Polak <polak@gnu.org>
4007
4008 * src/print-xml.c (print_core): Remove item set
4009 redundancy.
4010 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4011 Improve processing time. Suggested by Joel E. Denny.
4012 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4013 Write xsl:param "required" attribute as comment.
4014 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4015 (xsl:template match="rule"): Support new reduced itemset.
4016 (xsl:template match="point"): Remove.
4017 * data/xslt/xml2xhtml.xsl: Likewise.
4018
f506ad1c
JD
40192007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4020
4021 * src/getargs.c (version): Update copyright year.
4022
21f1b063
JD
40232007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4024
4025 Make xml2dot.xsl and --graph produce the same output.
4026 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4027 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4028 escaped later.
4029 (xsl:template name="output-node"): Use the new escape template instead
4030 of the string-replace template directly.
4031 (xsl:template name="output-edge"): Likewise.
4032 (xsl:template name="escape"): New, escapes backslashes and newlines in
4033 addition to quotation marks.
4034 * src/graphviz.c (start_graph, output_node, output_edge): Add
4035 whitespace to output for legibility.
4036
4037 Make xml2text.xsl and --report produce the same output, and remove the
4038 XML "conflicts" element since a conflict summary is easily extracted
4039 from the automaton.
4040 * data/xslt/bison.xsl: New.
4041 (xsl:template match="state" mode="bison:count-conflicts): New.
4042 * data/xslt/xml2text.xsl: Import bison.xsl.
4043 (xsl:template match="bison-xml-report"): Instead of styling the
4044 "conflicts" element, style the "automaton" element with mode
4045 "conflicts". Unlike the former, the latter lists S/R and R/R
4046 conflicts for a state on the same line.
4047 (xsl:template match="conflicts"): Remove.
4048 (xsl:template match="conflict"): Remove.
4049 (xsl:template match="terminal"): Line-wrap the list of rules in which
4050 the terminal is used.
4051 (xsl:template match="nonterminal"): Likewise for nonterminals.
4052 (xsl:template match="automaton" mode="conflicts"): New.
4053 (xsl:template match="state" mode="conflicts"): New.
4054 (xsl:template name="line-wrap"): New.
4055 (xsl:template name="ws-search"): New.
4056 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4057 (xsl:template match="bison-xml-report"): Instead of styling the
4058 "conflicts" element, style the "automaton" element with mode
4059 "conflicts."
4060 (xsl:template match="conflicts"): Remove.
4061 (xsl:template match="conflict"): Remove.
4062 (xsl:template match="automaton" mode="conflicts"): New.
4063 (xsl:template match="state" mode="conflicts): New.
4064 * src/conflicts.c (conflicts_output_xml): Remove.
4065 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4066 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4067 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4068 the corresponding XSLT is easier. Also, never wrap between a word and
4069 the comma that follows it.
4070
793fbca5
JD
40712007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4072
4073 Improve C++ namespace support. Discussed starting at
4074 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4075 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4076 b4_namespace_close): New macros that interpret the %define variable
4077 "namespace" so its value can contain "::" to indicate nested
4078 namespaces.
4079 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4080 the above macros.
4081 * data/lalr1.cc (b4_namespace): Likewise.
4082 * data/location.cc (b4_namespace): Likewise.
4083 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4084 inside a new table in the general %define entry. Document `%define
4085 namespace' there as well. Point the %name-prefix entry to it since it
4086 explains it more completely in the case of C++.
4087 (C++ Bison Interface): Mention `%define namespace' instead of
4088 %name-prefix.
4089 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4090 entry suffices.
4091 * tests/c++.at (Relative namespace references): New test case.
4092 (Absolute namespace references): New test case.
4093 (Syntactically invalid namespace references): New test case.
4094 * tests/input.at (C++ namespace reference errors): New test case.
4095
35b8730d
JD
40962007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4097
4098 Add syncline support and location accessor to internal %define
4099 interfaces.
4100 * data/bison.m4 (b4_percent_define_get_loc): New.
4101 (b4_percent_define_get_syncline): New.
4102 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4103 (b4_percent_define_default): Record defining location as line 1 rather
4104 than 0 for the sake of synchronizing #line's, and define
4105 b4_percent_define_syncline(VARIABLE).
4106 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4107 * src/muscle_tab.c (muscle_syncline_grow): New.
4108 (muscle_code_grow): Use muscle_syncline_grow.
4109 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4110 define b4_percent_define_syncline(VARIABLE).
4111 (muscle_percent_define_get_loc): New.
4112 (muscle_percent_define_get_syncline): New.
4113 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4114 remove some unused variables.
4115 (muscle_percent_define_default): Record defining location as line 1
4116 rather than 0 for the sake of synchronizing #line's, and define
4117 b4_percent_define_syncline(VARIABLE).
4118 (muscle_percent_define_check_values): Use
4119 muscle_percent_define_get_loc.
4120 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4121 (muscle_percent_define_get_syncline): Prototype.
4122 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4123 defaults): Update output for location change.
4124 (Complaining during macro argument expansion): Extend to test
4125 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4126
7dc4a694
JD
41272007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4128
4129 Fix some error-reporting macro bugs.
4130 * data/bison.m4 (b4_cat): New.
4131 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4132 to stdout so they don't become arguments to other macros. Update
4133 comments and add examples.
4134 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4135 add examples.
4136 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4137 after printing the error directive so that M4 doesn't report subsequent
4138 problems that are induced by this problem.
4139 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4140 instead of just in them. Recognize @\n in both places. Both expand to
4141 the empty string. Needed by b4_cat.
4142 * tests/skeletons.at (Complaining during macro argument expansion):
4143 New test case.
4144 (Fatal errors make M4 exit immediately): New test case.
4145
d4bd2295
JD
41462007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4147
4148 Implement --print-datadir.
4149 * src/getargs.c (usage): Mention.
4150 (PRINT_DATADIR_OPTION): New anonymous enum member.
4151 (long_options): Add entry for it.
4152 (getargs): Add case for it calling compute_pkgdatadir.
4153 * src/output.c (output_skeleton): Encapsulate data directory
4154 computation from here...
4155 (prepare): ... and from here...
4156 (compute_pkgdatadir): ... into this new function.
4157 * src/output.h (compute_pkgdatadir): Prototype.
4158
34cdeddf
JD
41592007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4160
4161 * src/print-xml.c (escape_bufs): New static global variable
4162 replacing...
4163 (xml_escape_n): ... the static local variable buf here.
4164 (print_xml): Free memory for escape_bufs.
4165 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4166
d782395d
JD
41672007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4168
4169 Replace `%push-parser' and `%push-pull-parser' with
4170 `%define push_pull "push"' and `%define push_pull "both"'.
4171 `%define push_pull "pull"' is the default.
4172 * doc/bison.texinfo (Push Decl, Push Parser Function,
4173 Pull Parser Function, Parser Create Function, Parser Delete Function):
4174 Update declarations.
4175 (Decl Summary, Table of Symbols): Replace %push-parser and
4176 %push-pull-parser entries with a %define push_pull entry.
4177 * data/bison.m4 (b4_percent_define_check_values): New macro.
4178 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4179 definitions...
4180 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4181 definitions...
4182 * data/push.c: ... to here and compute them from the value of the
4183 %define variable push_pull.
4184 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4185 parsing requests here...
4186 * data/yacc.c: ... hack this to switch to push.c any time
4187 b4_use_push_pull_flag or the %define variable push_pull is set. This
4188 will go away when we mv push.c yacc.c.
4189 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4190 push parsing is not supported since unused %define variables are
4191 reported anyway.
4192 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4193 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4194 comments for consistency with b4_percent_define_check_values.
4195 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4196 muscles.
4197 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4198 Remove.
4199 (prologue_declaration): Remove %push-parser and %push-pull-parser
4200 rules.
4201 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4202 * tests/calc.at: Update declarations.
4203 * tests/input.at (%define enum variables): New test case.
4204 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4205 declaration.
4206 (Push Parsing: Multiple impure instances): Update declaration.
4207 (Push Parsing: Unsupported Skeletons): New test case.
4208 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4209 declaration.
4210 (Exploding the Stack Size with Malloc): Update declaration.
4211
3f999f78
WP
42122007-09-24 Wojciech Polak <polak@gnu.org>
4213
4214 Add XSLT transformations.
4215
4216 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4217 * data/xslt/xml2text.xsl: Transform XML into plain text.
4218 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4219 * data/Makefile.am (xsltdir): New variable.
4220 (dist_xslt_DATA): Add xslt/*.xsl files.
4221
a4f75309
PE
42222007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4223
4224 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4225 Problem reported by Wojciech Polak.
4226 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4227 (xml_printf): Undo change I made on 21 September; that is,
4228 indent 2 spaces, not 1.
4229
ad5feac4
JD
42302007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4231
4232 Pacify ./configure --enable-gcc-warnings.
4233 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4234 `char const *' instead of `char *'.
4235 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4236 local variable `sep'.
4237
41d7a5f2
PE
42382007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4239
4240 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4241 elsewhere.
4242 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4243 (xml_printf): Indent just 1 space for level.
4244 (e_char, xlate_char): Remove.
4245 (xml_escape_string): Rewrite to avoid undefined behavior (used
4246 storage that was freed from the stack).
4247 (xml_escape_n): Don't bother checking for subscript error.
4248
3f999f78
WP
42492007-09-21 Wojciech Polak <polak@gnu.org>
4250
4251 Add Bison XML Automaton Report.
41d7a5f2
PE
4252
4253 Add support for an -x option to generate an XML report.
4254 It is not documented yet.
4255 * src/print-xml.c: New file.
4256 * src/print-xml.h: Likewise.
4257 * lib/timevar.def (TV_XML): New var.
4258 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4259 * src/conflicts.c: Include print-xml.h.
4260 (solved_conflicts_xml_obstack): New var.
4261 (log_resolution, conflicts_solve, conflicts_free):
4262 Add support for XML report.
4263 (conflicts_output_val): New function.
4264 * src/conflicts.h (conflicts_output_val): New decl.
4265 * src/files.c (spec_xml_file): New var.
4266 (compute_output_file_names, output_file_names_free): Add XML support.
4267 * src/files.h (spec_xml_file): New decl.
4268 * src/getargs.c (xml_flag): New var.
4269 (usage, short_options, long_options, getargs): Add XML support.
4270 * src/getargs.h (xml_flag): New decl.
4271 * src/gram.c: Include print-xml.h.
4272 (rule_lhs_print_xml, rule_rhs_print_xml):
4273 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4274 New functions.
4275 * src/gram.h: Declare external ones.
4276 * src/main.c: Include print-xml.h.
4277 (main): Add XML support.
4278 * src/reduce.c: Include print-xml.h.
4279 (reduce_xml): New function.
4280 * src/reduce.h: Declare it.
4281 * src/state.c: Include print-xml.h.
4282 (state_new): Add XML support.
4283 (state_rule_lookahead_tokens_print_xml): New function.
4284 * src/state.h: Declare it.
4285 (struct state): New member solved_conflicts_xml.
4286 * src/symtab.c (symbol_class_get_string): New function.
4287 * src/symtab.h: Declare it.
4288
6d8e724d
PE
42892007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4290
4291 * GNUmakefile: Switch to coreutils's version.
4292 * bootstrap: Likewise.
4293 * Makefile.cfg: Adjust to new GNUmakefile.
4294 * README-hacking: Likewise.
4295
4296 Import from gnulib:
4297
4298 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4299 Bruno Haible <bruno@clisp.org>
4300
4301 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4302 and is a script that invokes bison. Tighten the code. Add comments.
4303
922bdd7f
JD
43042007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4305
4306 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4307 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4308 * doc/bison.texinfo (Decl Summary): Fix.
4309 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4310 * tests/input.at (Boolean %define variables): Update output.
4311 * tests/skeletons.at (%define boolean variables: invalid skeleton
4312 defaults): Rename to...
4313 (%define Boolean variables: invalid skeleton defaults): ... this and
4314 update output.
4315
1b17b01d
JD
43162007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4317
4318 In impure push mode, don't allow more than one yypstate to be allocated
4319 since multiple impure parsers would corrupt yynerrs.
4320 * data/push.c (yypstate_allocated): New static global variable
4321 initialized to 0.
4322 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4323 exhaustion if yypstate_allocated is 1, but still return 2.
4324 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4325 already 1. Otherwise, set it to 1.
4326 (yypstate_delete): Set it to 0.
4327 * tests/push.at (Push Parsing: Multiple impure instances): New test
4328 case.
4329
9987d1b3
JD
43302007-08-17 Bob Rossi <bob@brasko.net>
4331
4332 * doc/bison.texinfo (Push Decl): Document the push parser.
4333 (Table of Symbols): Ditto.
4334 (Pure Decl): Ditto.
4335 (Decl Summary): Ditto.
4336 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4337 Parser Create Function, Parser Delete Function):
4338 Add new push parser symbols.
4339 (Table of Symbols): Document push-parser, push-pull-parser,
4340 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4341
f16b0819
PE
43422007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4343
4344 Update to GPLv3.
4345 * doc/gpl-3.0.texi: New file.
4346 * doc/gpl.texi: Remove.
4347 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4348 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4349 * README-hacking, TODO, bootstrap, bootstrap.conf:
4350 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4351 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4352 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4353 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4354 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4355 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4356 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4357 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4358 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4359 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4360 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4361 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4362 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4363 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4364 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4365 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4366 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4367 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4368 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4369 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4370 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4371 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4372 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4373 * src/complain.c, src/complain.h, src/conflicts.c:
4374 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4375 * src/files.h, src/flex-scanner.h, src/getargs.c:
4376 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4377 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4378 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4379 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4380 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4381 * src/print.c, src/print.h, src/print_graph.c:
4382 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4383 * src/reduce.h, src/relation.c, src/relation.h:
4384 * src/revision.h, src/scan-code.h, src/scan-code.l:
4385 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4386 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4387 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4388 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4389 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4390 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4391 * tests/existing.at, tests/glr-regression.at:
4392 * tests/headers.at, tests/input.at, tests/java.at:
4393 * tests/local.at, tests/output.at, tests/push.at:
4394 * tests/reduce.at, tests/regression.at, tests/sets.at:
4395 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4396 * tests/torture.at:
4397 Update to GPLv3.
4398
728c4be2
JD
43992007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4400
4401 Get rid of broken %no-parser, -n, and --no-parser implementation and
4402 documentation.
4403 * TODO: Don't mention them.
4404 * doc/bison.1: Likewise.
4405 * doc/bison.texinfo (Decl Summary): Likewise.
4406 (Bison Options): Likewise.
4407 (Option Cross Key): Likewise.
4408 * src/getargs.c (no_parser_flag): Remove global variable.
4409 (usage): Don't print description of -n and --no-parser.
4410 (long_options): Remove --no-parser entry here.
4411 (getargs): Remove -n case in the switch here.
4412 * src/getargs.h (no_parser_flag): Remove extern.
4413 * tests/regression.at (Web2c Actions): Remove comment that mentions
4414 --no-parser.
4415
5d31a216
JD
44162007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4417
4418 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4419 name user variables starting with `yy'. Just pass NULL instead of a
4420 dummy local &yylval to yypush_parse.
4421 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4422 starting with `yy'.
4423
a2ea208d
JD
44242007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4425
4426 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4427 true since it's then always used regardless of whether yyoverflow is
4428 defined. Reported by Christian Burger at
4429 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4430 * THANKS: Add Christian Burger.
4431
91661ebb
JD
4432 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4433 node names: say "Decl Summary" not "Bison Declaration Summary".
4434
cbd50549
JD
44352007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4436
4437 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4438 determine whether this function has already complained about an invalid
4439 value for a %define boolean variable, don't check whether Bison has
4440 ever examined the value. As written, the check was a tautology.
4441 Instead, record and check for this complaint using a separate muscle.
4442
eb1b0740
JD
44432007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4444
4445 Fix push parsing memory leak reported by Brandon Lucia at
4446 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4447 * THANKS: Add Brandon Lucia.
4448 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4449 but the parse never completed and thus freed it.
4450 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4451 * tests/testsuite.at: Include push.at.
4452 * test/push.at: New.
4453 (Push Parsing: Memory Leak for Early Deletion): New test case.
4454
9d774aff
JD
44552007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4456
4457 Improve handling of multiple S/R conflicts in the same state and of S/R
4458 conflicts involving multiple reductions.
4459 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4460 set for a state here or Bison will abort if it is reassigned on a
4461 later conflicted reduction in the same state.
4462 Similarly, don't finalize and assign the solved conflicts report here
4463 or it will be lost if it is reassigned on a later conflicted reduction
4464 in the same state.
4465 (set_conflicts): Instead, assign them both here after all S/R conflicts
4466 in the state have been fully examined.
4467 * src/print.c (shift_set): Rename to...
4468 (no_reduce_set): ... this.
4469 (print_reductions): Update for rename, and add %nonassoc error action
4470 tokens to no_reduce_set so that, when printing the first remaining
4471 reduction on an error action token, the reduction is enclosed in
4472 brackets.
4473 (print_results): Update for rename.
4474 * tests/conflicts.at (Solved conflicts report for multiple reductions
4475 in a state): New test case.
4476 (%nonassoc error actions for multiple reductions in a state): New test
4477 case.
4478
4479 * src/main.c (main): Don't depend on C99 features.
4480
10159d2a
JD
44812007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4482
4483 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
4484 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4485 uniwidth.
10159d2a 4486
953b3935
JD
44872007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4488
4489 * bootstrap (slurp): Create target directories that don't exist.
4490 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4491
6ce2d93a
JD
44922007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4493
4494 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4495 than item number.
4496 * closure.c (closure): Likewise.
4497 * state.h (reductions): Comment sorting of rules.
4498 (state): Comment sorting of items.
4499
ce3448d5
JD
45002007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4501
4502 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4503 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4504 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4505 definition in order to avoid Gnulib headers since we don't use config.h
4506 here.
4507 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4508 rather than AT_DATA so that config.h is included.
4509
8a86eef0
JD
45102007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4511
4512 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4513 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4514 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4515 and so that YYFPRINTF is guaranteed to be defined here.
4516
b1a81613
JD
45172007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4518
4519 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4520 with...
4521 (muscle_percent_define_check_values): ... this more helpful function.
4522 Again, it's not used yet, but it will be.
4523 * src/muscle_tab.h: Likewise.
4524
71b61d4d
JD
4525 Improve some comments in parser table construction.
4526 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4527 (generate_states): Don't mention ruleset, which is internal to closure.
4528 * src/closure.c (closure): Explain sorting of core and itemset, which
4529 is required for this function to behave correctly.
4530 * src/closure.h (closure): Mention sorting.
4531
2a6b783d
JD
45322007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4533
4534 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4535 move the check for disabled transitions to an aver since conflict
4536 resolution hasn't happened yet.
4537
4538 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4539 labels a state as inconsistent just because it has error transitions.
4540 The original form of this check appeared in revision 1.1 of lalr.c,
4541 which was committed on 1991-12-21. Now (at least), changing the
4542 consistency label on such a state appears to have no useful effect in
4543 any of the places it is examined, which I enumerate below. The key
4544 point to understanding each item in this enumeration is that a state
4545 with an error transition is labelled consistent in the first place only
4546 if it has no rules, so the check cannot matter for states that have
4547 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4548 to try to identify its conflicts, and a state must have *rules* to have
4549 conflicts. (2) Labelling a state as inconsistent will affect how
4550 action_row sets the default *rule* for the state. (3) Labelling a
4551 state as inconsistent will cause build_relations to add lookback edges
4552 to *rules* in that state.
4553 * src/state.h (struct state): Word the comment for member consistent
4554 more carefully.
4555
14462c2b
JD
45562007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4557
4558 Don't depend on C99 features.
4559 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4560 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4561 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4562 * src/state.c (state_mark_reachable_states): Fix for-loop.
4563 (state_remove_unreachable_states): Fix for-loop.
4564
4565 Don't widen struct state with member reachable just to temporarily
4566 record reachability. Instead, use a local bitset.
4567 * src/state.h (struct state): Remove member.
4568 * src/state.c (state_new): Don't initialize it.
4569 (state_mark_reachable_states): Rename to...
4570 (state_record_reachable_states): ... this, and use bitset.
4571 (state_remove_unreachable_states): Use bitset.
4572
5a43d418
JD
45732007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4574
4575 * src/Makefile.am (yacc): Quote target action commands properly so
4576 that the yacc script isn't corrupt. Reported by Hans Aberg at
4577 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4578
0c650a20
JD
4579 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4580 the case of pure parsers. Reported by Frans Englich at
4581 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4582 * THANKS: Add Frans Englich.
4583
61fee93e
JD
4584 * NEWS (2.3a+): In the %code entry, reference section `Bison
4585 Declaration Summary' from the manual now since the %code summary has
4586 moved there.
4587 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4588 in the rules section must be terminated by semicolons.
4589
f124d423
JD
45902007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4591
4592 Extend the front-end API for %define variables to more completely
4593 mirror the back-end. This will be useful in the future.
4594 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4595 Update comments to mention the new front-end counterparts of these
4596 macros.
4597 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4598 for muscle_string_decode and muscle_location_decode.
4599 (muscle_string_decode): New static function.
4600 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4601 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4602 functions.
4603 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4604 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4605 implementation more closely.
4606 (muscle_percent_define_invalid_value): New function.
4607 * src/muscle_tab.h (muscle_percent_define_get,
4608 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4609 Prototype.
4610
75ad86ee
JD
46112007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4612
4613 * NEWS (2.3a+): Mention yesterday's state-removal change.
4614 (2.3a): Remove the %language entry, which was added after 2.3a.
4615 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4616 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4617 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4618 tests/existing.at: Update copyright date.
4619
5967f0cf
JD
46202007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4621
4622 If conflict resolution makes states unreachable, remove those states,
4623 report rules that are then unused, and don't report conflicts in those
4624 states.
4625 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4626 New global function.
4627 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4628 function.
4629 * src/main.c (main): After conflict resolution, remove the unreachable
4630 states and update all data structures that reference states by number.
4631 * src/state.c (state_new): Initialize each state's reachable member to
4632 false.
4633 (state_mark_reachable_states): New static function.
4634 (state_remove_unreachable_states): New global function.
4635 * src/state.h (struct state): Add member bool reachable.
4636 (state_remove_unreachable_states): Prototype.
4637 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4638 New test case.
4639 * tests/existing.at (GNU pic Grammar): Update test case output now that
4640 an unused rule is discovered.
4641
b09f4f48
JD
46422007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4643
4644 Minor code cleanup in parser table construction.
4645 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4646 (new_itemsets, save_reductions): Update for rename to nitemset.
4647 * src/closure.c (nritemset): Rename to...
4648 (nitemset): ... this since the "r" appears to meaningless and isn't
4649 used in the comments.
4650 (closure): Update for rename.
4651 * src/closure.h (nritemset): Update extern to...
4652 (nitemset): ... this.
4653 * src/lalr.c (LA): Fix a typo in comments.
4654 * src/print.c (print_core): Update for rename to nitemset.
4655 * src/print_graph.c (print_graph): Likewise.
4656 * src/state.h: Fix some typos in header comments.
4657
bbb44d83
PE
46582007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4659
9b33de72
PE
4660 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4661 still sticks to ASCII. Sorry!
4662
bbb44d83
PE
4663 * README-hacking: New file, taken mostly from coreutils, with changes
4664 for Bison. Contains much of the contents of:
4665 * README-cvs: Remove.
4666 * bootstrap: Sync from gnulib.
4667 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4668 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4669
29553547
JD
46702007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4671
4672 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4673 Setzer.
4674 (Java Differences): Fix some typos.
4675 * THANKS: Add Sebastian Setzer.
4676
01b477c6
PB
46772007-03-07 Paolo Bonzini <bonzini@gnu.org>
4678
730739e4
AD
4679 * data/java.m4 (b4_single_class_if): Remove.
4680 (b4_abstract_if): Look at "%define abstract".
4681 (b4_lexer_if): New.
4682 (b4_union_name): Rename...
4683 (b4_yystype): ... to this. Map to "%define stype".
4684 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4685 b4_maybe_throws): Fix quoting.
4686 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4687 * data/lalr1.java (Lexer interface): Always define.
4688 (Lexer interface within parser class): Remove.
4689 (YYLexer class): New, used when "%code lexer" is present.
4690 (constructor): When "%code lexer" is used, pass %lex-param
4691 to the lexer constructor.
4692 (yylex, yyparse): Remove %lex-param from method invocations
4693 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4694
4695 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4696 abstract". Rename "%define union_name" to "%define stype".
4697 Rename method names according to previous patch.
4698 (Java Scanner Interface): Describe "%code lexer" instead of
4699 "%pure-parser" and "%define single_class".
4700 (Java Differences): Mention "%code lexer".
4701
4702 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4703 Include scanner here, using macros from tests/local.at.
4704 (AT_DATA_CALC_Y): Remove final argument.
4705 (_AT_CHECK_JAVA_CALC): Likewise.
4706 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4707 of %locations and %error-verbose.
4708 (main): Test with and without %lex-param.
4709 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4710 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 4711
122bea3a
JMG
47122007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4713
4714 DJGPP spefic issue. Inhibit the use of disallowed characters for
4715 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4716 and concern testsuite case 46.
4717 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4718 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4719 * djgpp/config.bat: Inhibit the use of disallowed characters.
4720
9611cfa2
JD
47212007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4722
4723 Miscellaneous %define and %code cleanup.
4724 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4725 values are interpreted.
4726 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4727 documentation a little more.
4728 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4729 muscle_percent_define_insert, muscle_percent_code_grow): New
4730 functions/macros.
4731 * src/muscle_tab.h (muscle_percent_define_insert,
4732 muscle_percent_code_grow): Prototype.
4733 * src/parse-gram.y (prologue_declaration): Use
4734 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4735 %define and %code directives.
4736
4737 Make it easy to share %define boolean variables between the front-end
4738 and back-end. Though not used yet, this will be useful in the future.
4739 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4740 Bison uses of names rather than just skeleton uses of names.
4741 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4742 b4_percent_define_skeleton_variables(VARIABLE) to
4743 b4_percent_define_bison_variables(VARIABLE).
4744 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4745 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4746 b4_percent_code_bison_qualifiers(QUALIFIER).
4747 (b4_check_user_names_wrap): Update for renames.
4748 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4749 muscle_percent_define_default): New functions mimicking
4750 b4_percent_define_flag_if and b4_percent_define_default.
4751
4752 For %define variables, report locations for invalid values and
bbb44d83 4753 redefinitions.
9611cfa2
JD
4754 * data/bison.m4 (b4_percent_define_flag_if): Read
4755 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4756 value for VARIABLE.
4757 (b4_percent_define_default): Save a special location in
4758 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4759 must later be reported as invalid.
4760 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4761 functions.
4762 (muscle_percent_define_insert): Record the location of VARIABLE in
4763 muscle percent_define_loc(VARIABLE), and use it to report the previous
4764 location for a redefinition.
4765 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4766 (muscle_percent_define_default): Update like b4_percent_define_default.
4767 (muscle_grow_user_name_list): Rename to...
4768 (muscle_user_name_list_grow): ... this for consistency and use
4769 muscle_location_grow.
4770 * src/muscle_tab.h (muscle_location_grow): Prototype.
4771 * tests/input.at (%define errors): Update expected output.
4772 * tests/skeletons.at (%define boolean variables: invalid skeleton
4773 defaults): New test case.
4774
0bf92491
JD
47752007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4776
4777 * src/print.c (lookahead_set, state_default_rule): Remove.
4778 (print_reductions): Replace state_default_rule invocation with
4779 equivalent use of yydefact, which was computed in token_actions in
4780 tables.c.
4781 (print_results): Don't allocate lookahead_set.
4782
d3b12988
PB
47832007-02-27 Paolo Bonzini <bonzini@gnu.org>
4784
4785 * data/lalr1.java: Prefix all private members with yy.
4786
f57a7536
JD
47872007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4788
4789 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 4790 Sebastien Fricker at
f57a7536 4791 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 4792 * THANKS: Add Sebastien Fricker.
f57a7536
JD
4793 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4794 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4795 accept a variable number of arguments.
4796
6404a5bf
JD
47972007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4798
4799 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4800
e4e09639
JMG
48012007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4802
4803 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4804 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4805 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4806
d7e0a1a7
PE
48072007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4808
4809 Undo my 2007-02-07 change, switching back to the c-strcase module
4810 introduced in the 2007-02-03 change. Bruno Haible reported that
4811 the 2007-02-07 change would be dangerous in Turkish if we add a
4812 language whose name contains "i", since "i" is not lowercase "I"
4813 in Turkish.
4814 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4815 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4816 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4817 * m4/.cvsignore: Remove strcase.m4.
4818 * src/getargs.c: Revert 2007-02-07 change, as follows.
4819 Include c-strcase.h.
4820 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4821
deee93a1
JD
48222007-02-11 Bruno Haible <bruno@clisp.org>
4823
4824 Enable the Java related testsuite tests when the only Java compiler
4825 found is a gcj < 4.3. Discussed at
4826 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4827 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4828
574add85
JD
48292007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4830
4831 * data/Makefile.am: Update copyright date.
4832 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4833 yypstate_new returns NULL.
4834 (yypstate_new): Return NULL if malloc does.
4835 * src/reader.c (packgram): Move translation of rule actions from the
4836 beginning of packgram to...
4837 (check_and_convert_grammar): ... here right before packgram is invoked
4838 so it's easier to write more complete comments, and remove redundant
4839 code.
4840
e785ccf7
JD
48412007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4842
4843 As in semantic actions, make @$ in %initial-action, %destructor, and
4844 %printer imply %locations.
4845 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4846 scanning @$.
4847 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4848 (@$ in %initial-action implies %locations,
4849 @$ in %destructor implies %locations,
4850 @$ in %printer implies %locations): ... these new test cases.
4851
1cfe1ed7
PE
48522007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4853
4854 Undo most of the 2007-02-03 change, switching to the strcase module
4855 now that gnulib strcase has been fixed.
4856 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4857 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4858 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4859 * m4/.cvsignore: Add strcase.m4.
4860 * src/getargs.c: Revert 2007-02-03 change, as follows.
4861 Don't include c-strcase.h.
4862 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4863 strcasecmp has "unspecified behavior" outside the POSIX locale,
4864 but it works fine in practice if at least one argument is ASCII,
4865 as is the case in Bison.
4866
0049ec86
PB
48672007-02-07 Paolo Bonzini <bonzini@gnu.org>
4868
4869 * tests/java.at: Skip tests if only one of javac/java is present.
4870 Reported by Joel E. Denny.
4871 * tests/atlocal.in: Adjust copyright years.
4872
48732007-02-05 Paolo Bonzini <bonzini@gnu.org>
4874
4875 * data/lalr1.java (Stack): Work around old verifiers that disallow
4876 access to the private fields of an inner class, from the outer class.
4877 We can make Stack's fields public because user code doesn't have access
4878 to the instance of Stack used by parse(). Reported by Paul Eggert.
4879
2c2b7220
PE
48802007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4883 the right spot for these files?
4884 * bootstrap.conf (gnulib_modules): Add c-strcase.
4885 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4886 c-strncasecmp.c.
4887 * src/getargs.c: Include c-strcase.h.
4888 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4889 to avoid unspecified behavior.
4890
b2b81dae
JD
48912007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4892
4893 * doc/bison.texinfo (Decl Summary): Correct typo.
4894
c1d19e10
PB
48952007-01-30 Paolo Bonzini <bonzini@gnu.org>
4896
4897 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4898 Complain if the value does not match empty, "true" or "false".
4899 * data/c++.m4: Adjust default definitions of %define variables.
4900 * data/java.m4: Adjust default definitions of %define variables.
4901 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4902 to above behavior.
4903 * tests/input.at (Boolean %define variables): Test new behavior.
4904
8405b70c
PB
49052007-01-29 Paolo Bonzini <bonzini@gnu.org>
4906
4907 * NEWS: Mention java.
4908 * TODO: Remove things that are done.
4909 * bootstrap.conf: Add javacomp-script and javaexec-script.
4910 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4911
4912 * data/Makefile.am: Add new files.
4913 * data/java-skel.m4: New.
4914 * data/java.m4: New.
4915 * data/lalr1.java: New.
4916
4917 * doc/bison.texinfo: Put "A Complete C++ Example" under
4918 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4919 under Other Languages.
4920
4921 * src/getargs.c (valid_languages): Add Java.
4922 * src/getargs.h (struct bison_language): Update size of string fields.
4923
4924 * tests/Makefile.am: Add java.at.
4925 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4926 * tests/java.at: New.
4927 * tests/testsuite.at: Include it.
4928
3eb82471
JD
49292007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4930
4931 Clean up.
4932 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4933 at_directive_argv arguments so these no longer have to be global
4934 variables. Also, update the implementation for the following changes.
4935 (fail_for_at_directive_too_many_args,
4936 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4937 (at_directive_name): Remove as at_directive_argv[0] will be used for
4938 this now.
4939 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4940 for the directive name.
4941 (at_directive_argc, at_directive_argv): Make these local within
4942 skel_lex instead of global.
4943 (INITIAL): Update directive start action for above changes.
4944 (SC_AT_DIRECTIVE_ARG): Rename to...
4945 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4946 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4947 (scan_skel): Move yylex_destroy to...
4948 (skel_scanner_free): ... here.
4949 * tests/skeletons.at (installed skeleton file name): Rename to...
4950 (installed skeleton file names): ... this.
4951
148d66d8
JD
49522007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4953
4954 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4955 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4956 Summary" not "Directives".
4957 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4958 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4959 since the former is now the more complete one.
4960 (Prologue Alternatives): Likewise and do the same for %defines.
4961 (Table of Symbols): Add summary of %code, add summary of %define, and
4962 move full %code documentation to...
4963 (Decl Summary): ... here for consistency with other entries in these
4964 sections.
4965 Move %define entry in order to keep this list alphabetized.
4966 Reword %define entry a little to put less emphasis on the skeleton
4967 concept, which most users shouldn't have to think about.
4968
665f0c24
PE
49692007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4970
4971 Adjust to recent gnulib changes.
4972 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4973 Add string.h, string_.h, unistd_.h, wchar_.h.
4974 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4975 * src/system.h: Don't include <stpcpy.h>; this is now done by
4976 <string.h>.
4977
592d0b1e
PB
49782007-01-23 Paolo Bonzini <bonzini@gnu.org>
4979
4980 Simplify implementation of unqualified %code, implement macros for
4981 uniform treatment of boolean %define flags. Document %define.
4982 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4983 b4_percent_code_ifdef): New.
4984 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4985 * data/c++.m4: Define default value for global_tokens_and_yystype.
4986 * data/glr.cc: Likewise.
4987 * data/location.cc: Use b4_percent_define_flag_if.
4988
148d66d8 4989 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
4990
4991 * src/parse-gram.y (Unqualified %code): Change muscle name to
4992 b4_percent_code().
4993 (content.opt): Default to empty.
4994
a7867f53
JD
49952007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4996
4997 Implement support for relative and absolute skeleton file names.
4998 Discussed starting at
4999 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5000 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5001 (Bison Options): Document in --skeleton entry.
5002 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5003 full_skeleton can't necessarily hold all of pkgdatadir.
5004 If the specified skeleton file name contains a `/', don't prepend
5005 pkgdatadir.
5006 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5007 file name contains a `/', prepend the grammar file directory.
5008 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5009 * skeletons.at: New file.
5010 (relative skeleton file names): New test case.
5011 (installed skeleton file names): New test case.
5012 * tests/testsuite.at: Include skeletons.at.
5013
5014 * bootstrap: Update copyright to 2007.
5015
830c9b18
PB
50162007-01-17 Paolo Bonzini <bonzini@gnu.org>
5017
5018 * bootstrap: Remove occurrences of .#bootmp from the files.
5019
a8c2e813
AD
50202007-01-17 Akim Demaille <akim@epita.fr>
5021
5022 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5023 nonterminals.
5024 Use per-type %printer.
5025
279cabb6
JD
50262007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5027
5028 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5029 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5030 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5031 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5032 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5033 tests/glr-regression.at, tests/input.at, tests/local.at,
5034 tests/output.at, tests/torture.at: Update copyright to 2007.
5035
bb32f4f2
AD
50362007-01-16 Akim Demaille <akim@epita.fr>
5037
5038 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5039 error code.
5040 (Calc++ Scanner): Exit with failure if we can't open the input
5041 file.
5042 Accept "-" standing for stdin.
5043 (Calc++ Top Level): Print the result only if the parsing was
5044 successful.
5045
7cff04b5
AD
50462007-01-16 Akim Demaille <akim@epita.fr>
5047
5048 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5049
a4e25e1d
JD
50502007-01-15 Paolo Bonzini <bonzini@gnu.org>
5051 and Joel E. Denny <jdenny@ces.clemson.edu>
5052
5053 Clean up %define and %code implementation in M4 some. Most
5054 importantly, rename all related macros to be in the b4_percent_define
5055 and b4_percent_code namespaces. Also, complete support for `.' in
5056 %define variable names and %code qualifiers.
5057 * data/bison.m4 (b4_check_user_names): Check for special
5058 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5059 m4_foreach loops.
5060 (b4_get_percent_define, b4_get_percent_code): Rename to...
5061 (b4_percent_define_get, b4_percent_code_get): ... these.
5062 Extend documentation with examples.
5063 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5064 b4_percent_define_skeleton_variables and
5065 b4_percent_code_skeleton_qualifiers.
5066 Expect any value for the %define variable `foo' to be stored in the
5067 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5068 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5069 expect any unqualified %code blocks to be stored in a macro named
5070 `b4_percent_code_unqualified'.
5071 Use m4_indir so that %define variable names and %code qualifiers can
5072 contain `.', which is allowed by the grammar parser.
5073 (b4_percent_define_default): New macro to set a default value for a
5074 %define variable.
5075 (m4_wrap): Update wrapped code, and fix some underquoting.
5076 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5077 Expect grammar uses of %define variables and %code qualifiers to be
5078 defined in b4_percent_define_user_variables and
5079 b4_percent_code_user_qualifiers.
5080 * data/c++.m4: Use b4_percent_define_default rather than
5081 m4_define_default. Fix some underquoting. Skeleton usage of %define
5082 variable define_location_comparison now implies skeleton usage of
5083 %define variable filename_type.
5084 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5085 data/push.c, data/yacc.c: Update macro names.
5086 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5087 muscle names.
5088
e37c665c
JMG
50892007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5090
5091 DJGPP specific issues.
5092
5093 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5094 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5095
7d2d521f
JD
50962007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5097
5098 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5099 run parsers in all tests so that Valgrind is invoked during
5100 maintainer-check-valgrind.
5101 (Duplicate representation of merged trees): Free all semantic values.
5102 (Duplicated user destructor for lookahead): Likewise.
5103
e0ac9b4b
JD
51042007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5105
5106 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5107 command-line prefix.
5108 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5109 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5110 miss Valgrind messages.
5111 (Exploding the Stack Size with Malloc): Likewise.
5112
78143faa
JD
51132007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5114
5115 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5116 locals. Reported by Juan Manuel Guerrero at
5117 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5118 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5119 Fix some indentation also.
5120 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5121 explaining this issue.
5122
7ecec4dd
JD
51232007-01-09 Paolo Bonzini <bonzini@gnu.org>
5124 and Joel E. Denny <jdenny@ces.clemson.edu>
5125
5126 Simplify union and prologue handling, and escape union and lex/parse
5127 params with digraphs.
5128 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5129 values to the empty string since these are no longer guaranteed
5130 initialized by the front-end.
5131 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5132 braces around b4_user_stype since this is no longer done by the
5133 front-end.
5134 * src/files.c, src/files.h (pre_prologue_obstack,
5135 post_prologue_obstack): Remove.
5136 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5137 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5138 with digraphs. This fixes lex params and parse params.
5139 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5140 * src/output.c (prepare): Remove muscle insertion of the prologues.
5141 (output): Remove freeing of pre_prologue_obstack and
5142 post_prologue_obstack.
5143 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5144 than prologue_augment for prologue parsing so you don't need prologue
5145 obstacks.
5c80250c
JD
5146 (grammar_declaration): For %union RHS, use `braceless' instead of
5147 "{...}" so that braces are already stripped and code is escaped with
5148 digraphs.
7ecec4dd
JD
5149 * src/reader.c (prologue_augment): Remove.
5150 (reader): Remove initialization of pre_prologue_obstack and
5151 post_prologue_obstack.
5152 * src/reader.h (prologue_augment): Remove.
5153
5154 * data/c.m4: Remove stray parenthesis.
5155
16dc6a9e
JD
51562007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5157
5158 Remove quotes from variables names in %define directives and from
5159 qualifiers in %code directives, and restrict the characters that are
5160 allowed in them to M4-friendly ones. For %define, continue to support
5161 the quoted form as a deprecated feature. Discussed starting at
5162 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5163 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5164 %code.
5165 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
5166 (Decl Summary): In %defines entry, update mention of `%code requires'
5167 and `%code provides'.
16dc6a9e
JD
5168 (C++ Location Values): Update %define uses.
5169 (Calc++ Parser Interface): Likewise.
5170 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 5171 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5172 * src/parse-gram.y (prologue_declaration): For %define variables, use
5173 `variable' instead of `STRING'.
5174 (grammar_declaration): For %code qualifiers, use `ID' instead of
5175 `STRING'.
5176 (variable): New nonterminal that takes an `ID' or a `STRING'.
5177 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5178 and %define uses.
5179 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5180 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5181 (%define errors): Update %define uses.
5182
e9813cd4
JD
51832007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5184
5185 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5186 instead of muscle_insert for %define values so that M4-special
5187 characters are replaced with digraphs.
5188 * tests/input.at (%define errors): Extend to check weird values.
5189
6afc30cc
JD
51902007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5191
5192 Instead of having skeletons declare all valid %define variables and
5193 %code qualifiers, provide macros that retrieve the associated values
5194 and build these lists automatically. Thus Bison will now warn when a
5195 variable or qualifier is not used by the skeleton in the current
5196 invocation regardless of whether it might sometimes be used by that
5197 skeleton in other invocations. Also, move all %define value macros to
5198 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5199 form, which is replaced by %code.
5200 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5201 (b4_check_user_names): ... this, and change the series of valid name
5202 arguments to a single list argument for names used in the skeleton
5203 similar to the existing list argument for names used in the grammar.
5204 Warn instead of complaining.
5205 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5206 values and %code code, to format %code code properly, and to build
5207 lists of all %define variables and %code qualifiers used in the
5208 skeleton: b4_skeleton_percent_define_variables and
5209 b4_skeleton_percent_code_qualifiers.
5210 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5211 Remove, and...
5212 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5213 the skeleton names lists can finish building first. In place of
5214 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5215 expect the lists b4_user_percent_define_variables and
5216 b4_user_percent_code_qualifiers.
5217 * data/c++.m4: Where setting default values for b4_parser_class_name,
5218 b4_location_type, b4_filename_type, b4_namespace, and
5219 b4_define_location_comparison, update their names to the
5220 b4_percent_define_ namespace.
5221 * data/glr.c: Don't use b4_check_percent_define_variables and
5222 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5223 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5224 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5225 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5226 * data/location.cc: Use b4_get_percent_define.
5227 * data/push.c: Don't use b4_check_percent_define_variables and
5228 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5229 * data/yacc.c: Likewise, and don't call m4_exit in
5230 b4_use_push_for_pull_if or m4_wrap code will never execute.
5231 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5232 Rename to...
5233 (muscle_grow_user_name_list): ... this for consistency with the
5234 terminology used in bison.m4.
5235 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5236 %define variable names, and rename muscle used_percent_define_variables
5237 to user_percent_define_variables.
5238 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5239 user_percent_code_qualifiers.
5240 (content): Remove.
5241 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5242 {CODE} form is no longer accepted.
5243 * tests/input.at (Reject bad %code qualifiers): Rename to...
5244 (Reject unused %code qualifiers): ... this, and update test output.
5245 (%define error): Update test output.
5246
7eb8a0bc
JD
52472007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5248
5249 Check for unrecognized %define variables similar to checking for
5250 unrecognized %code qualifiers. Check for redefined %define variables.
5251 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5252 generalizes...
5253 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5254 (b4_check_percent_define_variables): New, also wraps it.
5255 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5256 variables using b4_check_percent_define_variables.
5257 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5258 all those exercised in the test suite and all those listed in the
5259 `Default values' section of c++.m4. Are there others?
5260 * data/push.c, data/yacc.c: Declare no valid %define variables.
5261 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5262 similar to muscle_find, but it works even when the muscle stores a
5263 const value.
5264 (muscle_grow_used_name_list): New function for constructing the used
5265 name list muscles that b4_check_for_unrecognized_names requires.
5266 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5267 %define'd more than once. Define the b4_used_percent_define_variables
5268 muscle with muscle_grow_used_name_list.
5269 (grammar_declaration): Abbreviate %code code with
5270 muscle_grow_used_name_list.
5271 * tests/input.at (%define errors): New.
5272
3fc65ead
JD
52732007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5274
5275 Provide warn_at, complain_at, and fatal_at function callbacks to the
5276 skeletons, and use this for %code qualifier complaints.
5277 * data/bison.m4 (b4_error_at): New, invoked by...
5278 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5279 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5280 @fatal_at(...@) directives.
5281 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5282 qualifiers in b4_used_percent_code_qualifiers and to use
5283 b4_complain_at.
5284 * src/location.c, src/location.h (boundary_set_from_string): New global
5285 function.
5286 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5287 function.
5288 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5289 to b4_used_percent_code_qualifiers.
5290 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5291 function.
5292 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5293 (lineno): Rename to...
5294 (out_lineno): ... this so I don't misunderstand it again.
5295 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5296 here; these newlines are in the input but not the output file.
5297 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5298 (at_directive_perform): ... this new static function, and add handling
5299 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5300 directives.
5301 * tests/input.at (Reject bad %code qualifiers): Update test output with
5302 locations and extend.
5303
5304 * tests/output.at (Output file name: [, Output file name: ]): Remove
5305 bogus comment about these tests failing.
5306
1c7b7e1d
JD
53072007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5308
5309 Clean up b4_check_percent_code_qualifiers a little.
5310 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5311 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5312 documentation and add examples.
5313 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5314 qualifiers here.
5315
08af01c2
JD
53162007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5317
5318 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5319 unreliable -- especially when they're hidden inside another macro.
5320 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5321 data/c.m4: Remove m4_divert(-1).
5322 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5323 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5324 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5325 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5326 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5327 pushed and popped by m4sugar, should be first on the stack.
5328
5329 Provide warn, complain, and fatal function callbacks to the skeletons.
5330 This provides more flexibility than m4_fatal, improves the error
5331 message format, and captures messages for translation. Discussed
5332 starting at
5333 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5334 * data/bison.m4 (b4_error): New, invoked by...
5335 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5336 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5337 directives. Because these M4 macros might be called when the current
5338 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5339 the previous removal of uses of m4_divert, which caused trouble.
5340 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5341 m4_fatal to report unrecognized %code qualifiers.
5342 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5343 push parser requests.
5344 * data/glr.c: Use b4_complain instead of m4_fatal to report
5345 non-deterministic push parser requests.
5346 Update @output usage to @output(...@) form.
5347 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5348 report missing %defines. Update @output usage to @output(...@) form.
5349 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5350 @output(...@) form.
5351 * src/main.c (main): Invoke skel_scanner_free.
5352 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5353 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5354 obstack_for_string from flex-scanner.h.
5355 (YY_DECL): Use to declare skel_lex static.
5356 (decode_at_digraphs): Remove; now handled in the new
5357 SC_AT_DIRECTIVE_ARG start condition.
5358 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5359 functions.
5360 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5361 at_directive_argv): New static globals.
5362 (INITIAL): Use fail_for_invalid_at.
5363 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5364 recognize the start of a generalized `@directive(...@)' form and
5365 start...
5366 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5367 directive args (using the new obstack_for_string), to decode the
5368 contained @ diagraphs, and to perform the directive. It recognizes
5369 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5370 @output(...@).
5371 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5372 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5373 `@,'.
5374 (scan_skel): Initialize obstack_for_string on the first call.
5375 (skel_scanner_free): New function to free obstack_for_string.
5376 * tests/input.at (Reject bad %code qualifiers): Update test output.
5377
8e0a5e9e
JD
53782007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5379
5380 Consolidate the 4 prologue alternative directives (%code, %requires,
5381 %provides, and %code-top) into a single %code directive with an
5382 optional qualifier field. Discussed at
5383 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5384 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5385 alternatives.
5386 * doc/bison.texinfo (Prologue Alternatives): Update.
5387 (Decl Summary): Update to %code "requires" and %code "provides".
5388 (Calc++ Parser): Update to %code "requires".
148d66d8 5389 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
5390 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5391 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5392 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5393 which are skeleton-specific.
5394 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5395 declare what %code qualifiers it supports and to complain if any other
5396 qualifiers were used in the grammar.
5397 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5398 and b4_user_code([b4_percent_code_provides]) in place of
5399 b4_user_requires and b4_user_provides.
5400 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5401 Add b4_user_code([b4_percent_code_top]) and
5402 b4_user_code([b4_percent_code]).
5403 Invoke b4_check_percent_code_qualifiers.
5404 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5405 PERCENT_REQUIRES): Remove.
5406 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5407 %requires. Rewrite the %code RHS as the unqualified form defining the
5408 muscle b4_percent_code. Add another RHS for the qualified %code form,
5409 which defines muscles of the form b4_percent_code_QUALIFIER and the
5410 b4_used_percent_code_qualifiers muscle.
5411 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5412 PERCENT_REQUIRES): Remove.
5413 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5414 %code "requires" and %code "provides".
5415 * tests/input.at (Reject bad %code qualifiers): New.
5416
95021767
JD
54172007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5418
5419 Use the new code_props interface for destructors and printers.
5420 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5421 printer_location members, and change the type of the destructor and
5422 printer members to code_props.
5423 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5424 symbol_printer_get, semantic_type_destructor_set,
5425 semantic_type_printer_set, default_tagged_destructor_set,
5426 default_tagless_destructor_set, default_tagged_printer_set,
5427 default_tagless_printer_set): Use code_props in arguments and return
5428 types in place of char const * and location.
5429 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5430 since the locations are now contained in the return of
5431 symbol_destructor_get and symbol_printer_get.
5432 * src/output.c (symbol_destructors_output, symbol_printers_output):
5433 Replace with...
5434 (symbol_code_props_output): ... this to eliminate duplicate code.
5435 (output_skeleton): Update to use symbol_code_props_output.
5436 * src/reader.c (symbol_should_be_used): Update use of
5437 symbol_destructor_get.
5438 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5439 Update uses of the various _destructor_set and _printer_set functions.
5440 * src/symtab.c: (default_tagged_destructor_location,
5441 default_tagless_destructor_location, default_tagged_printer_location,
5442 default_tagless_printer_location): Remove since we...
5443 (default_tagged_destructor, default_tagless_destructor,
5444 default_tagged_printer, default_tagless_printer): ... change the type
5445 of these to code_props.
5446 (symbol_new, semantic_type_new, symbol_destructor_set,
5447 semantic_type_destructor_set, symbol_destructor_get,
5448 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5449 symbol_check_alias_consistency, default_tagged_destructor_set,
5450 default_tagless_destructor_set, default_tagged_printer_set,
5451 default_tagless_printer_set): Update.
5452 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5453 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5454 code_props members.
5455 (symbol_print): Use SYMBOL_CODE_PRINT.
5456
f6857bbf
JD
54572007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5458
5459 Use the new code_props interface for rule actions.
5460 * src/symlist.h (symbol_list): Replace action, action_location, and
5461 used members with a code_props action_props member.
5462 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5463 grammar_midrule_action, grammar_current_rule_merge_set,
5464 grammar_current_rule_symbol_append, packgram): Update.
5465 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5466 * src/scan-code.l (handle_action_dollar): Update.
5467 (translate_rule_action): Remove, no longer used.
5468 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5469
7c0c6181
JD
54702007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5471
5472 Use the new code_props interface in parse-gram.y.
5473 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5474 Update all uses of translate_* functions to use the new code_props
5475 interface and to use gram_scanner_last_string_free and
5476 code_scanner_last_string_free where possible.
5477 (grammar_declaration): symbol_list_destructor_set and
5478 symbol_list_printer_set now perform the translation, so don't do it
5479 here. Use gram_scanner_last_string_free where possible.
5480 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5481 translate_code): Remove, no longer used.
5482 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5483 symbol_list_printer_set): Perform code translation here rather than
5484 depending on the caller to do so.
5485
5486 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5487 * src/scan-gram.h (gram_last_string): Remove declaration.
5488 * src/scan-gram.l (last_string): Declare it static.
5489
28e52c0d
JD
54902007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5491
5492 Encapsulate code properties and related functionality for the various
5493 destructors, printers, and actions into a code_props structure and
5494 interface. This patch merely implements code_props in scan-code.h and
5495 scan-code.l. Future patches will rewrite other modules to use it.
5496 Discussed starting at
5497 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5498 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5499 consistently initialize const structs that have an empty location
5500 field.
5501 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5502 to ensure consistency.
5503 * src/scan-code.h (code_props): New structure.
5504 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5505 function, macro, and const global variable for initializing a
5506 code_props with no code.
5507 (code_props_plain_init, code_props_symbol_action_init,
5508 code_props_rule_action_init, code_props_translate_code): The rest of
5509 the new code_props functional interface. Among other things, the init
5510 functions set the code_props kind field so that
5511 code_props_translate_code will know whether to behave like
5512 translate_symbol_action, translate_rule_action, or translate_code.
5513 These old translate functions must remain until all other modules are
5514 updated to use the new code_props interface.
5515 (code_scanner_last_string_free): New function similar to
5516 gram_scanner_last_string_free.
5517 (code_scanner_free): Add documentation.
5518 * src/scan-code.l: Implement the new interface.
5519 (code_lex): Make it static, add a code_props* argument, and remove the
5520 rule argument.
5521 (last_string): New static global similar to the one in scan-gram.l.
5522 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5523 instead of rule.
5524 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5525 code_props since Bison may one day use this information for destructors
5526 and printers.
5527 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5528 (handle_action_dollar): Use symbol_list_n_get and set used flag
5529 directly since symbol_list_n_used_set is removed.
5530 (translate_action): Add a code_props* argument and remove the rule,
5531 action, and location arguments. Pass the code_props* on to code_lex.
5532 (translate_rule_action, translate_symbol_action, translate_code):
5533 Rewrite as wrappers around the new code_props interface.
5534 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5535 it would eventually need to break the encapsulation of code_props.
5536
96034983
JD
55372007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5538
5539 * etc/.cvsignore: New.
5540
945e396c
JD
55412007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5542
5543 Add maintainer-push-check to run maintainer-check using push parsing in
5544 place of pull parsing where available.
5545 * Makefile.am (maintainer-push-check): New.
5546 * data/bison.m4 (b4_use_push_for_pull_if): New.
5547 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5548 appropriately based on their existing values.
5549 (yypush_parse): Don't print push-parser-specific diagnostics if push
5550 parsing is being used in place of pull parsing.
5551 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5552 push.c.
5553 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5554 variable, and insert b4_use_push_for_pull_flag into muscles.
5555 * tests/Makefile.am (maintainer-push-check): New.
5556
7d596384
JD
55572006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5558
5559 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5560 (whether successful or failed) so that yypush_parse can be invoked
5561 again to start a new parse using the same yypstate.
5562 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5563 check multiple yypull_parse invocations on the same yypstate. For pull
5564 mode, extend to check multiple yyparse invocations.
5565 (Exploding the Stack Size with Alloca): Extend to try with
5566 %push-pull-parser.
5567 (Exploding the Stack Size with Malloc): Likewise.
5568
5569 * tests/calc.at (Simple LALR Calculator): Don't specify
5570 %skeleton "push.c" since %push-pull-parser implies that now.
5571 * tests/headers.at (export YYLTYPE): Don't check for the push
5572 declarations. Otherwise, this test case can't be used to see if push
5573 mode can truly emulate pull mode.
5574 * tests/input.at (Torturing the Scanner): Likewise.
5575 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5576 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5577 AT_YACC_IF, which now includes the case of push mode since %skeleton
5578 need not be used for push mode. This will be more intuitive once
5579 push.c is renamed to yacc.c.
5580
7172e23e
JD
55812006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5582
5583 For push mode, convert yyparse from a macro to a function, invoke yylex
5584 instead of passing a yylexp argument to yypull_parse, and don't
5585 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5586 Discussed starting at
5587 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5588 * data/bison.m4 (b4_pull_if): New.
5589 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5590 * data/push.c: Improve M4 quoting a little.
5591 (b4_generate_macro_args, b4_parenthesize): Remove.
5592 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5593 any time a pull parser is requested.
5594 Don't #define this as a wrapper around yypull_parse. Instead, when
5595 both push and pull are requested, make it a function that does that
5596 same thing.
5597 (yypull_parse): If there's a b4_prefix, #define this to
5598 b4_prefix[pull_parse] when both push and pull are requested.
5599 Don't define this as a function unless both push and pull are
5600 requested.
5601 Remove the yylexp argument and hard-code yylex invocation instead.
5602 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5603 %push-parser.
5604 * src/getargs.c (pull_parser): New global initialized to true.
5605 * getargs.h (pull_parser): extern it.
5606 * src/output.c (prepare): Insert pull_flag muscle.
5607 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5608 (prologue_declaration): Set both push_parser and pull_parser = true for
5609 %push-pull-parser. Set push_parser = true and pull_parser = false for
5610 %push-parser.
5611 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5612 %push-parser since there's no backward-compatibility concern here.
5613 Scan %push-pull-parser.
5614 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5615 instead of %push-parser.
5616 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5617 prototype it in the module that calls yyparse.
5618 * tests/input.at (Torturing the Scanner): Likewise.
5619 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5620
2e7944cb
JD
56212006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5622
5623 Update etc/bench.pl. Optimize push mode a little (the yyn change
5624 deserves most of the credit).
5625 * Makefile.am (SUBDIRS): Add etc subdirectory.
5626 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5627 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5628 yytoken, yyval, and yyloc declarations to...
5629 (yyparse or yypush_parse): ... here to improve performance. For
5630 yypush_parse invocations after the first, be sure to assign yyn its old
5631 value again.
5632 (yypstate_new): Don't bother initializing the yyresult field since the
5633 initial value isn't used.
5634 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5635 remove the #define that, in push mode, set it to yyps->NAME.
5636 * etc/Makefile.am: New.
5637 * etc/bench.pl: Remove and build it instead from...
5638 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5639 "tests/bison" from the build directory by default rather than just
5640 invoking "bison" from $PATH.
5641 (calc_grammar): Update push parser code: don't declare yylval globally,
5642 don't define yyparse_wrapper, and don't #define yyparse.
5643 (bench_grammar): Update to check all working combinations of yacc.c,
5644 push.c, impure, pure, pull, and push.
5645
c3d50342
JD
56462006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5647
5648 For push mode, add pull wrappers around yypush_parse.
5649 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5650 (yypull_parse): New function wrapping yypush_parse.
5651 (yyparse): New #define wrapping yypull_parse.
5652 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5653 is declared.
5654 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5655 prototype yylex in the module that calls yyparse, and don't prototype
5656 yyparse there. Otherwise, the yyparse expansion won't compile.
5657 * tests/input.at (Torturing the Scanner): Likewise.
5658
94ebeba5
JD
56592006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5660
5661 Enable push parsers to operate in impure mode. Thus, %push-parser no
5662 longer implies %pure-parser. The point of this change is to move
5663 towards being able to test the push parser code by running the entire
5664 test suite as if %push-parser had been declared.
5665 * data/push.c (yypush_parse): For impure mode, remove the
5666 yypushed_char, yypushed_val, and yypushed_loc arguments.
5667 Instead, declare these as local variables initialized to the global
5668 yychar, yylval, and yylloc.
5669 For the first yypush_parse invocation only, restore the initial values
5670 of these global variables when it's time to read a token since they
5671 have been overwritten.
5672 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5673 %push-parser.
5674 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5675 %pure-parser along with %push-parser since this test case was designed
5676 for pure push parsers.
5677 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5678 (AT_YACC_OR_PUSH_IF): New.
5679 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5680 add a note that it's still wrong for some cases (as it has been for a
5681 while).
5682 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5683 %push-parser no longer implies %pure-parser.
5684
a0633178
JD
56852006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5686
5687 Remove some unnecessary differences between the pull parser code and
5688 the push parser code. This patch enables yynerrs in push mode.
5689 * data/push.c: Reformat M4 a little.
5690 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5691 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5692 because push mode is on. Instead, if pure mode is on, move yynerrs
5693 to...
5694 (b4_declare_parser_state_variables): ... here.
5695 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5696 to yyps->NAME so it can be used in yypush_parse.
5697 (yypush_parse): Don't omit uses of yynerrs in push mode.
5698
8646b6a3
JD
56992006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5700
5701 Fix bug such that the first pushed token's value and location are
5702 sometimes overwritten (sometimes by %initial-action) before being used.
5703 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5704 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5705 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5706 more closely mimic the pull parser logic.
5707 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5708 time to read a token, which is after any initialization of yylval and
5709 yylloc.
5710 (gottoken): Rename label to...
5711 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5712 user namespace.
5713
9baf4d74
JD
57142006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5715
5716 Rearrange initialization of the parser state variables so that the
5717 skeleton doesn't have to have a copy for pull mode and another for push
5718 mode. This patch also fixes at least a bug such that yylloc was not
5719 initialized (with b4_location_initial_line and
5720 b4_location_initial_column) upon calling yypush_parse. However, that
5721 initialization now overwrites the first token's location;
5722 %initial-action assigning @$ already did the same thing, and both bugs
5723 will be fixed in a later patch.
5724 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5725 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5726 yyss, yyvs, yyls, and yystacksize.
5727 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5728 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5729 yylsp.
5730 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5731 yyps->NAME so it can be used in yypush_parse.
5732 (yyparse or yypush_parse): For yypush_parse, don't print the
5733 "Starting parse" diagnostic for invocations after the first.
5734 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5735 yypush_parse, only do it for the first invocation.
5736 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5737 initialization to occur in yypush_parse but only on the first
5738 invocation.
5739
23522164
JD
57402006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5741
5742 * data/push.c: Add CPP guards around push parser declarations in both
5743 the header and the code file.
5744 In the code file, move the push parser declarations to the same place
5745 they appear in the header file.
5746 Clean up the M4 some, especially the inconsistent underquoting in
5747 some b4_c_function_def and b4_c_function_decl uses.
5748
bb010fe5
JD
57492006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5750
5751 Encapsulate the push parser state variables into an M4 macro so the
5752 push skeleton doesn't have to list them again for pull mode's yyparse.
5753 For push mode, remove yypush_parse's local equivalents of these
5754 variables to eliminate unnecessary copying between the two sets at
5755 run-time. This patch also fixes at least a bug related to multiple
5756 %initial-action invocations in push mode.
5757 * data/push.c (b4_declare_parser_variables): Rename to...
5758 (b4_declare_scanner_communication_variables): ... this for clarity and
5759 update both uses.
5760 (b4_declare_yyparse_variables): Remove and move its contents to the one
5761 spot where it was invoked.
5762 (b4_declare_parser_state_variables): New macro containing the parser
5763 state variables required by push mode.
5764 (struct yypstate): Replace all fields but yynew with
5765 b4_declare_parser_state_variables.
5766 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5767 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5768 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5769 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5770 parser state variable declarations with
5771 b4_declare_parser_state_variables.
5772 Don't initialize parser state variables when calling yypush_parse since
5773 yypstate_new already does that.
5774 Invoke the user's initial action only upon the first yypush_parse
5775 invocation.
5776 Remove all code that copies between the local parser state variables
5777 and the yypstate.
5778
2d212f8c
JD
57792006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5780
5781 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5782 prevent a name collision in a future patch where these names will
5783 sometimes be #define'd.
5784 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5785 since it no longer has the same name as the existing argument.
5786 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5787
e6e704dc
JD
57882006-12-19 Paolo Bonzini <bonzini@gnu.org>
5789 and Joel E. Denny <jdenny@ces.clemson.edu>
5790
5791 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5792 that the argument is case-insensitive, and there's no `=' here.
5793 For the %skeleton entry, mention that %language is better.
5794 (Bison Options): Likewise for --language and --skeleton. Move the
5795 --skeleton entry so that the `Tuning the parser' section is sorted
5796 alphabetically on long options.
5797 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5798 %language directive in detail here; cross-reference the %language
5799 documentation instead.
5800 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5801 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 5802 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
5803 * examples/extexi (normalize): Instead of replacing every %require
5804 argument with the current Bison version, just substitute for
5805 `@value{VERSION}'. This guarantees that we're testing what actually
5806 appears in the documentation.
5807 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5808 rather than `@VERSION@'.
5809
0e021770
PE
58102006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5811
fd575f05
PE
5812 * NEWS: Reword the %language news a bit, and put it earlier.
5813
0e021770
PE
5814 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5815 Rewrite to simplify the logic.
5816 (language_argmatch): Likewise.
fd575f05
PE
5817 (program_name): We now own this var.
5818 * src/getargs.h (struct bison_language): Use char[] rather than
5819 const char *.
0e021770
PE
5820
5821 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5822 Java is supported.
5823 * src/complain.c (program_name): Remove decl; no longer needed.
5824 * src/main.c (program_name): Remove; now belongs to getargs.
5825
58262006-12-18 Paolo Bonzini <bonzini@gnu.org>
5827
5828 * NEWS: Document %language.
5829
5830 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5831
5832 * data/c-skel.m4, data/c++-skel.m4: New files.
5833 * data/glr.c: Complain on push parsers.
5834
5835 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5836 over %skeleton.
148d66d8 5837 (Decl Summary): Document %language and %skeleton.
0e021770
PE
5838 (Command line): Document -L.
5839
5840 * examples/extexi: Rewrite %require directive.
5841 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5842
5843 * src/files.c (compute_exts_from_gc): Look in language structure
5844 for .y extension.
5845 (compute_file_name_parts): Check whether .tab should be added.
5846 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5847 (language, skeleton_arg, language_argmatch): New.
5848 (long_options): Add --language.
5849 (getargs): Use skeleton_arg, add -L/--language.
5850 * src/getargs.h: Include location.h.
5851 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5852 * src/output.c (prepare): Pick default skeleton from struct language.
5853 Don't dispatch C skeletons here.
5854 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5855 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5856 * src/scan-gram.l ("%language"): New rule.
5857
5858 * tests/calc.at: Test %skeleton and %language.
5859 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5860 (AT_GLR_IF): Look for %skeleton "glr.cc".
5861 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5862 (AT_YACC_IF): Reject %language.
5863
5691bf57
PE
58642006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5865
db06f0ce
PE
5866 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5867 since it wasn't used; only the typedef name 'semantic_type' is needed.
5868 Also, omit trailing white space.
5869
5691bf57
PE
5870 * bootstrap: Sync from coreutils.
5871 (gnulib_extra_files): Add build-aux/announce.gen.
5872 (slurp): Adjust .gitignore files like .cvsignore files.
5873 * build-aux/announce-gen: Remove from CVS, since bootstrap
5874 now creates this.
5875
791934e4
JD
58762006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5877
5878 Make %push-parser imply %pure-parser. This fixes several bugs; see
5879 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5880 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5881 pure_parser = true.
5882 * data/push.c: Don't bother testing b4_push_if when deciding whether
5883 to expand b4_declare_parser_variables globally.
5884 (yypush_parse): Likewise in here.
5885
5886 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5887 (yy_reduce_print): Reformat M4 for readability.
5888
ee5abb37
JD
58892006-12-15 Bob Rossi <bob@brasko.net>
5890 and Joel Denny <jdenny@ces.clemson.edu>
5891
5892 * data/push.c (yypstate): Add typedef, and update all uses of
5893 struct yypstate to just yypstate.
5894 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5895
16ca01f9
JD
58962006-12-14 Bob Rossi <bob@brasko.net>
5897
5898 * data/push.c (yypush_parse): Declare prototype regardless of
5899 %locations option.
5900
ab8e7e1a
JD
59012006-12-14 Bob Rossi <bob@brasko.net>
5902
5903 * data/push.c (yyparse): Remove the prototype and the #define when in
5904 push-parser mode.
5905
9bf32be3
JD
59062006-12-13 Bob Rossi <bob@brasko.net>
5907
5908 * data/push.c (yypstate_init): Rename to...
5909 (yypstate_new): ... this and use b4_c_function_def.
5910 (yypstate_delete): New.
5911 (yypush_parse): Change parameters yynval and yynlloc to be const.
5912 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5913 yypstate_delete functions.
5914
f02e2948
JD
59152006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5916
5917 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5918 strange test case titles. Reported by Bob Rossi.
5919
38eb7751
PE
59202006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5921
5922 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5923 of potential ambiguities in GLR grammers.
5924
bd9d212b
JD
59252006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5926
5927 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5928 `bison ', use m4_index instead of m4_substr since chopping up a string
5929 containing M4-special characters causes problems here.
5930
5931 Fix a couple of bugs related to special characters in user-specified
5932 file names, and make it easier for skeletons to compute output file
5933 names with the same file name prefix as Bison-computed output file
5934 names.
5935 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5936 b4_parser_file_name and b4_spec_defines_file instead of
5937 @output_parser_name@ and @output_header_name@, which are now redundant.
5938 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5939 b4_parser_file_name, b4_spec_defines_file, and the new
5940 @basename(FILENAME@) instead of @output_parser_name@ and
5941 @output_header_name@, which inappropriately escaped the file names as
5942 C string literals.
5943 * src/files.c (all_but_ext): Remove static qualifier.
5944 (compute_output_file_names): Move `free (all_but_ext)' to...
5945 (output_file_names_free): ... here since all_but_ext is needed later.
5946 * src/files.h (all_but_ext): Extern.
5947 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5948 exactly what MUSCLE_INSERT_STRING used to do.
5949 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5950 characters are escaped properly.
5951 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5952 all_but_ext.
5953 For pkgdatadir muscle, maintain previous functionality by using
5954 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5955 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5956 digraphs would never be expanded. Hopefully no one has M4-special
5957 characters in his Bison installation path.
5958 * src/scan-skel.l: Don't parse @output_header_name@ and
5959 @output_parser_name@ anymore since they're now redundant.
5960 In @output, use decode_at_digraphs.
5961 Parse a new @basename command that invokes last_component.
5962 (decode_at_digraphs): New.
5963 (BASE_QPUTS): Remove unused.
5964 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5965 (Output file name): New tests.
5966
3f7ca628
JD
59672006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5968
5969 Warn about output files that are generated by the skeletons and that
5970 conflict with other output files.
5971 * data/glr.c: Don't generate the header file here when glr.cc does.
5972 * src/files.c (file_names, file_names_count): New static globals.
5973 (compute_output_file_names): Invoke output_file_name_check for files
5974 not generated by the skeletons and remove existing checks.
5975 (output_file_name_check): New function that warns about conflicting
5976 output file names.
5977 (output_file_names_free): Free file_names.
5978 * src/files.h (output_file_name_check): Declare.
5979 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5980 the skeletons.
5981 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5982 (Conflicting output files): New tests.
5983
178e123e
PE
59842006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5985
5986 * doc/bison.texinfo: Fix a couple of typos.
5987
59882006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
5989
5990 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5991 Rename to...
5992 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5993 update all uses.
5994 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5995 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5996 local pv.
5997 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5998 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5999
ea17f233
JD
60002006-12-07 Bob Rossi <bob@brasko.net>
6001 and Joel Denny <jdenny@ces.clemson.edu>
6002
6003 * data/push.c (yypvarsinit): Change return type from void* to struct
6004 yypvars*. No longer cast to void* on return.
6005 (struct yypvars): Remove yylen since it need not be remembered between
6006 yypushparse invocations.
6007 (yypushparse): Don't copy between yylen and pv->yylen.
6008
55a30bda
JD
60092006-12-05 Bob Rossi <bob@brasko.net>
6010
6011 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6012 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6013 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6014 (struct yypvars): Remove b4_declare_parser_variables.
6015 (yypvarsinit): Remove init code for removed variables.
6016 (global scope): Do not declare b4_declare_parser_variables if
6017 push or pure mode.
6018 (yypushparse): Add b4_declare_parser_variables.
6019 Init new local variables, and remove init code for removed
6020 yypvars variables.
6021 (yyparse): Delete.
6022 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6023 and yyparse for other modes.
6024 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6025 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6026 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6027 (AT_PURE_LEX_IF): True if pure or push parser.
6028
85894313
JD
60292006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6030
6031 Document Yacc prologue alternatives and default %destructor's and
6032 %printer's as experimental. Don't mention Java yet. Discussed at
6033 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6034 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6035 (2.3a): Annotate this entry to say the old forms of these features were
6036 also experimental.
6037 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 6038 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
6039 of Java (we'll want this back eventually).
6040
02975b9a
JD
60412006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6042
6043 Support a file name argument to %defines. Deprecate `=' in
6044 %file-prefix, %name-prefix, and %output. Discussed at
6045 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6046 * NEWS (2.3a+): Mention.
148d66d8 6047 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
6048 form of %defines, and remove `=' from entries for %file-prefix,
6049 %name-prefix, and %output.
6050 * src/parse-gram.y (prologue_declaration): Implement.
6051 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6052 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6053 all but one occurrence of %name-prefix.
6054 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6055 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6056 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6057 occurrence of each of %file-prefix and %output. Add check for %defines
6058 with argument.
6059 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6060 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6061 Remove the `=' from %output.
6062
287b314e
JD
60632006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6064
6065 Don't escape $ in test case titles since Autoconf 2.61 now does that
6066 correctly.
6067 * tests/actions.at (Default %printer and %destructor are not for error
6068 or $undefined): Here.
6069 (Default %printer and %destructor are not for $accept): Here.
6070 * tests/input.at (Invalid $n and @n): Here.
6071
3ebecc24
JD
60722006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6073
6074 Rename <!> to <>. Discussed starting at
6075 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6076 * NEWS (2.3a+): Update.
148d66d8 6077 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
6078 Update.
6079 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6080 * src/scan-gram.l (INITIAL): Implement.
6081 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6082 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6083 comment.
6084 * tests/actions.at (Default tagless %printer and %destructor,
6085 Default tagged and per-type %printer and %destructor,
6086 Default %printer and %destructor are not for error or $undefined,
6087 Default %printer and %destructor are not for $accept,
6088 Default %printer and %destructor for mid-rule values): Update.
6089 * tests/input.at (Default %printer and %destructor redeclared,
6090 Unused values with default %destructor): Update.
6091
26b8a438
JD
60922006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6093
6094 Don't let %prec take a nonterminal.
6095 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6096 token.
6097 * tests/input.at (%prec takes a token): New test checking that %prec
6098 won't take a nonterminal.
6099
07c39ae9
JD
61002006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6101
405d53b7
JD
6102 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6103 it was double-quoted.
07c39ae9
JD
6104 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6105 grammar is maintained with Bison's highest standards.
6106 * src/getargs.c: Fix some typos in Doxygen comments.
6107
580b8926
JD
61082006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6109
6110 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6111 later. Reported by Paul Eggert in
6112 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6113 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6114 * src/scan-code.l (translate_action): Don't bother invoking
6115 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6116 (code_scanner_free): Instead of invoking
6117 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6118 which frees more.
6119 * src/scan-gram.l (gram_scanner_free): Likewise.
6120 * src/scan-skel.l (scan_skel): Likewise.
6121
4502eadc
JD
61222006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6123
6124 * src/files.c (tr): Change return type to void.
6125 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6126 has been called previously for the same key.
6127 (muscle_find): Return storage instead of value so that
6128 --enable-gcc-warnings doesn't produce warnings that the return discards
6129 const. aver that the value and storage are the same since storage
6130 could potentially be NULL when value is not.
6131 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6132 same as 0.
6133
7746c8f6
PE
61342006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6135
6136 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6137 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6138 us a slightly cleaner distribution, and also works.
6139 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6140 gnulib changes.
6141
eb095650
PE
61422006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6143 and Paul Eggert <eggert@cs.ucla.edu>
6144
6145 Don't let Bison leak memory except when it complains.
6146 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6147 (spec_defines_file, dir_prefix): Now char *, not const char *,
6148 since they are freed.
6149 * src/files.c: Likewise.
6150 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6151 Likewise.
6152 (tr): Now operates in-place. All uses changed.
6153 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6154 values.
6155 (compute_file_name_parts, compute_output_file_names): Don't store
6156 read-only data in variables that will be freed.
6157 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6158 src_extension, and header_extension.
6159 (output_file_names_free): New public function to free
6160 spec_verbose_file, spec_graph_file, spec_defines_file,
6161 parser_file_name, and dir_prefix.
6162 * src/getargs.c (getargs): Don't store read-only data in variables that
6163 will be freed.
6164 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6165 (which previously existed but was unused), and quotearg_free.
6166 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6167 * src/muscle_tab.c: Likewise.
6168 (muscle_entry): Make the value char const *,
6169 and add a new storage member that is char * and can be freed.
6170 (muscle_entry_free): New private function.
6171 (muscle_init): Use it instead of free.
6172 (muscle_insert, muscle_grow): Update and use new storage member.
6173 (muscle_code_grow): Free the string passed to muscle_grow
6174 since it's not needed anymore.
6175 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6176 add a new `char *code' member.
6177 ("{...}"): Declare semantic type as code.
6178 * src/scan-code.h (translate_rule_action):
6179 (translate_symbol_action, translate_code, translate_action): Return
6180 `char const *' rather than `char *' since external code should not free
6181 these strings.
6182 * src/scan-code.l: Likewise.
6183 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6184 which is "{...}" in the parser.
6185 * tests/Makefile.am (maintainer-check-valgrind): Set
6186 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6187 Valgrind.
6188 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6189 complain.
6190 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6191 expecting a non-zero exit status sets --leak-check=summary and
6192 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6193 this case, and we don't want to hear about it.
6194
ac564be4
PE
61952006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6196
6197 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6198 instead of from the template, to simplify configuration a bit.
6199 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6200 and m4/wint_t.m4, as they are needed with the latest gnulib.
6201
17bd8a73
JD
62022006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6203
6204 Disable unset/unused mid-rule value warnings by default, and recognize
6205 --warnings=midrule-values to enable them. Discussed starting at
6206 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6207 * NEWS (2.3a+): Mention.
6208 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6209 warnings): Add entry for midrule-values subargument.
6210 * src/reader.c (symbol_should_be_used): Don't return true just because
6211 the value is a set/used mid-rule value unless
6212 --warnings=midrule-values was specified.
6213 * tests/input.at (Unused values, Unused values before symbol
6214 declarations): Run tests with and without --warnings=midrule-values.
6215
6216 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6217 than LIST_FREE directly.
6218
89eb3c76
JD
62192006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6220
6221 Finish implementing --warnings=error, which should not be implied by
6222 --warnings=all (or by its synonyms -W and --warnings without
6223 subarguments).
6224 * src/complain.c (set_warning_issued): New function to report that
6225 warnings are being treated as errors and to record an error if so.
6226 Invoke...
6227 (warn_at, warn): ... here.
6228 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6229 "error - warnings are errors" does not appear above "all - all of the
6230 above".
6231 (getargs): For -W and --warnings without subarguments, don't let
6232 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6233 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6234
ba7560e2
JD
62352006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6236
6237 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6238 empty subargument list. For example: `bison --warnings= parser.y'.
6239
31283fc3
JD
62402006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6241
6242 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6243 the parser header file so that gcc doesn't warn.
6244
12e35840
JD
62452006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6246
6247 Split the default %destructor/%printer into two kinds: <*> and <!>.
6248 Discussed starting at
6249 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6250 * NEWS (2.3a+): Mention.
6251 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6252 previous change today related to mid-rules.
148d66d8 6253 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6254 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6255 (TYPE_TAG_ANY): Add as <*>.
6256 (TYPE_TAG_NONE): Add as <!>.
6257 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6258 for <*> and <!>.
6259 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6260 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6261 * src/symlist.c (symbol_list_default_new): Split into tagged and
6262 tagless versions.
6263 (symbol_list_destructor_set, symbol_list_printer_set): Split
6264 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6265 SYMLIST_DEFAULT_TAGLESS.
6266 * src/symlist.h: Update symbol_list_default*_new prototypes.
6267 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6268 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6269 * src/symtab.c (default_destructor, default_destructor_location,
6270 default_printer, default_printer_location): Split each into tagged and
6271 tagless versions.
6272 (symbol_destructor_get, symbol_destructor_location_get,
6273 symbol_printer_get, symbol_printer_location_get): Implement tagged
6274 default and tagless default cases.
6275 (default_destructor_set, default_printer_set): Split each into tagged
6276 and tagless versions.
6277 * src/symtab.h: Update prototypes.
6278 * tests/actions.at (Default %printer and %destructor): Rename to...
6279 (Default tagless %printer and %destructor): ... this, and extend.
6280 (Per-type %printer and %destructor): Rename to...
6281 (Default tagged and per-type %printer and %destructor): ... this, and
6282 extend.
6283 (Default %printer and %destructor for user-defined end token): Extend.
6284 (Default %printer and %destructor are not for error or $undefined):
6285 Update.
6286 (Default %printer and %destructor are not for $accept): Update.
6287 (Default %printer and %destructor for mid-rule values): Extend.
6288 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6289 (Unused values with default %destructor): Extend.
6290
f91b1629
JD
62912006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6292
6293 Don't apply the default %destructor/%printer to an unreferenced midrule
6294 value. Mentioned at
6295 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6296 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6297 like $@n instead of just @n so that the default %destructor/%printer
6298 logic doesn't see them as user-defined symbols.
6299 (symbol_is_dummy): Check for both forms of the name.
6300 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6301 name for which the midrule value is referenced in any action.
6302 * tests/actions.at (Default %printer and %destructor for mid-rule
6303 values): New test.
6304 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6305 for change to dummy symbol names.
6306
519d0004
JD
63072006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6308
6309 Warn about unset midrule $$ if the corresponding $n is used.
6310 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6311 $n usage.
6312 (packgram): Before invoking grammar_rule_check on any rule, make sure
6313 all actions have already been scanned in order to set `used' flags.
6314 Otherwise, checking that a midrule's $$ is set will not always work
6315 properly because the midrule check must forward-reference the midrule's
6316 parent rule.
6317 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6318 warning.
6319
a501eca9
JD
63202006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6321
6322 More improvements to the documentation of the prologue alternatives:
6323 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6324 Bison manual.
6325 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6326 some text to clarify the relative importance of the new directives and
6327 to show how these directives may be viewed as code labels.
6328
2cbe6b7f
JD
63292006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6330
6331 Similar to the recently removed %before-header, add %code-top as the
6332 alternative to the pre-prologue. Mentioned at
6333 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6334 Also, let the prologue alternatives appear in the grammar section.
6335 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6336 (prologue_declaration): Move the existing prologue alternatives to...
6337 (grammar_declaration): ... here and add %code-top.
6338 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6339
6340 Clean up and extend documentation for the prologue alternatives.
6341 * NEWS (2.3a+): Describe prologue alternatives.
6342 * doc/bison.texinfo (Prologue): Move discussion of prologue
6343 alternatives to...
6344 (Prologue Alternatives): ... this new section, and extend it to discuss
6345 all 4 directives in detail.
148d66d8
JD
6346 (Table of Symbols): Clean up discussion of prologue alternatives and
6347 add %code-top.
2cbe6b7f 6348
e557d3ea
JMG
63492006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6350
6351 DJGPP specific issues.
6352
6353 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6354 config.bat accordingly.
6355 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6356 * djgpp/config.site: Likewise.
6357
136a0f76
PB
63582006-10-16 Paolo Bonzini <bonzini@gnu.org>
6359
27bd5d67
PB
6360 Replace %*-header with %provides, %requires, %code. See discussion at
6361 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6362
136a0f76
PB
6363 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6364 (b4_user_start_header): Remove.
6365 * data/glr.c: Use new macros instead of b4_*start_header
6366 and b4_*end_header.
6367 * data/glr.cc: Likewise.
6368 * data/lalr1.cc: Likewise.
6369 * data/push.c: Likewise.
6370 * data/yacc.c: Likewise.
6371
6372 * doc/bison.texinfo: Remove %before-header, rename
6373 %{start,end,after}-header to %requires, %provides, %code.
6374
6375 * src/parse-gram.y: Likewise (also rename token names accordingly).
6376 * src/scan-gram.l: Likewise.
6377 * tests/actions.at: Likewise.
6378
10f429ef
PE
63792006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6380
6381 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6382 Problem reported by Joel E. Denny.
6383
63842006-10-14 Jim Meyering <jim@meyering.net>
6385
6386 (Sync from coreutils.)
6387 Work also when the working directory (with e.g. coreutils sources)
6388 is version controlled with git, rather than CVS.
6389 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6390 rather than CVS.
6391 In messages and comments, say e.g., "checked-out sources",
6392 rather than "CVS sources".
6393 (version_controlled_file): New function. Work for git as well as
6394 for CVS. Don't use grep's -q option.
6395 (slurp): Call it here, in place of CVS-specific code.
6396
c4bd5bf7
JD
63972006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6398
6399 Fix testsuite for ./configure --enable-gcc-warnings:
6400 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6401 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6402 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6403 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6404 * test/regression.at (Diagnostic that expects two alternatives):
6405 Likewise.
6406
46356ea4
PE
64072006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6408
231ed89a
PE
6409 * bootstrap.conf (gnulib_modules): Add config-h.
6410 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6411 worry about HAVE_CONFIG_H.
6412 * lib/abitset.c: Likewise.
6413 * lib/bitset.c: Likewise.
6414 * lib/bitset_stats.c: Likewise.
6415 * lib/bitsetv-print.c: Likewise.
6416 * lib/bitsetv.c: Likewise.
6417 * lib/ebitset.c: Likewise.
6418 * lib/get-errno.c: Likewise.
6419 * lib/lbitset.c: Likewise.
6420 * lib/subpipe.c: Likewise.
6421 * lib/timevar.c: Likewise.
6422 * lib/vbitset.c: Likewise.
6423 * lib/bitset.c: Include "bitset.h" first, to test interface.
6424 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6425 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6426 * lib/bitsetv.c: Include "bitsetv.h" first.
6427 * lib/get-errno.c: Include "get-errno.h" first.
6428 * m4/.cvsignore: Add config-h.m4.
6429 * tests/actions.at (Default %printer and %destructor for ...):
6430 Adjust expected line numbers in output to reflect removal of #if
6431 HAVE_CONFIG_H lines.
6432 * tests/glr-regression.at (Missed %merge type warnings when ...):
6433 Likewise.
6434 * tests/regression.at (Braced code in declaration in rules section):
6435 Likewise.
6436 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6437 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6438 Include <config.h> unconditionally.
6439
46356ea4
PE
6440 * bootstrap: Sync from coreutils, as follows:
6441
6442 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6443
6444 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6445 variable was sometimes used without being initialized. This
6446 messed up the installation of the INSTALL file in some cases.
6447
6448 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6449
6450 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6451 --copy. Inspired by a suggestion from Bruno Haible.
6452
6453 2006-10-03 Jim Meyering <jim@meyering.net>
6454
6455 * bootstrap: Undo last change to this file, since now gnulib-tool
6456 sticks with the automake default in generating dependencies.
6457
dd4bf078
PE
64582006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6459
cf2a5f7c
PE
6460 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6461 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6462
6463 * doc/bison.1: Add copyright notice.
6464
6465 * data/glr.c: Don't include <stdarg.h>; not used.
6466
35fe0834
PE
6467 * NEWS: The -g and --graph options now output graphs in Graphviz
6468 DOT format, not VCG format.
6469 * doc/bison.1: Likewise.
6470 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
6471 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6472 of this change in
6473 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
6474 * TODO: Remove Graphviz entry.
6475 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6476 remove vcg.c, vcg.h, vcg_defaults.h.
6477 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6478 * src/graphviz.c, src/graphviz.h: New files.
6479 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6480 * src/files.h: Make comment more generic.
6481 * src/main.c (main): Likewise.
6482 * src/print_graph.h: Likewise.
6483 * src/getargs.c (usage): Make usage description more generic.
6484 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6485 (static_graph, fgraph): Remove. All uses changed to pass
6486 arguments instead of sharing a static var.
6487 (print_core, print_actions, print_state, print_graph):
6488 Output graphviz format rather than VCG format.
6489 * tests/.cvsignore: Remove *.vcg; add *.dot.
6490 * tests/output.at: Expect *.dot files, not *.vcg files.
6491
dd4bf078
PE
6492 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6493 accommodates the 2006-10-08 change.
6494
efdd7421
PE
64952006-10-11 Bob Rossi <bob@brasko.net>
6496
6497 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6498 (b4_yyssa, b4_yyerror_range): New macros.
6499 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6500 (yypvarsinit): Remove init of removed fields.
6501 (yypushparse): Remove use of removed fields; use new macros instead.
6502
96a1981a
PE
65032006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6504
6505 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6506 in a push parser. Reindent slightly to match yacc.c better.
6507
65082006-10-11 Bob Rossi <bob@brasko.net>
6509
46356ea4
PE
6510 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6511 yymsg_alloc fields.
6512 (yypvarsinit, yypushparse): Remove init of removed fields.
6513 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 6514
c1630a8b
PE
65152006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6516
6517 * THANKS: Add Paolo Bonzini and Bob Rossi.
6518
90b9908d
PB
65192006-10-08 Paolo Bonzini <bonzini@gnu.org>
6520
6521 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6522 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6523 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6524 b4_define_user_cde and uses): Remove.
6525 (b4_comment, b4_prefix, b4_sync_start): New.
6526 * data/bison.m4: New file, with most of the content removed from c.m4.
6527 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6528 * src/output.c (output_skeleton): Pass bison.m4.
6529 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6530 only if specified.
6531
cf806753
PE
65322006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 Fix test failure reported by Tom Lane in
6535 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6536 and try to make such failures easier to catch in the future.
6537 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6538 that's now the caller's responsibility.
6539 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6540 Set yychar = YYEOF if it's negative.
6541 * tests/actions.at (yylex): Abort if asked to read past EOF.
6542 * tests/conflicts.at (yylex): Likewise.
6543 * tests/cxx-type.at (yylex): Likewise.
6544 * tests/glr-regression.at (yylex): Likewise.
6545 * tests/input.at (yylex): Likewise.
6546 * tests/regression.at (yylex): Likewise.
6547 * tests/torture.at (yylex): Likewise.
6548
0e2f006a
PE
65492006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6550
6551 Fix problems with translating English-language diagnostics.
6552 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6553 respect to bison-runtime pot generation. The YY_ stuff
6554 wasn't being captured.
6555 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6556 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6557 * runtime-po/POTFILES.in: Add data/push.c.
6558
e3ddc1e3
PE
65592006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6560
6561 Merge bootstrap changes from coreutils.
6562
6563 2006-09-28 Jim Meyering <jim@meyering.net>
6564
6565 Automatically generated dependencies are important even
6566 when all of the sources in a directory come from gnulib.
6567 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6568 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6569
6570 2006-09-23 Jim Meyering <jim@meyering.net>
6571
6572 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6573
6574 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6575
6576 * bootstrap: Add support for --force.
6577 (usage): New function. Describe usage less tersely.
6578 (CVS_only_file): New var.
6579
01e972b3
PE
65802006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6581
6582 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6583 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6584 Adjust white space and comments to match GNU style better.
6585
c63d3e90
PE
65862006-09-20 Bob Rossi <bob@brasko.net>
6587
6588 * data/push.c (yyresult_get): Remove function.
6589 (YYPUSH_MORE): Add #define.
6590 (yypushparse): Modify return value.
6591
e70f46d1
PE
65922006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6593
6594 * stamp-h.in: Remove; no longer needed.
6595 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6596 Remove config.h, config.hin, intl (no longer created).
6597 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6598 stamp-h1.
6599
6600 Sync bootstrap from coreutils, as follows:
6601
6602 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6603
6604 * bootstrap (symlink_to_gnulib): New function.
6605 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6606 to copies-of-gnulib.
6607 (cp_mark_as_generated, slurp, gnulib_files):
6608 Avoid making a copy if it's the same as the old version.
6609 (gnulib_files): Add support for this variable (used by Bison).
6610
a92be413
PE
66112006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6612
6613 * src/getargs.c (usage): Rework to use conventions similar to
6614 coreutils, to make translation a bit easier and the code a bit
6615 smaller. Problem reported by Tim Van Holder.
6616
4f82b42a
PE
66172006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6618
3b2942e6
PE
6619 Use some of gnulib's new modules, taken from coreutils.
6620
6621 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6622 * bootstrap.conf: New file.
6623 (gnulib_modules): Add configmake, inttypes, unistd.
6624 (XGETTEXT_OPTIONS): Add complain, complain_at,
6625 fatal, fatal_at, warn, warn_at, unexpected_end.
6626 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6627 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6628 (gl_EARLY): Add.
6629 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6630 (gl_INIT): Add
6631 (GNULIB_AUTOCONF_SNIPPET): Remove.
6632 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6633 the pickiest.
6634 * lib/.cvsignore: Add inttypes_.h.
6635 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6636 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6637 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6638 no-longer-necessary initializations.
6639 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6640 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6641 use the unistd module.
6642 * src/system.h: Likewise.
6643 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6644 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6645 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6646 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6647 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6648 * src/system.h: Include inttypes.h unconditionally, now that we
6649 use the inttypes module. Don't bother to include stdint.h, since
6650 inttypes.h now does that for us.
6651 (LOCALEDIR): Remove, now that we use the configmake module.
6652 * src/getargs.c: Include configmake.h.
6653 * src/main.c: Likewise.
6654 * src/output.c: Likewise.
6655 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6656 not from $abs_top_builddir, since config.h moved.
6657
6658
4f82b42a
PE
6659 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6660 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6661
6662 * src/parse-gram.y (symbol_declaration): Don't put statements
6663 before declarations; it's not portable to C89.
6664 * src/scan-code.l (handle_action_at): Likewise.
6665
6666 * src/scan-code.l: Always initialize braces_level; the old code
6667 left it uninitialized and therefore had undefined behavior.
6668
6669 Don't attempt to redefine 'assert', since it runs afoul of
6670 systems where standard headers (mistakenly) include <assert.h>.
6671 Instead, define and use our own alternative, called 'aver'.
6672 * src/reader.c: Don't include assert.h, since we no longer
6673 use assert.
6674 * src/scan-code.l: Likewise.
6675 * src/system.h (assert): Remove, replacing with....
6676 (aver): New function, taking a bool arg. All uses changed.
6677 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6678 not merely an integer.
6679
31c10e38
PE
66802006-09-15 Bob Rossi <bob@brasko.net>
6681
6682 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6683 * data/c.m4 (YYPUSH): New.
6684 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6685 * src/getargs.c (push_parser): New var.
6686 * src/getargs.h (push_parser): New declaration.
6687 * src/output.c (prepare): Add macro insertion of `push_flag'.
6688 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6689 (prologue_declaration): Parse %push-parser.
6690 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6691 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6692 list of removed lines from the traces observed.
6693 (AT_CHECK_CALC_LALR): Added push parser tests.
6694
fa7b79c0
PE
66952006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6696
21fe08ca
PE
6697 * NEWS: Version 2.3a.
6698 * configure.ac (AC_INIT): Likewise.
6699
e8ec4d9b
PE
6700 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6701 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6702 due to header ordering dependencies. I don't know why the #define
6703 was there.
6704
fa7b79c0
PE
6705 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6706 runtime cost when YYDEBUG is not defined, and so that some tests
6707 that used to fail now work. Problem and initial suggestion by
6708 Paolo Bonzini.
6709 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6710 * data/glr.cc (b4_parser_class_name):
6711 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6712 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6713 (yydebug_) [YYDEBUG]: New member.
6714 (yycdebug_): Now defined only if YYDEBUG.
6715 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6716 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6717 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6718 if YYYDEBUG.
6719 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6720 Define only if YYDEBUG.
6721 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6722 set_debug_level.
6723 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6724 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6725 AT_CHECK_CALC_GLR_CC that are working now.
6726
4ec13d60
PE
67272006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6728
6729 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6730 We don't need them in glr.cc, and glr.c defines them.
6731 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6732 assumes that defining it to anything is the same as defining
6733 it to 1. Problem reported by Paolo Bonzini.
6734
8e1687ae
PE
67352006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6736
6737 * data/c.m4 (b4_null, b4_case): Define.
6738 * src/output.c (prepare_symbols): Use b4_null.
6739 (user_actions_output): Use b4_case.
6740
3dc5e96b
PE
67412006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6742
aef3da86
PE
6743 * data/glr.c (b4_shared_declarations): Put start-header first,
6744 before any #includes that we generate, so that feature-test
6745 macros work. Problem reported by Michael Deutschmann in
6746 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6747 * data/lalr1.cc: Likewise.
6748 * doc/bison.texinfo (Prologue): Document that feature-test macros
6749 should be defined before any Bison declarations.
6750 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6751 that depend on location.hh after, not before, Bison decls, since
6752 we now include location.hh after the first user prologue.
6753
3dc5e96b
PE
6754 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6755 Sander Brandenburg in
6756 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6757 Also, fix minor white space and comment issues.
aef3da86
PE
6758 (Prologue): Mention that it's better to define feature-test macros
6759 before Bison declarations. Problem reported by Michael Deutschmann.
6760
6761 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6762 by Jim Meyering.
6763 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6764 This adjusts to recent gnulib changes.
3dc5e96b 6765
b2a0b7ca
JD
67662006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6767
6768 Finish implementation of per-type %destructor/%printer. Discussed
6769 starting at
6770 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6771 and
6772 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6773 * NEWS (2.3+): Add a description of this feature to the default
6774 %destructor/%printer description.
6775 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6776 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6777 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6778 list node contains a semantic type.
6779 * src/symtab.c, src/symtab.h: Extend with a table that associates
6780 semantic types with their %destructor's and %printer's.
6781 (semantic_type_from_uniqstr, semantic_type_get,
6782 semantic_type_destructor_set, semantic_type_printer_set): New functions
6783 composing the public interface of that table.
6784 (symbol_destructor_get, symbol_destructor_location_get,
6785 symbol_printer_get, symbol_printer_location_get): If there's no
6786 per-symbol %destructor/%printer, look up the per-type before trying
6787 the default.
6788 * tests/actions.at (Per-type %printer and %destructor): New test case.
6789 * tests/input.at (Default %printer and %destructor redeclared):
6790 Extend to check that multiple occurrences of %symbol-default in a
6791 single %destructor/%printer declaration is an error.
6792 (Per-type %printer and %destructor redeclared, Unused values with
6793 per-type %destructor): New test cases.
6794
3be03b13
JD
67952006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6796
6797 Require default %destructor/%printer to be declared using
6798 %symbol-default instead of an empty symbol list, and start working on
6799 new per-type %destructor/%printer. Discussed at
6800 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6801 * NEWS (2.3+): Add %symbol-default to example.
6802 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 6803 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
6804 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6805 (generic_symlist, generic_symlist_item): New nonterminals for creating
6806 a list in which each item is a symbol, semantic type, or
6807 %symbol-default.
6808 (grammar_declaration): Use generic_symlist in %destructor and %printer
6809 declarations instead of symbols.1 or an empty list.
6810 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6811 for changes to symbol_list.
6812 * src/reader.c: Update for changes to symbol_list.
6813 * src/scan-code.l: Likewise.
6814 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6815 * src/symlist.c, src/symlist.h: Extend such that a list node may
6816 represent a semantic type or a %symbol-default in addition to just an
6817 ordinary symbol. Add switched functions for setting %destructor's and
6818 %printer's.
6819 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6820 %destructor/%printer declarations.
6821
3508ce36
JD
68222006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6823
6824 Whether the default %destructor/%printer applies to a particular symbol
6825 isn't a question of whether the user *declares* that symbol (in %token,
6826 for example). It's a question of whether the user by any means
6827 *defines* the symbol at all (by simply using a char token, for
6828 example). $end is defined by Bison whereas any other token with token
6829 number 0 is defined by the user. The error token is always defined by
6830 Bison regardless of whether the user declares it with %token, but we
6831 may one day let the user define error as a nonterminal instead.
6832 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6833 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6834 the meaning of "user-defined".
6835 * tests/actions.at (Default %printer and %destructor for user-declared
6836 end token): Rename to...
6837 (Default %printer and %destructor for user-defined end token): ...
6838 this.
6839
6840 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6841 computation of whether to apply the default, don't maintain a list of
6842 every Bison-defined symbol. Instead, just check for a first character
6843 of '$', which a user symbol cannot have, and check for the error token.
6844
9350499c
JD
68452006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6846
6847 Don't apply the default %destructor or %printer to the error token,
6848 $undefined, or $accept. This change fits the general rule that the
6849 default %destructor and %printer are only for user-declared symbols,
6850 and it solves several difficulties that are described in the new test
6851 cases listed below.
6852 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6853 * tests/actions.at (Default %printer and %destructor are not for error
6854 or $undefined, Default %printer and %destructor are not for $accept):
6855 New test cases.
6856
4d7370cb
JD
68572006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6858
6859 Allow %start after the first rule.
6860 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6861 when parsing the first rule.
6862 (check_and_convert_grammar): Search for it here after all grammar
6863 declarations have been parsed. Skip midrules, which have dummy LHS
6864 nonterminals.
6865 * src/symtab.c (symbol_is_dummy): New function.
6866 * src/symtab.h (symbol_is_dummy): Declare it.
6867 * tests/input.at (%start after first rule): New test.
6868
6d0ef4ec
JD
68692006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6870
6871 Redo some of the previous commit: add back the ability to use
6872 non-aliased/undeclared string literals since it might be useful to
6873 those declaring %token-table.
6874 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6875 commit: don't worry about complaints from symbols_pack.
6876 * src/symtab.c (symbol_new, symbol_class_set,
6877 symbol_check_alias_consistency): Undo changes in previous commit: count
6878 each string literal as a new symbol and token, assign it a symbol
6879 number, and don't complain about non-aliased string literals.
6880 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6881 and token counts but does still set aliased tokens to the same number,
6882 symbol_pack_processor now leaves empty slots in the symbols array.
6883 Remove those slots.
6884 * tests/regression.at (Undeclared string literal): Remove test case
6885 added in previous commit since non-aliased string literals are allowed
6886 again.
6887 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6888 remove unnecessary string literal declarations.
6889 * tests/sets.at (Firsts): Likewise.
6890
965537bc
JD
68912006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6892
6893 Don't allow an undeclared string literal, but allow a string literal to
6894 be used before its declaration.
6895 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6896 symbols_pack complained.
6897 * src/symtab.c (symbol_new): Don't count a string literal as a new
6898 symbol.
6899 (symbol_class_set): Don't count a string literal as a new token, and
6900 don't assign it a symbol number since symbol_make_alias does that.
6901 (symbol_make_alias): It's not necessary to decrement the symbol and
6902 token counts anymore. Don't assume that an alias declaration occurs
6903 before any uses of the identifier or string, and thus don't assert that
6904 one of them has the highest symbol number so far.
6905 (symbol_check_alias_consistency): Complain if there's a string literal
6906 that wasn't declared as an alias.
6907 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6908 symbol_pack asserts that every token has been assigned a symbol number
6909 although undeclared string literals have not.
6910 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 6911 string literal): New test cases.
965537bc
JD
6912 (Characters Escapes, Web2c Actions): Declare string literals as
6913 aliases.
6914 * tests/sets.at (Firsts): Likewise.
6915
47aee066
JD
69162006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6917
6918 In the grammar scanner, STRING_FINISH unclosed constructs and return
6919 them to the parser in order to improve error messages.
6920 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6921 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6922 * tests/input.at (Unclosed constructs): New test case.
6923 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6924 seen.
6925
6926 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6927 unused global.
6928
1f6b3679
JD
69292006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6930
6931 Handle string aliases for character tokens correctly.
6932 * src/symtab.c (symbol_user_token_number_set): If the token has an
6933 alias, check and set its alias's user token number instead of its own,
6934 which is set to indicate the alias. Previously, every occurrence of
6935 the character token in the grammar overwrote that alias indicator with
6936 the character code.
6937 * tests/input.at (String aliases for character tokens): New test.
6938
219741d8
JD
69392006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6940
6941 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6942
11daa4e7
PE
69432006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6944
6945 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6946 to prevent failures when building on older platforms.
6947 Check for autopoint failure.
6948 Set XGETTEXT_OPTIONS to values that check for C format strings,
6949 so that translators are warned about them (this also helps
6950 prevent core dumps).
6951
6952 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6953 function, since it simplifies our code a bit.
6954
6955 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6956 rather than -W, so we don't get bogus warnings about sign comparisons.
6957 Add -Wpointer-arith, since that warning is useful (it reports code
6958 that does not conform to C89 and that some compilers reject).
6959 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6960 since it's no longer needed.
6961
f9bfc42a
JD
69622006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6963
6964 Clean up scanners a bit.
6965 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6966 definitions so gcc won't warn when obstack_for_string is unused.
6967 * src/scan-code.l: config.h and system.h are already #include'd by
6968 scan-code-c.c, so get rid of them here.
6969 * src/scan-gram.l: Likewise.
6970 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6971 definitions rather than duplicating the rest of it.
6972 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6973
06e8700a
JD
69742006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6975
6976 Suppress signed/unsigned comparison warnings for yycheck.
6977 * data/c.m4 (b4_safest_int_type): New macro.
6978 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6979 a signed int type, cast it to b4_safest_int_type first.
6980 * data/yacc.c: Likewise.
6981 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6982 also overwritten.
6983
9c437126
PE
69842006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6985
6986 * doc/bison.texinfo: Fix some typos.
6987
284d8a13
PE
69882006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6989
6990 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6991 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6992
6993 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6994 the latest gnulib does this a different way.
6995 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6996 translation was patched, so stop omitting it.
6997
ec5479ce
JD
69982006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6999
7000 Enable declaration of default %printer/%destructor. Make the parser
7001 use these for all user-declared grammar symbols for which the user does
7002 not declare a specific %printer/%destructor. Thus, the parser uses it
7003 for token 0 if the user declares it but not if Bison generates it as
7004 $end. Discussed starting at
7005 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7006 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7007 and
7008 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7009 * NEWS (2.3+): Mention.
7010 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7011 declare a %destructor for a mid-rule's semantic value. It's just
7012 impossible to declare one specific to it.
7013 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7014 code. Describe default %destructor form.
7015 * src/parse-gram.y (grammar_declaration): Parse default
7016 %printer/%destructor declarations.
7017 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7018 and symbol_destructor_location_get rather than accessing the destructor
7019 and destructor_location members of struct symbol.
7020 (symbol_printers_output): Likewise but for %printer's.
7021 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7022 again.
7023 * src/symtab.c (default_destructor, default_destructor_location,
7024 default_printer, default_printer_location): New static global
7025 variables to record the default %destructor and %printer.
7026 (symbol_destructor_get, symbol_destructor_location_get,
7027 symbol_printer_get, symbol_printer_location_get): New functions to
7028 compute the appropriate %destructor and %printer for a symbol.
7029 (default_destructor_set, default_printer_set): New functions to set the
7030 default %destructor and %printer.
7031 * src/symtab.h: Prototype all those new functions.
7032 * tests/actions.at (Default %printer and %destructor): New test to
7033 check that the right %printer and %destructor are called, that they're
7034 not called for $end, and that $$ and @$ work correctly.
7035 (Default %printer and %destructor for user-declared end token): New
7036 test to check that the default %printer and %destructor are called for
7037 a user-declared end token.
7038 * tests/input.at (Default %printer and %destructor redeclared, Unused
7039 values with default %destructor): New tests to check related grammar
7040 warnings and errors.
7041
868d2d96
JD
70422006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7043
7044 Clean up handling of %destructor for the end token (token 0).
7045 Discussed starting at
7046 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7047 and
7048 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7049
7050 Make the skeletons consistent in how they pop the end token and invoke
7051 its %destructor.
7052 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7053 state, which has token number 0, since this would invoke the
7054 %destructor for the end token.
7055 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7056 until after shifting the end token, or else it won't be popped.
7057 * data/yacc.c (yyparse): Likewise.
7058
7059 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7060 it's the end token. Upon termination, destroy an unshifted lookahead
7061 even when it's the end token.
7062 * data/lalr1.cc (yy::parser::parse): Likewise.
7063 * data/yacc.c (yyparse): Likewise.
7064
7065 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7066 value warnings for the end token when the user gives the end token a
7067 %destructor.
7068
7069 * tests/actions.at (Printers and Destructors): Test all the above.
7070
62a9592d
PE
70712006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7072
7073 Update to latest gnulib and gettext versions.
7074 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7075 Add fopen-safer.
7076 (gnulib_files): Add m4/warning.m4. Don't worry about files
7077 overwritten by autopoint.
7078 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7079 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7080 rejects them.
7081 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7082 so that we can remove the intl files at a better time.
7083 (intl_files_to_remove): Remove aclocal.m4, since it gets
7084 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7085 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7086 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7087 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7088 Remove datarootdir hack; no longer needed.
7089 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7090 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7091 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7092 strdup.h.
7093 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7094 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7095
10d6970f
PE
70962006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7097
7098 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7099 it with --assume-autoconf='latest-stable'.
7100
50a33993
JD
71012006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7102
7103 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7104 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7105 YYSTYPE' and `{'.
7106 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7107 those from muscle_tab.c since the old ones are misleading.
7108
2ce4ed68
AD
71092006-07-13 Akim Demaille <akim@epita.fr>
7110
7111 Support %define "KEY" {VALUE}.
7112 * src/scan-code.h, src/scan-code.l (translate_action)
7113 (translate_rule_action, translate_symbol_action, translate_code):
7114 Return char *, not const char *.
7115 * src/parse-gram.y (declaration): Rename as...
7116 (prologue_declaration): this.
7117 (string_content): Remove this nonterminal, use STRING.
7118 (braceless, content, content.opt): New nonterminal.
7119 Use them.
7120 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7121 as value.
7122 * src/scan-gram.l (getargs.h): Don't include it.
7123
db7e5eb5
PE
71242006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7125
7126 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7127 rather than a for-loop that declares a local bool variable. This
7128 should work around a compatibility problem with a Cray x1e C++
7129 compiler reported by Hung Nguyen in
7130 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7131 The for-loop was introduced in the 2004-11-17 change but I don't
7132 know why it was needed.
7133
a5d80ba5
AD
71342006-07-12 Akim Demaille <akim@epita.fr>
7135
7136 * data/c.m4: Comment changes.
7137
23eb2a69
AD
71382006-07-10 Akim Demaille <akim@lrde.epita.fr>
7139
7140 * src/complain.c (error_message, ERROR_MESSAGE): New.
7141 To factor...
7142 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7143 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7144
ddc8ede1
PE
71452006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7146
7147 * NEWS: Instead of %union, you can define and use your own union type
7148 YYSTYPE if your grammar contains at least one <type> tag.
7149 Your YYSTYPE need not be a macro; it can be a typedef.
7150 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7151 (Union Decl, Decl Summary): Document this.
7152 * data/glr.c (YYSTYPE): Implement this.
7153 * data/glr.cc (YYSTYPE): Likewise.
7154 * data/lalr1.cc (YYSTYPE): Likewise.
7155 * data/yacc.c (YYSTYPE): Likewise.
7156 * src/output.c (prepare): Output tag_seen_flag.
7157 * src/parse-gram.y (declaration, grammar_declaration):
7158 Use 'union_seen' rather than 'typed' to determine whether
7159 %union has been seen, since grammars can now be typed without
7160 %union.
7161 (symbol_declaration, type.opt, symbol_def):
7162 Keep track of whether a tag has been seen.
7163 * src/reader.c (union_seen, tag_seen): New vars.
7164 (typed): remove.
7165 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7166 * src/scan-code.l (untyped_var_seen): New variable.
7167 (handle_action_dollar): Adjust to above changes.
7168 (handle_action_dollar, handle_action_at):
7169 Improve overflow checking for outlandish numbers.
7170 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7171 avoid new diagnostics generated by above changes.
7172 * tests/regression.at (YYSTYPE typedef): Add test to check
7173 for type tags without %union.
7174
7175 * src/symlist.c (symbol_list_length): Return int, not unsigned
7176 int, since callers expect int. This may need to get revisited
7177 once we have proper integer overflow checking.
7178
7179 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7180 object is now static.
7181
7182 * src/getargs.c (flags_argmatch): Return void, not int,
7183 to pacify ./configure --enable-gcc-warnings.
7184
7185 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7186 since last_string is already defined to FLEX_PREFIX (last_string).
7187
7b42569e
AD
71882006-07-09 Akim Demaille <akim@lrde.epita.fr>
7189
7190 Implement --warnings/-W.
7191 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7192 replaced by...
7193 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7194 Adjust callers.
7195 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7196 (warnings_args, warnings_types): New.
7197 (getargs, short_options, long_options): Accept -W/--warnings.
7198 Sort the options by alphabetical order, upper case letter right
7199 before its lower case.
7200
3b452f4e
JD
72012006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7202
7203 Change %merge result type clash warnings to errors. Discussed at
7204 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7205 * src/reader.c (record_merge_function_type): Use complain_at.
7206 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7207 declared later): Update test case results.
7208
b8a41559
AD
72092006-07-09 Akim Demaille <akim@lrde.epita.fr>
7210
7211 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7212 to be in alphabetical order.
7213 (trace_args): Spelling fixes.
7214
cd9e1ba2
PE
72152006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7216
7217 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7218 so they don't collide with user-defined macros.
7219 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7220 this was never guaranteed, and now that we're using gnulib stdint,
7221 which defines int_fast16_t to long int, the problem is exposed.
7222
cb48f191
PE
72232006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7224
b8445a15
PE
7225 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7226 need the full POSIX semantics (and weren't implementing them
7227 anyway).
7228
cb48f191
PE
7229 Adjust to Autoconf 2.60 and today's gnulib.
7230 * bootstrap (gnulib_modules): Add stdint.
7231 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7232 no longer copies it.
7233 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7234 since stdint needs the former and wcwidth (which is now required
7235 by mbswidth) needs the latter.
7236 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7237 work around a compatibility glitch between gettext 0.14.6 and
7238 Autoconf 2.60.
7239 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7240 Do not check for uintptr_t, since new stdint module does the right
7241 thing.
7242 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7243 Add stdint.h, stdint_.h, wcwidth.h.
7244 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7245 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7246 stdint.m4, wchar_t.m4, wcwidth.m4.
7247 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7248 usual order for ../lib/*.h files.
7249 (file_name_split): Use last_component, not base_name, to adjust
7250 to gnulib changes.
7251 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7252 for ../lib/*.h files.
7253 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7254 Define unconditionally, since we now assume the stdint module.
7255 * src/scan-skel.l: Include <dirname.h>.
7256 (BASE_QPUTS): Use last_component, not base_name.
7257 * src/system.h: Include <unlocked-io.h> in the usual order
7258 for ../lib/*.h files. Include <stdint.h> unconditionally,
7259 since we now use the stdint module.
7260 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7261 HAVE_UINTPTR_T, since we now use the stdint module.
7262 (base_name): Remove decl, since files now include <dirname.h>
7263 to get the decl.
7264
cd48d21d
AD
72652006-07-08 Akim Demaille <akim@lrde.epita.fr>
7266
7267 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7268 New, default to 1.
7269 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7270 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7271 default.
7272 * tests/calc.at: Adjust.
7273
8ec0a172
AD
72742006-07-08 Akim Demaille <akim@lrde.epita.fr>
7275
b8445a15 7276 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7277 (b4_syncline): Also output the location of its invocation (from
7278 the skeleton).
7279 (b4_user_action, b4_define_user_action, b4_user_actions)
7280 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7281 (b4_user_stype): New.
7282 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7283
4a678af8
JD
72842006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7285
7286 In the grammar file, the first column is 1 not 0 on the first line as
7287 on every other line.
7288 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7289 * tests/input.at (Torturing the Scanner): Update output.
7290
7291 * src/scan-gram.l (scanner_cursor): Declare it static.
7292
dd60572a
JD
72932006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7294
7295 In warnings, say "previous declaration" rather than "first
7296 declaration".
7297 * src/symtab.c (redeclaration): Do that here.
7298 * src/reader.c (record_merge_function_type): In the case of a result
7299 type clash, report the previous declaration rather than the very first
7300 one in the grammar file.
7301 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7302 declared later): Add a third declaration to check this behavior.
7303 * tests/input.at (Incompatible Aliases): Update output.
7304
2073e1b6
AD
73052006-06-27 Akim Demaille <akim@epita.fr>
7306
7307 * doc/Doxyfile.in: New.
7308 * doc/Makefile.am: Use it.
7309 * src/lalr.h, src/symtab.h: Initial doxygenation.
7310
8ee5b538
JD
73112006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7312
7313 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7314 declared after the %merge. This continues the effort of the previous
7315 patch.
8ee5b538
JD
7316 * src/reader.c (get_merge_function): Don't set the merger type yet.
7317 (record_merge_function_type): New function for setting the merger type
7318 and checking for clashes.
7319 (grammar_current_rule_merge_set): Set the location of the %merge for
7320 the current rule.
7321 (packgram): Invoke record_merge_function_type for each rule now that
7322 all symbol type declarations have been parsed.
7323 * src/reader.h (merger_list.type_declaration_location): New member
7324 storing the location of the first %merge from which the type for this
7325 merging function was derived.
7326 * src/symlist.h (symbol_list.merger_declaration_location): New member
7327 storing the location of a rule's %merge, if any.
7328 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7329 declared later): New test to catch the error fixed by the above patch.
7330
ffa4ba3a
JD
73312006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7332
7333 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7334 declarations appear after the rules. Discussed at
7335 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7336 and
7337 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7338 Don't mistake the type of $$ in a midrule to be that of its parent
7339 rule's $$.
ffa4ba3a
JD
7340 * src/reader.c (grammar_current_rule_end): Don't invoke
7341 grammar_rule_check yet since not all symbol declarations may have been
7342 parsed yet.
7343 (grammar_midrule_action): Likewise.
7344 Don't record whether the midrule's $$ has been used yet since actions
7345 haven't been translated yet.
7346 Record the midrule's parent rule and its RHS index within the parent
7347 rule.
7348 (grammar_current_rule_action_append): Don't translate the action yet
7349 since not all symbol declarations may have been parsed yet and, thus,
7350 warnings about types for $$, $n, @$, and @n can't be reported yet.
7351 (packgram): Translate the action and invoke grammar_rule_check now that
7352 all symbol declarations have been parsed.
7353 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7354 after parsing the entire grammar file, the symbol list here in the case
7355 of a midrule is actually the midrule's empty RHS, so reference its
7356 parent rule's RHS where necessary.
7357 On the other hand, now that you can already know it's a midrule, you
7358 aren't forced to think $$ has the same type as its parent rule's $$.
7359 (handle_action_at): In the case of a midrule, reference the parent rule
7360 where necessary.
7361 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7362 members.
7363 (symbol_list_length): Now that this is invoked after all rules have
7364 been parsed, a NULL symbol (rather than a NULL symbol list node)
7365 terminates a rule. symbol_list_print already does this correctly.
7366 * src/symlist.h (symbol_list.midrule_parent_rule,
7367 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7368 remember their relationships with their parents.
7369 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7370 fixed by the above patch.
7371 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7372 implementing...
7373 (Unused values): ... this old test case and...
7374 (Unused values before symbol declarations): ... this new test case.
7375 This one is the same as `Unused values' except that all symbol
7376 declarations appear after the rules in order to catch the rest of the
7377 errors fixed by the above patch.
7378
e256e17f
JD
73792006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7380
300a1930
JD
7381 More cleanup.
7382 * src/reader.c (current_rule): Declare it static since it's no longer
7383 used outside this file.
7384 (grammar_current_rule_action_append): Remove redundant arguments from
7385 translate_rule_action invocation.
7386 * src/reader.h (current_rule): Remove this unused extern.
7387 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7388 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 7389
381ecb06
JD
73902006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7391
7392 Clean up yesterday's patch.
7393 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7394 to...
7395 * src/reader.c (grammar_current_rule_action_append): ... here for
7396 consistency with grammar_current_rule_symbol_append.
7397 * tests/regression.at (Braced code in declaration in rules section):
7398 Make yyerror and yylex static as usual.
7399
4210cd0b
JD
74002006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7401
7402 Fix bug that mistakes braced code in a declaration in the rules section
7403 to be a rule action. Mentioned at
7404 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7405 * src/scan-gram.l: Move midrule action detection from the start of the
7406 scanning of any braced code to...
7407 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7408 action. For readability, use $2 and @2 rather than the equivalent
7409 global variables.
7410 * tests/regression.at (Braced code in declaration in rules section):
7411 New test to catch the error fixed by the above patch.
7412
7413 Work on code readability some.
7414 * src/scan-code.l (current_rule): Get rid of this misleading and
7415 redundant declaration: it's actually extern'ed in reader.h.
7416 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7417 translate_action): Add a rule argument and use it instead of the global
7418 current_rule.
7419 (translate_rule_action): This already receives current_rule through an
7420 argument, so pass it on to translate_action instead of assigning
7421 current_rule to current_rule.
7422 (translate_symbol_action, translate_code): Pass rule = NULL to
7423 translate_action.
7424
34f98f46
JD
74252006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7426
7427 Rename %before-definitions to %start-header and %after-definitions to
7428 %end-header. Don't use these declarations to separate pre-prologue
7429 blocks from post-prologue blocks. Add new order-independent
7430 declarations %before-header and %after-header as alternatives to the
7431 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7432 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7433 * NEWS (2.3+): Update for these changes.
7434 * data/glr.c (b4_before_definitions): Update to...
7435 (b4_start_header): ... this.
7436 (b4_after_definitions): Update to...
7437 (b4_end_header): ... this.
7438 * data/glr.cc: Likewise.
7439 * data/lalr1.cc: Likewise.
7440 * data/yacc.c: Likewise.
7441 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7442 prologue blocks with %*-header declarations.
7443 (Calc++ Parser): Likewise.
91661ebb 7444 (Decl Summary): Update names.
148d66d8 7445 (Table of Symbols): Update description.
34f98f46
JD
7446 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7447 (PERCENT_END_HEADER): ... this.
7448 (PERCENT_BEFORE_DEFINITIONS): Update to...
7449 (PERCENT_START_HEADER): ... this.
7450 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7451 (declaration): Update token names and m4 macro names.
7452 When parsing %end-header and %start-header, invoke translate_code
7453 before muscle_code_grow, and no longer set global booleans to remember
7454 whether these declarations have been seen.
7455 Parse new %after-header and %before-header.
7456 * src/reader.c (before_definitions, after_definitions): Remove.
7457 (prologue_augment): Accept a new bool argument to specify whether to
7458 augment the pre-prologue or post-prologue.
7459 * src/reader.h (before_definitions, after_definitions): Remove these
7460 extern's.
7461 (prologue_augment): Add new bool argument.
7462 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7463 (PERCENT_END_HEADER): ... this.
7464 (PERCENT_BEFORE_DEFINITIONS): Update to...
7465 (PERCENT_START_HEADER): ... this.
7466 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7467 * tests/actions.at (Printers and Destructors): Update names.
7468
31b2b07e
JD
74692006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7470
7471 Add comparison operators for C++ location classes. Discussed at
7472 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7473 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7474 declaration indicating whether filename_type has an operator==. If
7475 filename_type is `std::string', it defaults to `1', `0' otherwise.
7476 * data/location.cc: Iff b4_define_location_comparison is `1', add
7477 operator== and operator!= for class position and for class location.
7478
7479 Some minor fixes.
7480 * src/scan-action.l: Remove unused file.
7481 * src/symtab.c (symbol_printer_set): Use printer_location not
7482 destructor_location.
7483 * src/symtab.h (struct symbol): Replace incorrect source comment for
7484 printer members.
7485 * tests/input.at (Incompatible Aliases): Update output with correct
7486 printer location.
7487
9bc0dd67
JD
74882006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7489
7490 Don't put the pre-prologue in the header file. For the yacc.c code
7491 file and the glr.c header and code files, move the pre-prologue before
7492 the token definitions. Add new %before-definitions and
7493 %after-definitions to declare code that will go in both the header file
7494 and code file. Discussed at
7495 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7496 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7497 and
7498 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7499 * NEWS (2.3+): Describe these changes.
7500 * data/glr.c (b4_pre_prologue): Move from within to before...
7501 (b4_shared_declarations): ... this.
7502 Add new b4_before_definitions before b4_token_enums.
7503 Add new b4_after_definitions at the end.
7504 * data/glr.cc (b4_pre_prologue): Replace with...
7505 (b4_before_definitions): ... this in the header file.
7506 (b4_after_definitions): New near the end of the header file.
7507 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7508 code file right before including the header file.
7509 (b4_before_definitions): New in the previous position of
7510 b4_pre_prologue in the header file.
7511 (b4_after_definitions): New near the end of the header file.
7512 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7513 (b4_token_enums_defines): In the code file, move to right before
7514 YYSTYPE for consistency with the header file.
7515 (b4_before_definitions): New right before b4_token_enums_defines in
7516 both the header and code file.
7517 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7518 header and code file.
7519 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7520 of prologues for %union dependencies.
91661ebb
JD
7521 (Decl Summary): In %defines description, mention the effect of
7522 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
7523 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7524 than in the pre-prologue so that make check succeeds.
148d66d8 7525 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
7526 %after-definitions.
7527 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7528 %before-definitions.
7529 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7530 (declaration): Parse those declarations and append to
7531 b4_before_definitions and b4_after_definitions, respectively.
7532 * src/reader.c (before_definitions, after_definitions): New bools to
7533 track whether those declarations have been seen.
7534 (prologue_augment): Add to the post-prologue if %union,
7535 %before-definitions, or %after-definitions has been seen.
7536 * src/reader.h (before_definitions, after_definitions): New extern's.
7537 * src/scan-gram.l: Scan the new declarations.
7538 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7539 prologue block in a %before-definitions or a %after-definitions based
7540 on whether the %union is declared.
7541 * tests/regression.at (Early token definitions with --yacc, Early token
7542 definitions without --yacc): Move tests for token definitions into the
7543 post-prologue since token names are no longer defined in the
7544 pre-prologue.
7545
203b9274
AD
75462006-06-20 Akim Demaille <akim@epita.fr>
7547
7548 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7549 (symbol_get): Use it.
7550 * src/parse-gram.y: Use it.
7551
a7ee59cf
JD
75522006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7553
7554 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7555 build succeeds when configured with --enable-gcc-warnings.
7556
5a2baae7
PE
75572006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7558
33ad1a9c
PE
7559 * src/parse-gram.y (char_name): New function.
7560 (CHAR, STRING, string_content): For %printer, properly escape.
7561 (ID): Prefer fputs to fprintf.
7562 (id): Reindent to be consistent with other rules.
7563 Properly quote char.
7564
5a2baae7
PE
7565 The Translation Project changed its way of publishing translations
7566 to maintainers. I haven't received any responses to my request
7567 for supporting the old way, or for documenting the new way. I
7568 have modified 'bootstrap' to use screen scraping
7569 (in this case, HTML scraping). This is unreliable and inelegant,
7570 but I don't see any better way. Yuck.
7571 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7572 (get_translations): New function, which uses HTML scraping to
7573 deduce locations of latest translations.
7574 Use this function to grab both bison and bison-runtime .po files.
7575 Don't bother priming the pump for the runtime-po domain any more,
7576 as it's now translated better than bison is.
7577
58d7a1a1
AD
75782006-06-19 Akim Demaille <akim@epita.fr>
7579
7580 * src/scan-gram.l: No longer "parse" things after `%union' until
7581 `{'. Rather, return a single "%union" token.
7582 No longer make symbols: return strings, and leave the conversion
7583 to symbols to the parser.
7584 (SC_PRE_CODE, token_type): Remove.
7585 * src/parse-gram.y (%union): New field `character'.
7586 Sort tokens.
7587 (CHAR): New token.
7588 (ID, ID_COLON): Now that the scanner no longer makes them
7589 identifiers, adjust all uses to invoke symbol_get.
7590 (id_colon): New, wraps the conversion from string to symbol.
7591 (%union): Accept a possible union_name.
7592 (symbol): Now can be a char.
7593 * data/c.m4 (b4_union_name): Leave a default value.
7594 * data/glr.c, data/yacc.c: Use it.
7595
b931235e
JD
75962006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7597
7598 For associating token numbers with token names for "yacc.c", don't use
7599 #define statements unless `--yacc' is specified; always use enum
7600 yytokentype. Most important discussions start at:
7601 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7602 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7603 and
7604 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7605 * NEWS (2.3+): Mention.
7606 * data/c.m4 (b4_yacc_if): New.
7607 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7608 token #define's.
7609 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7610 on token name definitions.
7611 * src/getargs.c (usage): Capitalize `Yacc' in English.
7612 * src/output.c (prepare): Define b4_yacc_flag.
7613 * tests/regression.at (Early token definitions): Test that tokens names
7614 are defined before the pre-prologue not just before the post-prologue.
7615 Remove this test case and copy to...
7616 (Early token definitions with --yacc): ... this to test #define's.
7617 (Early token definitions without --yacc): ... and this to test enums.
7618
9e6e7ed2
PE
76192006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7620
7621 * NEWS: Reword the post-2.3 change to not be so optimistic about
7622 removing the old "look-ahead" spelling.
7623 Update previous look-ahead/lookahead change reports.
7624 * REFERENCES: look-ahead -> lookahead (since that's
7625 what he actually wrote).
7626 * doc/refcard.tex: look ahead -> lookahead,
7627 look-ahead -> lookahead
7628
742e4900
JD
76292006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7630
7631 For consistency, use `lookahead' instead of `look-ahead' or
7632 `look_ahead'. Discussed starting at
7633 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7634 and then at
7635 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7636 * NEWS: For the next release, note the change to `--report'.
7637 * TODO, doc/bison.1: Update English.
7638 * doc/bison.texinfo: Update English.
7639 (Understanding Your Parser, Bison Options): Document as
7640 `--report=lookahead' rather than `--report=look-ahead'.
7641 * src/conflicts.c: Update English in comments.
7642 (lookahead_set): Rename from look_ahead_set.
7643 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7644 (resolve_sr_conflict): Rename local look_ahead_tokens to
7645 lookahead_tokens, and update other uses.
7646 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7647 count_rr_conflicts, conflicts_free): Update uses.
7648 * src/getargs.c (report_args): Move "lookahead" before alternate
7649 spellings.
7650 (report_types): Update uses.
7651 (usage): For `--report' usage description, state `lookahead' spelling
7652 rather than `look-ahead'.
7653 * src/getargs.h (report.report_lookahead_tokens): Rename from
7654 report_look_ahead_tokens.
7655 * src/lalr.c: Update English in comments.
7656 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7657 (state_lookahead_tokens_count): Rename from
7658 state_look_ahead_tokens_count.
7659 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7660 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7661 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7662 Update other uses.
7663 Update English in output.
7664 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7665 * src/print.c: Update English in comments.
7666 (lookahead_set): Rename from look_ahead_set.
7667 (print_reduction): Rename argument lookahead_token from
7668 look_ahead_token.
7669 (print_core, state_default_rule, print_reductions, print_results):
7670 Update uses.
7671 * src/print_graph.c: Update English in comments.
7672 (print_core): Update uses.
7673 * src/state.c: Update English in comments.
7674 (reductions_new): Update uses.
7675 (state_rule_lookahead_tokens_print): Rename from
7676 state_rule_look_ahead_tokens_print, and update other uses.
7677 * src/state.h: Update English in comments.
7678 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7679 (state_rule_lookahead_tokens_print): Rename from
7680 state_rule_look_ahead_tokens_print.
7681 * src/tables.c: Update English in comments.
7682 (conflict_row, action_row): Update uses.
7683 * tests/glr-regression.at
7684 (Incorrect lookahead during deterministic GLR,
7685 Incorrect lookahead during nondeterministic GLR): Rename
7686 print_look_ahead to print_lookahead.
7687 * tests/torture.at: Update English in comments.
7688 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7689 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7690 (Many lookahead tokens): Update uses.
7691 * data/glr.c: Update English in comments.
7692 * lalr1.cc: Likewise.
7693 * yacc.c: Likewise.
7694 * src/conflicts.h: Likewise.
7695 * src/lalr.h: Likewise.
7696 * src/main.c: Likewise.
7697 * src/output.c: Likewise.
7698 * src/parse-gram.c: Likewise.
7699 * src/tables.h: Likewise.
7700 * tests/calc.at: Likewise.
7701
3c40d0b5
JD
77022006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7703
7704 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7705
5d278082
PE
77062006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7707
7708 * TODO: Add request from Nelson H. F. Beebe to be able to install
7709 Bison without installing the yacc script.
7710
9e668899
JD
77112006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7712
7713 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7714 and yytext if they're already #define'd.
7715 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7716 * src/scan-code-c.c: ... here.
7717 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7718 <config.h>.
7719
0c8e079f
JD
77202006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7721
7722 Get Bison to build again when configured with --enable-gcc-warnings.
7723 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7724 missing #include's.
7725 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7726 loc argument as it shadows a global.
7727 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7728 invocation.
7729
7730 * src/.cvsignore: Add scan-code.c.
7731
2346344a
AD
77322006-06-07 Akim Demaille <akim@epita.fr>
7733
7734 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7735 to...
7736 * src/scan-code.l: here.
7737 * tests/input.at (Torturing the Scanner): Fix another location
7738 error.
7739
4862bdfd
AD
77402006-06-07 Akim Demaille <akim@epita.fr>
7741
7742 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7743
e9071366
AD
77442006-06-06 Akim Demaille <akim@epita.fr>
7745
7746 Extract the parsing of user actions from the grammar scanner.
7747 As a consequence, the relation between the grammar scanner and
7748 parser is much simpler. We can also split "composite tokens" back
7749 into simple tokens.
7750 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7751 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7752 rename as...
7753 * src/location.h, src/location.c (add_column_width)
7754 (location_compute): these.
7755 Fix the column count: the initial column is 0.
7756 (location_print): Be robust to ending column being 0.
7757 * src/location.h (boundary_set): New.
7758 * src/main.c: Adjust to scanner_free being renamed as
7759 gram_scanner_free.
7760 * src/output.c: Include scan-code.h.
7761 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7762 Use boundary_set.
7763 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7764 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7765 which is now, again, a separate token.
7766 Adjust all dependencies.
7767 Whereever actions with $ and @ are used, use translate_code.
7768 (action): Remove this nonterminal which is now useless.
7769 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7770 (grammar_current_rule_action_append): Use translate_code.
7771 (packgram): Bound check ruleno, itemno, and rule_length.
7772 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7773 (last_string, last_braced_code_loc, max_left_semantic_context)
7774 (scanner_initialize, scanner_free, scanner_last_string_free)
7775 (gram_out, gram_lineno, YY_DECL_): Move to...
7776 * src/scan-gram.h: this new file.
7777 (YY_DECL): Rename as...
7778 (GRAM_DECL): this.
7779 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7780 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7781 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7782 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7783 Move these declarations, and...
7784 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7785 these to...
7786 * src/flex-scanner.h: this new file.
7787 * src/scan-gram.l (rule_length, rule_length_overflow)
7788 (increment_rule_length): Remove.
7789 (last_braced_code_loc): Rename as...
7790 (gram_last_braced_code_loc): this.
7791 Adjust to the changes of the parser.
7792 Move all the handling of $ and @ into...
7793 * src/scan-code.l: here.
7794 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7795 (handle_action_dollar, handle_action_at): Move to...
7796 * src/scan-code.l: here.
7797 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7798 scan-code.h, scan-code-c.c, scan-gram.h.
7799 (EXTRA_bison_SOURCES): Add scan-code.l.
7800 (BUILT_SOURCES): Add scan-code.c.
7801 (yacc): Be robust to white spaces.
7802
7803 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7804 * tests/regression.at: Adjust the column numbers.
7805 * tests/regression.at: Adjust the error message.
7891a7c4 7806
184e42f0
JD
78072006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7808
7809 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7810 Use Akim's wording from
7811 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7812
7891a7c4
JD
78132006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7814
7815 Between Bison releases, manually append `+' to the previous Bison
7816 release number, and use that as a signal to automatically print the
7817 ChangeLog's CVS Id keyword from --version. Discussed starting at
7818 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7819 * ChangeLog: Add Id header.
7820 * configure.ac (AC_INIT): Append `+' to `2.3'.
7821 * src/.cvsignore: Add revision.c.
7822 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7823 (BUILT_SOURCES): Add revision.c.
7824 (revision.c): New target rule. This file defines a new global variable
7825 named revision. It initializes it with either the Id from ChangeLog
7826 or, if VERSION doesn't contain `+', with the empty string.
7827 * src/getargs.c (version): Print the value of revision.
7828 * src/revision.h: Extern revision.
7829
4ad3ed84
PE
78302006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7831
7832 * NEWS: Version 2.3.
7833 * configure.ac (AC_INIT): Likewise.
7834
02103984
PE
78352006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7836
7837 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7838 with no arguments, not as an object-like macro. This is for
7839 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7840 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7841 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7842 Document this.
7843
2c08afa5
JD
78442006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7845
7846 * src/getargs.c (usage): Back out yesterday's modification of the
7847 --help output so that we don't have to wait for translation before
7848 releasing 2.3.
7849
6077da58
PE
78502006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7851
7852 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7853 Problem reported by Akim Demaille.
7854
2a26b6c2
JD
78552006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7856
7857 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7858
aefef0d6
PE
78592006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7862 generated source code. Problem reported by Frans Englich in
7863 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7864
fcd8e201
PE
78652006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7866
7867 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7868 shell, not within 'make', so that 'make' by an ordinary builder
7869 (using GNU make) does not worry about configuring gzip. This also
7870 works around a bug reported independently by Keith Thompson and by
7871 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7872 stderr rather than stdout, messing up the build logs.
7873
7b5cdcbd
JD
78742006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7875
7876 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7877 to make sure that YYID will never be unused. This fixes a 'make
7878 maintainer-check' failure caused by the recent changes to the 'Trivial
7879 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7880 not used.
7881 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7882
5ad0a449
JD
78832006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7884
7885 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7886 state before an empty RHS is always resolved here. Only the location
7887 of that state is guaranteed to be resolved, and that's enough. This
7888 fixes the remaining bug reported by Derek M. Jones in
7889 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7890 * tests/glr-regression.at (Uninitialized location when reporting
7891 ambiguity): Test the above case.
7892 Also, the embedded comments in this test case claim it checks the case
7893 of an empty RHS that has inherited the initial location. However, the
7894 corresponding LHS was already resolved, so yyresolveLocations didn't
7895 actually have reason to modify it. Fix this by forcing
7896 nondeterministic operation at the beginning of the parse.
7897
50cce58e
PE
78982006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7899
7900 * data/c.m4 (b4_yy_symbol_print_generate):
7901 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7902 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7903 of the bugs reported today by Derek M Jones in
7904 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7905 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7906 defined to be a type name without parens or brackets.
7907 (Location Type): Similarly for YYLTYPE.
7908 * tests/regression.at (Trivial grammars): Put in a test for this
7909 bug that will be caught by 'make maintainer-check' (though not,
7910 alas, by 'make check' unless your compiler is picky).
7911
ab8d9dc5
PE
79122006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7913
0d2c8934 7914 * NEWS: Version 2.2.
ab8d9dc5
PE
7915 * configure.ac (AC_INIT): Likewise.
7916
9138c575
JD
79172006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7918
7919 * data/glr.c (yyreportTree): Make room in yystates for the state
7920 preceding the RHS. This fixes the segmentation fault reported by Derek
7921 M. Jones in
7922 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7923 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7924 to the user. Reported for yyreportTree by Derek M. Jones later in the
7925 same thread.
7926 * THANKS: Add Derek M. Jones.
7927 Update my email address.
7928 Fix typo in Steve Murphy's name.
7929
276f48df
PE
79302006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7931
d6645148
PE
7932 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7933 checking against YYLAST that caused the parser to miss a potential
7934 alternative in its diagnostic.
7935 Problem reported by Maria Jose Moron Fernandez in
7936 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7937 * data/lalr1.cc (yysyntax_error_): Likewise.
7938 * data/yacc.c (yysyntax_error): Likewise.
7939 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7940 tokens, in case we run into an older C compiler.
7941 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7942 Use them to check for the off-by-one error fixed above.
7943
276f48df
PE
7944 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7945 YYSIZE_T, not size_t.
7946 * tests/regression.at (Trivial grammars): New test, to catch
7947 the error fixed by the above patch.
7948
cd8b5791
AD
79492006-05-14 Akim Demaille <akim@lrde.epita.fr>
7950
7951 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7952 scheme.
7953 Reported by Steve Murphy.
7954
34376418
AD
79552006-05-14 Akim Demaille <akim@lrde.epita.fr>
7956
7957 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7958 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7959
327afc7c
AD
79602006-05-14 Akim Demaille <akim@lrde.epita.fr>
7961
7962 Implement --trace=m4.
7963 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7964 * src/output.c (output_skeleton): When set, pass -dV to m4.
7965
7966 Factor the handling of flags in m4.
7967 * src/output.c (prepare): Rename the muscle names debug, defines,
7968 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7969 * data/c.m4: Adjust.
7970 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7971 Use b4_define_flag_if to define other b4_FLAG_if macros.
7972 (b4_location_if): As a consequence, rename as...
7973 (b4_locations_if): this, for consistency.
7974 Adjust all the skeletons.
7975
ba9ecd19
AD
79762006-05-14 Akim Demaille <akim@lrde.epita.fr>
7977
7978 * etc/bench.pm: Shorten bench names.
7979
4e83ea15
AD
79802006-05-14 Akim Demaille <akim@lrde.epita.fr>
7981
7982 * src/output.h, src/output.c (error_verbose): Move to...
7983 * src/getargs.h, src/getargs.c: here.
7984 Sort the flags.
7985 Adjust dependencies.
7986
6e93d810
PE
79872006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7988
7989 * data/c.m4 (b4_copyright): Put the special exception for Bison
7990 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
7991 uses changed. Suggested by Akim Demaille. Also, wrap the
7992 copyright notice, in case it is longer than 80 columns. Replace
7993 comma by newline after title.
6e93d810 7994
eaea13f5
PE
79952006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7996
7997 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7998 incompatibility, not a bug. Mention that it wasn't fixed as of
7999 flex 2.5.33.
8000
3cf084ec
AD
80012006-05-11 Akim Demaille <akim@lrde.epita.fr>
8002
8003 * examples/extexi: Enforce the precedence of concatenation over
8004 >>.
0a9f1c7d 8005 Reported by Tommy Nordgren.
3cf084ec 8006
32c96bd7
AD
80072006-05-11 Akim Demaille <akim@lrde.epita.fr>
8008
8009 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8010 with the member "token".
f94705b2 8011 Reported by Martin Nylin.
32c96bd7 8012
eaea13f5
PE
80132006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8014
8015 * data/glr.c: Switch to Bison 2.2 special-exception language in
8016 the copyright notice. Use more-regular format for titles and
8017 copyright notices.
8018 * data/glr.cc: Likewise.
8019 * data/location.cc: Likewise.
8020 * data/yacc.cc: Likewise.
8021 * doc/bison.texinfo (Conditions): Document this.
8022 * NEWS: likewise. Upgrade version to 2.2.
8023
6e2d1146
AD
80242006-04-27 Akim Demaille <akim@lrde.epita.fr>
8025
8026 * data/glr.cc: Remove dead code.
8027
47671055
PE
80282006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8029
8030 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8031 that variable and the line breaks the bootstrap. Problem reported
8032 by Juan M. Guerrero.
8033
ed2e6384
AD
80342006-04-24 Akim Demaille <akim@lrde.epita.fr>
8035
8036 * doc/bison.texinfo (Multiple start-symbols): New.
8037
3cedc2dc
AD
80382006-04-24 Akim Demaille <akim@lrde.epita.fr>
8039
8040 * etc/README, etc/bench.pl: New.
8041
b2ddc3f3
AD
80422006-04-03 Akim Demaille <akim@lrde.epita.fr>
8043
8044 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8045 rule.
8046 Reported by Mickael Labau.
8047 * tests/input.at (Torturing the Scanner): Test it.
8048
91e3ac9a
PE
80492006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8050
8051 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8052 Problem reported by Bob Rossi.
8053
80542006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8055
8056 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8057 and didn't really work.
8058 For the index, use @ifnotinfo, not @iftex.
8059 Minor cleanups of spacing and terminology.
8060
5cf61e93
AD
80612006-03-12 Akim Demaille <akim@lrde.epita.fr>
8062
8063 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8064 of AT_NAME_PREFIX when %name-prefix is not used.
8065
aa08666d
AD
80662006-03-12 Akim Demaille <akim@lrde.epita.fr>
8067
8068 Apply --prefix to C++ skeletons too: they change the namespace.
8069 The test suite already exercize these cases.
8070 * data/c++.m4 (b4_namespace): New.
8071 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8072 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8073 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8074 * doc/bison.texinfo: Document it.
8075 (Option Cross Key): Use @multitable in all formats. It looks
8076 nicer, even in TeX outputs.
8077 (Rules): Use the same code whatever the output type is.
8078 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8079 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8080 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 8081
45567173
AD
80822006-03-10 Akim Demaille <akim@lrde.epita.fr>
8083
8084 * TODO: Remove dead items.
8085
e9d8f881 80862006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
8087
8088 * doc/FAQ: Remove, merged into...
8089 * doc/bison.texinfo (FAQ): this.
8090 * doc/Makefile.am (EXTRA_DIST): Adjust.
8091
c095d689
AD
80922006-03-10 Akim Demaille <akim@lrde.epita.fr>
8093
8094 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8095 even if empty.
8096 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8097 * doc/bison.texinfo (Calc++ Scanner): Use it.
8098
6e0f8287
PE
80992006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8100
8101 Fix two nits reported by twlevo, plus one more that I discovered.
8102
8103 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8104 this is the usual Bison style.
8105 * src/location.h (location_print): Likewise.
8106
8107 * src/reader.h (token_name): Likewise.
8108
d6b771c3
PE
81092006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8110
8111 Fix some nits reported by twlevo.
8112 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8113 and "POSIX". Use more-modern syntax for URLs. Mention C++
8114 and ask for Java. Don't hardwire OS version numbers. Add
8115 copyright notice.
8116 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8117 * src/conflicts.c (solved_conflicts_obstack): Now static.
8118
1e137b71
JD
81192006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8120
8121 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8122 page. Say "you can use it" not "you may use it" as on the web page;
8123 we're describing capabilities not granting permission.
8124
73f2e47e
PE
81252006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8126
6d05403d
PE
8127 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8128 shadowing warnings. Use usual patter for iterating through RHS.
8129 * tests/glr-regression.at
8130 (Uninitialized location when reporting ambiguity):
8131 Modify yylex so that it uses its argument, rather than trying
8132 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8133 const char -> char const.
8134
73f2e47e
PE
8135 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8136 Don't use tabs inside commands; it messes up 'ps'.
8137 Problem reported by twlevo.
8138
8710fc41
JD
81392006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8140
8141 * tests/glr-regression.at (Uninitialized location when reporting
8142 ambiguity): New test case.
8143 * data/glr.c (yyresolveLocations): New function, which uses
8144 YYLLOC_DEFAULT.
8145 (yyresolveValue): Invoke yyresolveLocations before reporting an
8146 ambiguity.
8147 * doc/bison.texinfo (Default Action for Locations): Note
8148 YYLLOC_DEFAULT's usage for ambiguity locations.
8149 (GLR Semantic Actions): Cross-reference those notes.
8150
ae952af2
JD
81512006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8152
8153 * tests/glr-regression.at (Leaked semantic values when reporting
8154 ambiguity): Remove unnecessary union and type declarations.
8155 (Leaked lookahead after nondeterministic parse syntax error): New test
8156 case.
8157 * data/glr.c (yyparse): Check for zero stacks remaining before
8158 attempting to shift the lookahead so that you don't lose it.
8159
35ee866a
JD
81602006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8161
8162 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8163 * tests/glr-regression.at (Leaked semantic values when reporting
8164 ambiguity): New test case.
8165 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8166 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8167 now unnecessary yystackp parameter.
8168 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8169 destructors can be called.
8170
8171 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8172 in existing testcases.
8173
520181ab
JD
81742006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8175
8176 Don't leak semantic values for parent RHS when a user action cuts the
8177 parser, and clean up related code a bit.
8178 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8179 cuts parse): Rename to...
8180 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8181 for leaked parent RHS values.
8182 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8183 between an unresolved state (non-empty chain of semantic options) and
8184 an incomplete one (signaled by an empty chain).
ae952af2 8185 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8186 successfully or unsuccessfully resolved yyGLRState to...
8187 (yyresolveValue): ... here so that yyresolveValue always leaves a
8188 yyGLRState with consistent data and thus is easier to understand.
8189 Remove the yyvalp and yylocp parameters since they are always just
8190 taken from the yys parameter. When reporting a discarded merged value
8191 in debugging output, note that it is incompletely merged. Document the
8192 interface.
8193 (yyresolveAction): If resolving any of the RHS states fails, destroy
8194 them all rather than leaking them. Thus, as long as user actions are
8195 written to clean up the RHS correctly, yyresolveAction always cleans up
8196 the RHS of a semantic option. Document the interface.
8197
18d9185c
PE
81982006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8199
8200 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8201 led to a segmentation fault in GNU Pascal. Problem reported
8202 by Waldek Hebisch.
8203
841a7737
JD
82042006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8205
8206 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8207 mid-rule action inside a nonterminal symbol in order to declare a
8208 destructor for its semantic value.
8209
fc3f467f
PE
82102006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8211
8212 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8213 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8214 __cplusplus && ! defined _STDLIB_H && !
8215 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8216 defined free))]: Include <stdlib.h> rather than rolling our own
8217 declarations of malloc and free, to avoid problems with
8218 incompatible declarations (using 'throw') C++'s stdlib.h. This
8219 should fix Debian bug 340012
8220 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8221 reported by Guillaume Melquiond.
8222
a3af26dd
PE
82232006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8224
4d7bc38c
PE
8225 * NEWS: Clarify symbols versus types in unused-value warnings.
8226
a3af26dd
PE
8227 * configure.ac (AC_INIT): Bump version number.
8228
4e26c69e
PE
82292006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8230
8231 * NEWS: Version 2.1a.
8232 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8233 since C99 requires this.
8234
498e897c
PE
82352006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8236
8237 * m4/c-working.m4: New file.
8238 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8239
57bb17ca
PE
82402006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8241
8242 * Makefile.maint: Merge from coreutils.
8243
0be105dc
PE
82442006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8245
8246 More portability fixes for problems summarized by Nelson H. F. Beebe.
8247
8248 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8249 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8250 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8251 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8252 messes up because C++ code is compiled in 32-bit mode but linked
8253 in 64-bit mode.
8254
6fc0c024
PE
82552006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8256
8257 More portability fixes for problems summarized by Nelson H. F. Beebe.
8258
7870f699
PE
8259 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8260 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8261
6fc0c024
PE
8262 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8263 nodist_PROGRAMS, since we don't need to actually compile the
8264 example if we're just doing a plain 'make'. This avoids bothering
8265 the installer unnecessarily about problems due to weird C++
8266 compilers.
8267
fe6c2fde
PE
82682006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8269
8270 More portability fixes for problems summarized by Nelson H. F. Beebe.
8271
8272 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8273 than #include "...", and compile with -I'.'. The old method was
8274 not portable, according to Posix and the C standard, and it does
8275 not work with Sun C 5.7, where previous #line directives affect
8276 the working directory used in later #include "..." directives.
8277
927b425b
JMG
82782006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8279
8280 Various DJGGP specific issues in /djgpp
8281
d9735e9e
PE
82822006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8283
8284 More portability fixes for problems summarized by Nelson H. F. Beebe.
8285
8286 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8287 '#include <map>' works and that you can apply ++ to iterators.
8288
5a6755af
PE
82892006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8290
67a0dc4f
PE
8291 Work around portability problems summarized by Nelson H. F. Beebe in
8292 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8293
8c86f0ef
PE
8294 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8295 that '#include <string>' works.
8296
de35dd59
PE
8297 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8298 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8299 "warning: sorry: semantics of inline function static data `const
8300 unsigned char translate_table[262]' are wrong (you'll wind up with
8301 multiple copies)".
8302
67a0dc4f
PE
8303 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8304 or, xor to not_, and_, or_, and xor_, respectively. This works
8305 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8306 random system header somewhere that includes the equivalent of
8307 <iso646.h>.
8308
5a6755af
PE
8309 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8310 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8311 Suite Version 2.0.
5a6755af 8312
3f001415
JD
83132006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8314
8315 During deterministic GLR operation, user actions should be able to
8316 influence the parse by changing yychar. To make this easier to fix and
8317 to make glr.c easier to evolve in general, don't maintain yytoken in
8318 parallel with yychar; just compute yytoken when needed.
8319 * tests/glr-regression.at (Incorrect lookahead during deterministic
8320 GLR): Check that setting yychar in a user action has the intended
8321 effect.
8322 * data/glr.c (yyGLRStack): Remove yytokenp member.
8323 (yyclearin): Don't set *yytokenp.
8324 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8325 yychar rather than *yytokenp to determine the current lookahead.
8326 Compute yytoken locally when needed.
8327 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8328 point to.
8329
8330 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8331 after `--report' documentation.
8332
e2a8c0f5
PE
83332006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8334
8335 * src/parse-gram.y (grammar_declaration): Location of printer
8336 symbol is @1, not list->location. Bug reported by twlevo.
8337 * tests/input.at (Incompatible Aliases): Adjust to above change.
8338
6b702268
PE
83392006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8340
27622431
PE
8341 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8342 all the test at once. This makes the output easier to read in the
8343 normal case.
8344
6b702268
PE
8345 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8346 got from <http://bro-ids.org/download.html>. The bug is that
8347 when two actions appeared in succession, the second one was
8348 scanned before the first one was added to the grammar rule
8349 as a midrule action. Bison then output the incorrect warning
8350 "parse.y:905.17-906.36: warning: unused value: $3".
8351 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8352 associated with a value.
8353 (rhs): Don't invoke grammar_current_rule_action_append.
8354 (action): Invoke it here instead.
8355 * src/reader.c (grammar_midrule_action): Now extern.
8356 (grammar_current_rule_action_append): Don't invoke
8357 grammar_midrule_action; that is now the scanner's job.
8358 * src/reader.h (last_string, last_braced_code_loc):
8359 (grammar_midrule_action): New decls.
8360 * src/scan-gram.l (last_string): Now extern, sigh.
8361 (last_braced_code_loc): New extern variable.
8362 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8363 rule already has an action.
8364 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8365 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8366 Add some tests to check that the above changes fixed the bug.
8367
d40ba6c2
PE
83682006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8369
8370 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8371 All used changed. Check whether the symbol has a destructor,
8372 not whether it is typed.
8373 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8374 that the values are still reported as unused. All line numbers
8375 adjusted.
8376
401aace6
PE
83772006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8378
8379 Work around a bug in bro 0.8, which underparenthesizes its
8380 definition of YYLLOC_DEFAULT.
8381 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8382 their arguments.
8383 * data/lalr1.cc: Likewise.
8384 * data/yacc.cc: Likewise.
8385
06f01bc4
PE
83862006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8387
401aace6
PE
8388 Work around a bug in Pike 7.0, and give the Pike folks a
8389 better way to override the usual int widths.
8390 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8391 user can override the types.
8392 (short): #undef, to work around a bug in Pike 7.0.
8393 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8394 (union yyalloc.yyss): Use yytype_int16 rather than short.
8395 All uses changed.
8396 (yysigned_char): Remove.
8397 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8398 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8399 * tests/regression.at (Web2c Actions): Adjust to above changes.
8400
8401 * src/reader.c (check_and_convert_grammar): New function.
8402 (reader): Close the input file even if something went wrong during
8403 parsing. Minor file descriptor leak reported by twlevo.
8404
06f01bc4
PE
8405 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8406 to pacify gcc -Wswitch-default.
8407 * src/scan-gram.l (adjust_location): Use a default: break; case
8408 to pacify gcc -Wswitch-default.
8409 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8410 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8411 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8412 Move these decls to scan-skel.l, since they don't need to be
8413 visible elsewhere.
8414 * src/scan-skel.l: Accept the above decls.
8415 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8416 is used.
8417
02650b7f
PE
84182006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8419
8420 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8421 since we don't want to insist on a version number at the start
8422 of the changelog every time.
8423 * Makefile.maint: Sync from coreutils a bit better.
8424 (sc_trailing_blank): Renamed from sc_trailing_space.
8425 All uses changed.
8426 (sc_no_if_have_config_h, sc_require_config_h):
8427 (sc_prohibit_assert_without_use): New rules.
8428 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8429 (sc_dd_max_sym_length): Fix leading spaces in rule.
8430 (sc_system_h_headers): Prefix with @.
8431 (sc_useless_cpp_parens, m4-check): Output line numbers.
8432 (changelog-check): Allow version only in head.
8433 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8434 satisfy new Makefile.maint rule.
8435 * data/glr.c: Likewise.
8436 * data/glr.cc: Likewise.
8437 * data/lalr1.cc: Likewise.
8438 * data/yacc.c: Likewise.
8439 * lib/ebitsetv.c: Likewise.
8440 * lib/lbitset.c: Likewise.
8441 * lib/subpipe.c: Likewise.
8442 * lib/timevar.c: Likewise.
8443 * src/system.h: Likewise.
8444 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8445 * djgpp/Makefile.maint: Add copyright notice.
8446 * djgpp/README.in: Likewise.
8447 * djgpp/config.bat: Likewise.
8448 * djgpp/config.site: Likewise.
8449 * djgpp/config_h.sed: Likewise.
8450 * djgpp/djunpack.bat: Likewise.
8451 * djgpp/config.sed: Fix copyright notice to match standard format.
8452 * djgpp/subpipe.h: Likewise.
8453 * lib/bitsetv-print.c: Likewise.
8454 * lib/bitsetv.c: Likewise.
8455 * lib/subpipe.h: Likewise.
8456 * lib/timevar.c: Likewise.
8457 * lib/timevar.h: Likewise.
8458 * djgpp/subpipe.c: Use standard recipe for config.h.
8459 * lib/abitset.c: Likewise.
8460 * lib/bitset.c: Likewise.
8461 * lib/bitset_stats.c: Likewise.
8462 * lib/bitsetv-print.c: Likewise.
8463 * lib/bitsetv.c: Likewise.
8464 * lib/ebitsetv.c: Likewise.
8465 * lib/get-errno.c: Likewise.
8466 * lib/lbitset.c: Likewise.
8467 * lib/subpipe.c: Likewise.
8468 * lib/timevar.c: Likewise.
8469 * lib/vbitset.c: Likewise.
8470 * tests/local.at: Likewise.
8471 * src/scan-gram.l: Don't include verify.h, since system.h does
8472 that for us.
8473 * .x-sc_require_config_h: New file.
8474 * .x-sc_unmarked_diagnostics: New file.
8475
287c78f6
PE
84762006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8477
287c78f6
PE
8478 Be a bit more systematic about using 'abort'.
8479 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8480 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8481 Put 'default: abort ();' before some other case, to satisfy older
8482 pedantic compilers.
8483 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8484 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8485 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8486 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
8487 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8488 (get_decision_str, get_orientation_str, get_node_alignment_str):
8489 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8490 (get_linestyle_str, get_arrowstyle_str): Likewise.
8491 * src/conflicts.c (resolve_sr_conflict):
8492 Use a default case rather than one for the one remaining enum
8493 value, to catch invalid enum values as well.
8494 * src/lalr.c (set_goto_map, map_goto):
8495 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8496 * src/nullable.c (nullable_compute, token_definitions_output):
8497 Likewise.
8498 * src/reader.c (packgram, reader): Likewise.
8499 * src/state.c (transitions_to, state_new, state_reduction_find):
8500 Likewise.
8501 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8502 (symbol_pack): Likewise.
8503 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
8504 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8505 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
8506 * src/system.h: Don't include <assert.h>.
8507 (assert): New macro.
8508
8509 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8510 (Destructor Decl, Parser Function, Pure Calling):
8511 Describe rules for braces inside C code more carefully.
287c78f6 8512
c66dfadd
PE
85132006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8514
c21493b8
PE
8515 Fix some porting glitches found by Nelson H. F. Beebe.
8516 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8517 compilers that don't understand that abort () does not return.
8518 * src/state.c (transitions_to): Likewise.
8519 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8520 that '#include <cstdlib>' works.
8521 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8522 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8523 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8524 for the benefit of some pre-C99 compilers.
8525
b6e3facf
PE
8526 * bootstrap: Undo changes to gnulib files that autoreconf made.
8527
c66dfadd
PE
8528 Minor fixups to get 'make maintainer-check' to work.
8529 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8530 with the new verify.h implementation.
8531 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8532 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8533 * data/yacc.c (YYUSE): Likewise.
8534 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8535 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8536 * src/parse-gram.y (declaration): Don't pass a string constant
8537 to a function that expects char *, since GCC might complain
8538 about the constant value.
8539 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8540 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8541 before #defining them.
8542 * tests/glr-regression.at
8543 (Incorrectly initialized location for empty right-hand side in GLR):
8544 In yyerror, use the msg arg.
8545 (Corrupted semantic options if user action cuts parse):
8546 (Incorrect lookahead during deterministic GLR):
8547 (Incorrect lookahead during nondeterministic GLR):
8548 Don't name a local var 'index'; it shadows string.h's 'index'.
8549
ed94ef2a
AD
85502006-01-19 Akim Demaille <akim@epita.fr>
8551
8552 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8553 location, not just parts of it.
8554
e9ad4aec
PE
85552006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8556
d6ca7905
PE
8557 * NEWS: Document the fact that multiple %unions are now allowed.
8558 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
8559 * TODO: This feature is now implemented, so remove it from
8560 the wishlist.
d6ca7905 8561
ef1b70e0
PE
8562 * Makefile.maint: Merge with coreutils Makefile.maint.
8563 (CVS_LIST): Use build-aux version if available.
8564 (VERSION_REGEXP): New macro.
8565 (syntax-check-rules): Add sc_no_if_have_config_h,
8566 sc_prohibit_assert_without_use, sc_require_config_h,
8567 sc_useless_cpp_parens.
8568 (sc_obsolete_symbols): Check for O_NDELAY.
8569 (sc_dd_max_sym_length): Track coreutils.
8570 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8571 (sc_useless_cpp_parens): New rule.
8572 (news-date-check): Look for version or today's date.
8573 (changelog-check): Don't require version number near head.
8574 (copyright-check): Use current year instead of hardwiring 2005.
8575 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8576 (announcement): Add --gpg-key-ID.
8577
8578 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8579 with "file system".
8580
2073ce56 8581 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
8582 array. Problem reported by twlevo.
8583 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8584 * src/lalr.c (build_relations): Rely on new sentinel.
8585 * src/gram.c (gram_free): Adjust to new sentinel.
8586
b7691f15
JD
85872006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8588
8589 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8590 yylookaheadNeeds. All uses updated.
8591 (yysplitStack): Rename local yynewLookaheadStatuses to
8592 yynewLookaheadNeeds.
8593 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8594 GLR): In comments, change `lookahead status' to `lookahead need'.
8595
ddee1b06
PH
85962006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8597
8598 * data/glr.c (yysplitStack): A little stylistic rewrite.
8599
12f4614d
PH
86002006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8601
8602 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8603
32c29292
JD
86042006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8605
8606 * doc/bison.texinfo: Fix some typos.
8607 (GLR Semantic Actions): New subsection discussing special
8608 considerations because GLR semantic actions might be deferred.
8609 (Actions): Mention look-ahead usage of yylval.
8610 (Actions and Locations): Mention look-ahead usage of yylloc.
8611 (Special Features for Use in Actions): Add YYEOF entry and mention it
8612 in the yychar entry.
8613 In the yychar entry, remove mention of the local yychar case (pure
8614 parser) since this is irrelevant information when writing semantic
148d66d8 8615 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
8616 yychar is otherwise described as an external variable.
8617 In the yychar entry, don't call it the `current' look-ahead since it
8618 isn't when semantic actions are deferred.
8619 In the yychar and yyclearin entries, add note about deferred semantic
8620 actions.
8621 Add yylloc and yylval entries discussing look-ahead usage.
8622 (Look-Ahead Tokens): When discussing yychar, don't call it the
8623 `current' look-ahead, and do mention yylval and yylloc.
8624 (Error Recovery): Cross-reference `Action Features' when mentioning
8625 yyclearin.
148d66d8 8626 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
8627 look-ahead.
8628 In the yylloc and yylval entries, mention look-ahead usage.
8629
de366a2f 86302006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
8631
8632 * tests/glr-regression.at: Update copyright year to 2006.
8633
bf70fa87
JD
86342006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8635
8636 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8637 use during nondeterministic operation to track which stacks have
8638 actually needed the current lookahead.
8639 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8640 Allocate, deallocate, resize, and otherwise shuffle space for
8641 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8642 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8643 appropriately during nondeterministic operation.
8644 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8645 members to store the current lookahead to be used by the deferred
8646 user action.
8647 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8648 from which the RHS is taken. Set the lookahead members of the new
8649 yySemanticOption according to the lookahead status for stack yyk.
8650 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8651 yyaddDeferredAction.
8652 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8653 members of yySemanticOption before invoking yyuserAction, and then set
8654 them back to their current values afterward.
8655 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8656 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8657 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8658 titles for consistency.
8659 (Leaked merged semantic value if user action cuts parse): In order to
8660 suppress lint warnings, use arguments in merge function, and assign
8661 char value < 128 in main.
8662 (Incorrect lookahead during deterministic GLR): New test case.
8663 (Incorrect lookahead during nondeterministic GLR): New test case.
8664
05449a2c
JD
86652006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8666
de366a2f 8667 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
8668 !yyvaluep as signal that no semantic value is available to print.
8669 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8670 to print a semantic value.
8671
4158e0a1 86722006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 8673
4158e0a1
JD
8674 * tests/glr-regression.at: For consistency with my newer test cases,
8675 don't thank myself.
8676
d659304d
JD
86772006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8678
8679 * data/glr.c (yyresolveValue): When merging semantic options, if at
8680 least one user action succeeds but a later one cuts the parse, then
8681 destroy the semantic value before returning rather than leaking it.
8682 (yyresolveStates): If a user action cuts the parse and thus
8683 yyresolveValue fails, ignore the (unset) semantic value rather than
8684 corrupting the yyGLRState, and empty the semantic options list since
8685 the user actions should have called all necessary destructors.
8686 Simplify code with YYCHK.
8687 * tests/glr-regression.at (Corrupted semantic options if user action
8688 cuts parse): New test case.
8689 (Undesirable destructors if user action cuts parse): New test case.
8690 Before applying any of this patch, this test case never actually failed
8691 for me... but only because the corrupted semantic options usually
8692 masked this bug.
8693 (Leaked merged semantic value if user action cuts parse): New test
8694 case.
8695
6ec2c0f2
AD
86962006-01-05 Akim Demaille <akim@epita.fr>
8697
8698 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8699
1b9c21fb
PE
87002006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8701
8702 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8703 _MSC_VER. Problem reported by Cenzato Marco.
8704 (b4_c_function_def): Use it.
8705 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8706 b4_c_modern.
8707 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8708 than rolling our own.
8709
84866159
AD
87102006-01-04 Akim Demaille <akim@epita.fr>
8711
8712 Also warn about non-used mid-rule values.
8713 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8714 member.
8715 (symbol_list_new): Adjust.
8716 * src/reader.c (symbol_typed_p): New.
8717 (grammar_rule_check): Use it.
8718 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8719 Check its rule.
8720 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8721 Use it.
8722 * tests/actions.at (Exotic Dollars): Adjust.
8723
378f4bd8
AD
87242006-01-04 Akim Demaille <akim@epita.fr>
8725
8726 * src/reader.c (grammar_midrule_action): If $$ is set in a
8727 mid-rule, move the `used' bit to its lhs.
8728 * tests/input.at (Unused values): New.
8729 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8730
e2a21b6f
PE
87312006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8732
54662697
PE
8733 * doc/bison.texinfo (Bison Options): Say more accurately what
8734 --yacc does.
8735 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8736 about declarations in the grammar when in Yacc mode, as POSIX does
8737 not require a diagnostic when the grammar uses extensions.
8738
8739 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8740
073f9288
PE
8741 Warn about dubious constructions like "%token T T".
8742 Reported by twlevo.
8743 * src/symtab.h (struct symbol.declared): New member.
8744 * src/symtab.c (symbol_new): Initialize it to false.
8745 (symbol_class_set): New arg DECLARING, specifying whether
8746 this is a declaration that we want to warn about, if there
8747 is more than one of them. All uses changed.
8748
1221b78a
PE
8749 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8750 Allow multiple %union directives, whose contents concatenate.
8751 * src/parse-gram.y (grammar_declaration): Likewise.
8752 Use muscle_code_grow, so that we don't need stype_line any more.
8753 All uses changed.
8754
8755 * src/muscle_tab.c (muscle_grow): Fix comment.
8756
e2a21b6f
PE
8757 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8758 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8759 Update copyright year to 2006.
8760
8f7e3cf9
AD
87612006-01-03 Akim Demaille <akim@epita.fr>
8762
8763 Have glr.cc pass (some of) the calc.at tests.
8764 * data/glr.cc (b4_parse_param_orig): New.
8765 (b4_parse_param): Improve its definition, and bound it more
8766 clearly in the skeleton.
8767 (b4_epilogue): Append, instead of prepending, in order to keep
8768 #line consistency.
8769 Simplify the generation of auxiliary functions: locations and
8770 purity are mandated.
8771 (b4_global_tokens_and_yystype): Honor it.
8772 * data/location.cc (c++.m4): Don't include it.
8773 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8774 and AT_SKEL_CC_IF.
8775 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8776 AT_LALR1_CC_IF.
8777 Be sure to initialize the first position's filename.
8778 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8779 mandated anyway.
8780 (AT_CHECK_CALC_GLR_CC): New.
8781 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8782
3953ed88
AD
87832006-01-02 Akim Demaille <akim@epita.fr>
8784
8785 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8786 c.m4.
0a96ba81 8787 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
8788 * data/glr.cc: Do not include stack.hh.
8789
9ecafbbf
AD
87902006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8791
8792 * data/glr.c: Reformat whitespace with tabs.
8793 (b4_lpure_formals): Remove this unused m4 macro.
8794 * tests/cxx-type.at: Reformat whitespace with tabs.
8795 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8796 since it's a member. Rename type to isNterm for clarity.
8797
c4d497a0
AD
87982005-12-29 Akim <akim@sulaco.local>
8799
8800 Let glr.cc catch up with symbol_value_print.
8801 * data/glr.cc (b4_yysymprint_generate): Replace by...
8802 (b4_yy_symbol_print_generate): this.
8803 (yy_symbol_print, yy_symbol_value_print): Declare them.
8804
4517da37
PE
88052005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8806
8807 * src/location.h (boundary): Note that a line or column equal
8808 to INT_MAX indicates an overflow.
8809 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8810 (rule_length_overflow, increment_rule_length, add_column_width):
8811 New functions.
8812 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8813 (<SC_BRACED_CODE>"}"):
8814 Use increment_rule_length rather than incrementing it by hand.
8815 (adjust_location, handle_syncline): Diagnose overflow.
8816 (handle_action_dollar, handle_action_at):
8817 Fix bug with monstrosities like $-2147483648.
8818 Remove now-unnecessary checks.
8819 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8820 (convert_ucn_to_byte): Verify assumptions.
8821 (handle_syncline): New arg LOC. All callers changed.
8822 Don't store through a value derived from char const * pointer.
8823
8824 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8825 GCC warnings.
8826
e3233bf6
PE
88272005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8828
8829 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8830 Remove unnecessary forward static decls.
8831
8f3596a6
AD
88322005-12-27 Akim Demaille <akim@epita.fr>
8833
8834 * src/reader.c (grammar_current_rule_check): Also check that $$
8835 is used.
8836 Take the rule to check as argument, hence rename as...
8837 (grammar_rule_check): this.
8838 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8839 Rename as...
8840 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8841 (grammar_midrule_action, grammar_symbol_append): Now static.
8842 * tests/torture.at (input): Don't rely on the default action
8843 being always performed.
8844 * tests/calc.at: "Set" $$ even when the action is "cut" with
8845 YYERROR or other.
8846 * tests/actions.at (Exotic Dollars): Instead of using unused
8847 values, check that the warning is issued.
8848
721be13c
PE
88492005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8850
8851 * NEWS: Improve wording for unused-value warnings.
8852
a0af42fc
AD
88532005-12-22 Akim Demaille <akim@epita.fr>
8854
8855 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8856 (b4_yysymprint_generate): Rename as...
8857 (b4_yy_symbol_print_generate): this.
8858 Generate yy_symbol_print instead of yysymprint.
8859 Generate also yy_symbol_value_print, and use it.
8860
affac613
AD
88612005-12-22 Akim Demaille <akim@epita.fr>
8862
721be13c 8863 * NEWS: Warn about unused values.
affac613
AD
8864 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8865 a `used' member.
8866 (symbol_list_n_get, symbol_list_n_used_set): New.
8867 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8868 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8869 * src/reader.c (grammar_current_rule_check): Check that values are
8870 used.
8871 * src/symtab.c (symbol_print): Accept 0.
8872 * tests/existing.at: Remove the type information.
8873 Empty the actions.
8874 Remove useless actions (beware of mid-rule actions: perl -000
8875 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8876 * tests/actions.at (Exotic Dollars): Use unused values.
8877 * tests/calc.at: Likewise.
8878 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8879 Likewise.
8880
8881 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8882 rule_useful_p.
8883
9d9b8b70
PE
88842005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8885
8bb4c753
PE
8886 Undo 2005-12-01 tentative license wording change. The wording is
8887 still being reviewed by the lawyers, and we don't want to wait for
8888 them before publishing a test release. For now, revert to the
8889 previous wording.
8890 * NEWS: Undo 2005-12-01 change.
8891 * data/glr.c: Revert to previous license wording.
8892 * data/glr.cc: Likewise.
8893 * data/lalr1.cc: Likewise.
8894 * data/location.cc: Likewise.
8895 * data/yacc.c: Likewise.
8896
9d9b8b70
PE
8897 * NEWS: Reword %destructor vs YYABORT etc.
8898 * data/glr.c: Use American spacing, for consistency.
8899 * data/glr.cc: Likewise.
8900 * data/lalr1.cc: Likewise.
8901 * data/yacc.c: Likewise.
8902 * data/yacc.c: Reformat comments slightly.
8903 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8904 for consistency. Fix some spelling errors and reword recently-included
8905 text slightly.
8906 * tests/cxx-type.at: Cast results of malloc, for C++.
8907
2c3b392a
AD
89082005-12-21 Joel E. Denny <address@hidden>
8909
8910 * tests/cxx-type.at: Construct a tree, count the parents of shared
8911 nodes, and free each node once and only once. Previously, the memory
8912 for semantic values was leaked instead.
8913
d6cff4dc
AD
89142005-12-21 Joel E. Denny <address@hidden>
8915
8916 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8917 (yylval, yylloc): If pure, #define to yystackp->yyval and
8918 yystackp->yyloc similar to yychar and yynerrs.
8919 (yyparse): If pure, remove local yylval and yylloc. Add local
8920 yystackp to accommodate pure definitions of yylval and yylloc.
8921 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8922 yylvalp and yyllocp to &yylval and &yylloc.
8923 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8924 namespace. Previously, nerrs and char were missing, but lval and lloc
8925 weren't necessary.
8926 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8927 yylvalp and yyllocp parameters since, if pure, these are now always
8928 accessible through yystackp. If not pure, they are still accessible
8929 globally.
8930 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8931 `if (YYID (N))' to pacify lint.
8932
a85284cf
AD
89332005-12-21 Akim Demaille <akim@epita.fr>
8934
8935 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8936 destroy the RHS symbols of a rule.
8937 * data/yacc.c (yylen): Initialize to 0.
8938 Keep its value to the number of items to possibly shift.
8939 In particular, a regular successful parse that ends on YYFINAL by
8940 a (internal) YYACCEPT must not have yylen != 0.
8941 (yyerrorlab, yyreturn): Pop the RHS.
8942 Reorder a bit to emphasize the `shifting' bits of code.
8943 (YYPOPSTACK): Now accept a number of items to pop.
8944 * data/lalr1.cc: Likewise.
8945 * data/glr.c: Formatting changes.
8946 Use goto instead of fall through.
8947 * doc/bison.texinfo (Destructor Decl): Complete.
8948
d508c281
JMG
89492005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8950
8951 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8952 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8953 * djgpp/config.bat: Replace every occurence of the file name
8954 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8955 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8956 * djgpp/config.sed: Replace every occurence of the file name
8957 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8958 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8959 * djgpp/djunpack.bat: DJGPP specific file.
8960 * djgpp/fnchange.lst: DJGPP specific file.
8961 * djgpp/README.in: Add new information about how to unpack the bison
8962 source on MSDOS and other systems which have 8.3 file name restrictions
8963 using djunpack.bat and fnchange.lst.
8964
3e7a2cd9
PE
89652005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8966
8967 * bootstrap (build_cvs_prefix): Remove; unused.
8968 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8969 when getting gnulib.
8970
89712005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8972
8973 * data/glr.c: Reorder typedef declarations for structs to match order
8974 of struct declarations.
8975 Rename yystack everywhere to yystackp except in yyparse where it's not
8976 a pointer.
8977 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8978 consistency.
8979 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8980 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8981 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8982 lint.
8983
877519f8
PE
89842005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8985
0eca5a39
PE
8986 * tests/sets.at (Accept): Fix typos in regular expression used to
8987 sed out the final state number.
8988
2cec9080
PE
8989 Work around portability problem on Solaris 10: flex-generated
8990 files include <stdio.h> before <config.h>, which messes up
8991 because the latter defines __EXTENSIONS__. Address the problem
8992 by creating two new little files that include <config.h> first,
8993 then include the flex-generated files. Rewrite everyone else
8994 to include <config.h> first, as well.
8995 * lib/timevar.c: Always include "config.h".
8996 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8997 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8998 (EXTRA_bison_SOURCES): New macro.
8999 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9000 * src/system.h: Don't include config.h.
9001 * src/LR0.c: Include <config.h> first.
9002 * src/assoc.c: Likewise.
9003 * src/closure.c: Likewise.
9004 * src/complain.c: Likewise.
9005 * src/conflicts.c: Likewise.
9006 * src/derives.c: Likewise.
9007 * src/files.c: Likewise.
9008 * src/getargs.c: Likewise.
9009 * src/gram.c: Likewise.
9010 * src/lalr.c: Likewise.
9011 * src/location.c: Likewise.
9012 * src/main.c: Likewise.
9013 * src/muscle_tab.c: Likewise.
9014 * src/nullable.c: Likewise.
9015 * src/output.c: Likewise.
9016 * src/parse-gram.y: Likewise.
9017 * src/print.c: Likewise.
9018 * src/print_graph.c: Likewise.
9019 * src/reader.c: Likewise.
9020 * src/reduce.c: Likewise.
9021 * src/relation.c: Likewise.
9022 * src/state.c: Likewise.
9023 * src/symlist.c: Likewise.
9024 * src/symtab.c: Likewise.
9025 * src/tables.c: Likewise.
9026 * src/uniqstr.c: Likewise.
9027 * src/vcg.c: Likewise.
9028
877519f8
PE
9029 * src/parse-gram.y: Fix minor problems uncovered by lint.
9030 (current_lhs, current_lhs_location): Now static.
9031 (current_assoc): Remove unused variable.
9032
9033 Cleanups so that Bison-generated parsers have less lint.
9034 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9035 Prepend /*ARGSUSED*/, for lint's sake.
9036 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9037 definition if 'lint' is defined.
9038 (YYID): New macro (or function, if lint).
9039 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9040 * data/yacc.c: Likewise.
9041 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9042 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9043 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9044 is C++ only.
9045 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9046 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9047 Use YYID(0) rather than 0, for lint.
9048 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9049 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9050
f5228370
PE
90512005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9052
9053 * tests/glr-regression.at
9054 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9055 Close memory leak reported by twlevo.
9056
69ce078b
PE
90572005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9058
6ff99711
PE
9059 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9060 all stacks.
9061 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
9062 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9063 New test case.
9064 (Duplicated user destructor for lookahead): This test now is expected
9065 to succeed.
9066
af3412cd
PE
90672005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9068
32b5b719 9069 * NEWS: Document the following change.
af3412cd
PE
9070 * data/yacc.c: Say "parser skeleton" rather than "file", since
9071 it's no longer just a file.
9072 * data/glr.c: Grant a special exception for C GLR parsers, that
9073 reads like the already-existing exception for C LALR(1) parsers.
9074 * data/glr.cc: Likewise.
9075 * data/lalr1.cc: Likewise.
9076 * data/location.cc: Likewise.
9077 * data/yacc.c: Reword the "written by" statement to clarify that
9078 it was the parser skeleton, not the entire output file.
9079 * data/glr.c: Written by Paul Hilfinger.
9080 * data/glr.cc: Written by Akim Demaille.
9081 * data/lalr1.cc: Likewise.
9082
035aa4a0
PE
90832005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9084
d9963c85
PE
9085 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9086 Fix typos in previous change that broke 'make check'.
9087 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9088 supported in C.
9089 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9090 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9091 We can revert this once things settle down.
9092
035aa4a0
PE
9093 * src/conflicts.c (conflicts_print): Don't print file name twice
9094 when %expect fails because there were no conflicts.
9095 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9096 change.
9097 * tests/conflicts.at (%expect not enough, %expect too much):
9098 (%expect with reduce conflicts): Adjust to new behavior.
9099
91002005-11-18 Akim Demaille <akim@epita.fr>
9101
9102 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9103 errors.
9104 * NEWS: Document this.
9105 * doc/bison.texinfo (Expect Decl): Likewise.
9106
d1ff7a7c
AD
91072005-11-16 Akim Demaille <akim@epita.fr>
9108
9109 Generalize the display of semantic values and locations in traces.
9110 * data/glr.c (yy_reduce_print): Fix indices (again).
9111 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9112 literal integers.
9113 * data/lalr1.cc (yyreduce_print): Rename as...
9114 (yy_reduce_print): this.
9115 Display values and locations.
9116 * data/yacc.c (yy_reduce_print): Likewise.
9117 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9118 (yysymprint): Move higher to be visible from yy_reduce_print).
9119 (yyparse): Adjust.
9120 * tests/calc.at: Adjust the expected length of the traces.
9121
6de5398d
AD
91222005-11-14 Akim Demaille <akim@epita.fr>
9123
9124 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9125 from 1 to N, while values and location start at 0.
9126 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9127
a1373f55
AD
91282005-11-14 Akim Demaille <akim@epita.fr>
9129
9130 * data/glr.c (yy_reduce_print): Fix the $ number.
9131
613d8952
AD
91322005-11-14 Akim Demaille <akim@epita.fr>
9133
9134 "Use" parse parameters.
9135 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9136 * data/glr.c, data/glr.cc: Use them.
9137 * data/glr.c (YYUSE): Have a C++ definition that supports
9138 non-pointer types.
9139
b2741627
AD
91402005-11-14 Akim Demaille <akim@epita.fr>
9141
9142 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9143
5059b5c8
AD
91442005-11-14 Akim Demaille <akim@epita.fr>
9145
42249483
AD
9146 * data/glr.cc: New.
9147 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 9148
4626a15d
AD
91492005-11-12 Akim Demaille <akim@epita.fr>
9150
9151 Let position and location be PODs.
9152 * data/location.cc (position::initialize, location::initialize): New.
9153 (position::position, location::location): Define only if
9154 b4_location_constructors is defined.
9155 * data/lalr1.cc (b4_location_constructors): Define it for backward
9156 compatibility.
9157 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9158
91592005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
9160
9161 * data/lalr1.cc: Move the body of the ctor and dtor into the
9162 parser file (instead of the header).
9163 Wrap the implementations in a "namespace yy".
9164
91652005-11-12 Akim Demaille <akim@epita.fr>
9166
9167 Have glr.c include its header file when created.
9168 * data/glr.c (b4_shared_declarations): New.
9169 Output them verbatim in the parser if !%defines, otherwise
9170 output then in the header file, and include it instead.
9171
1989d947
AD
91722005-11-11 Akim Demaille <akim@epita.fr>
9173
9174 * data/glr.c: Comment changes.
9175
91762005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9177
9178 When yydebug, report semantic and location values for reductions.
9179 * data/glr.c (yy_reduce_print): Report the semantic values and the
9180 locations.
9181 (YY_REDUCE_PRINT): Adjust.
9182 (yyglrReduce): Use them.
9183 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9184 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9185 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9186 traces.
9187
02998094
AD
91882005-11-10 Akim Demaille <akim@epita.fr>
9189
9190 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9191 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9192 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9193
5210672f
PE
91942005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9195
9196 * m4/cxx.m4, examples/Makefile.am: Don't build
9197 examples/calc++ if no C++ compiler is available. (trivial change)
9198
a8991a1d
AD
91992005-11-09 Akim Demaille <akim@epita.fr>
9200
9201 * src/scan-skel.l: Use a couple of asserts.
9202
36b5e963
AD
92032005-11-03 Akim Demaille <akim@epita.fr>
9204
9205 In some (weird) cases, the final state number is incorrect.
9206 Reported by Alexandre Duret-Lutz.
9207 * src/LR0.c (state_list_append): Remove the computation of
9208 final_state.
9209 (save_reductions): Do it here.
9210 (get_state): Alpha conversion.
9211 (generate_states): Use a for loop.
9212 * src/gram.h (item_number_is_rule_number)
9213 (item_number_is_symbol_number): New.
9214 * src/state.c: Use assert.
9215 * src/system.h: Include assert.h.
9216 * tests/sets.at (Accept): New.
9217
44e7ead1
PH
92182005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9219
9220 * data/glr.c (yyfill): Adjust comment.
36b5e963 9221 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9222 for empty right-hand sides.
9223 (yydoAction): Ditto.
9224 Add comment explaining apparently dead code.
36b5e963
AD
9225 * tests/glr-regression.at
9226 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9227 New test.
36b5e963 9228
e10a80ee
PE
92292005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9230
9231 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9232 gnulib when interrupted. This fixes some race conditions and
9233 works around some portability problems (one noted by Paul
9234 Hilfinger).
9235
067b32ee
AD
92362005-10-22 Akim <akim@epita.fr>
9237
9238 * Makefile.cfg: Adjust to config -> build-aux.
9239 Reported by twledo.
9240
4b367315
AD
92412005-10-21 Akim Demaille <akim@epita.fr>
9242
9243 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9244 the %parse-params.
9245 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9246 * data/yacc.c (b4_Pure_if): Rename as...
9247 (b4_yacc_pure_if): this.
9248 (YY_SYMBOL_PRINT, yyparse): Adjust.
9249 * doc/bison.texinfo: Formatting changes.
9250
24cc23d9
AD
92512005-10-21 Akim Demaille <akim@epita.fr>
9252
9253 Finish the transition config -> build-aux.
9254 * configure.ac, Makefile.am: Use build-aux.
9255 * config/prev-version, config/announce-gen, config/Makefile.am:
9256 Move to...
9257 * build-aux/prev-version, build-aux/announce-gen,
9258 * build-aux/Makefile.am: here.
9259
d4476375
AD
92602005-10-14 Akim Demaille <akim@epita.fr>
9261
9262 * examples/calc++/test: Use set -x only when VERBOSE.
9263
302c0aee
PE
92642005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9265
9266 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9267 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9268
7625ec2c
AD
92692005-10-13 Akim Demaille <akim@epita.fr>
9270
9271 * src/scan-skel.l: Output the base name parts of the parser and
9272 header file names.
302c0aee 9273 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9274 additional checks.
9275 Use this to exercise C++ outputs in subdirs.
9276 Reported by Oleg Smolsky.
9277
ba0fe3c7
PE
92782005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9279
9280 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9281 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9282 Problem reported by John P. Hartmann.
9283 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9284 already defined it.
9285
9b8a5ce0
AD
92862005-10-12 Akim Demaille <akim@epita.fr>
9287
9288 * src/parse-gram.y (version_check): Exit 63 to please missing
9289 (stands for "version mismatch).
9290 * tests/input.at, doc/bison.texinfo: Adjust.
9291
4f6e011e
PE
92922005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9293
9294 Work around portability problems with Visual Age C compiler
9295 (xlc and xlC_r) reported by John P. Hartmann.
9296 * data/location.cc (initial_column, initial_line): Remove.
9297 All uses replaced by 0 and 1.
9298 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9299 that xlc complains about.
9300 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9301 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9302 as __STDC__.
4d7aa45e
PE
9303 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9304 __STDC_VERSION__. Use it everywhere instead of looking at
9305 __STDC__ and __cplusplus.
4f6e011e 9306
a1b3bf8c
AD
93072005-10-10 Akim Demaille <akim@epita.fr>
9308
9309 * examples/calc++/test: Be quiet unless VERBOSE.
9310
412e44aa
PE
93112005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9312
2a4647a3
PE
9313 * data/c.m4 (yydestruct, yysymprint):
9314 Use YYUSE instead of casting to void.
9315 * data/glr.c (YYUSE): New macro.
9316 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9317 Use it instead of rolling our own.
9318 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9319 (YYCHK1):
9320 Use /*CONSTCOND*/ to suppress lint warnings.
9321 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9322 (YY_STACK_PRINT): Use 'false' not '0'.
9323 (YYUSE): New macro.
9324 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9325 * data/yacc.c (YYUSE): New macro.
9326 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9327 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9328 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9329
9330
412e44aa
PE
9331 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9332 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9333
88c6637f
PE
93342005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9335
2f4f028d
PE
9336 Undo the parts of the unlocked-I/O change that substituted
9337 putc or puts for printf. This might hurt performance a bit,
9338 but some people prefer the printf style.
9339 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9340 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9341 All uses replaced by YYFPRINTF and YYDPRINTF.
9342 * data/yacc.c: Likewise.
9343 * lib/bitset.c (bitset_print): Likewise.
9344 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9345 putc and puts.
9346 * lib/lbitset.c (debug_lbitset): Likewise.
9347 * src/closure.c (print_firsts, print_fderives): Likewise.
9348 * src/gram.c (grammar_dump): Likewise.
9349 * src/lalr.c (look_ahead_tokens_print): Likewise.
9350 * src/output.c (escaped_output): Likewise.
9351 (user_actions_output): Break apart two printfs.
9352 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9353 * src/reduce.c (reduce_print): Likewise.
9354 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9355 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9356
88c6637f
PE
9357 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9358 Use assignments rather than casts-to-void to suppress
9359 unused-variable warnings. This pacifies 'lint'.
9360 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9361 unused-variable warnings.
9362
fb32e373
JMG
93632005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9364
9365 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9366
edb8f44f
PE
93672005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9368
fb9c0b33
PE
9369 Use unlocked I/O for a minor performance improvement on hosts like
9370 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9371 is to use the gnlib unlocked-io module, and to prefer putc and
9372 puts to printf when either will work (since the latter doesn't
9373 come in an unlocked flavor).
9374 * bootstrap (gnulib_modules): Add unlocked-io.
9375 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9376 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9377 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9378 and similarly for puts and putc and printf.
9379 * data/yacc.c: Likewise.
9380 * lib/bitset.c (bitset_print): Likewise.
9381 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9382 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9383 to printf.
9384 * lib/lbitset.c (debug_lbitset): Likewise.
9385 * src/closure.c (print_firsts, print_fderives): Likewise.
9386 * src/gram.c (grammar_dump): Likewise.
9387 * src/lalr.c (look_ahead_tokens_print): Likewise.
9388 * src/output.c (escaped_output): Likewise.
9389 (user_actions_output): Coalesce two printfs.
2f4f028d 9390 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
9391 * src/reduce.c (reduce_print): Likewise.
9392 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 9393 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 9394
edb8f44f
PE
9395 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9396 this confuses xgettext.
9397
b50d2359
AD
93982005-10-02 Akim Demaille <akim@epita.fr>
9399
9400 * bootstrap (gnulib_modules): Add strverscmp.
9401 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9402 * m4/.cvsignore: Add strverscmp.m4.
9403 * src/parse-gram.y (%require): New token, new rule.
9404 (version_check): New.
9405 * src/scan-gram.l (%require): Adjust.
9406 * tests/input.at (AT_REQUIRE): New.
9407 Use it.
9408 * doc/bison.texinfo (Require Decl): New.
9409 (Calc++ Parser): Use %require.
9410
21667f64
AD
94112005-10-02 Akim Demaille <akim@epita.fr>
9412
9413 * data/location.cc: New.
9414
2b81e969
AD
94152005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9416 Akim Demaille <akim@epita.fr>
9417
9418 Make sure -odir/foo.cc creates dir/location.hh etc.
9419 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9420 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9421 (spec_defines_file): Now const.
9422 (dir_prefix): New.
9423 (short_base_name): Remove.
9424 * src/files.c: Adjust.
9425 (dirname.h): Include.
9426 (base_name): Don't prototype it.
9427 (finput): Remove, duplicates gram_in.
9428 (full_base_name, short_base_name): Replace by...
9429 (all_but_ext, all_but_tab_ext): these.
9430 (compute_base_names): Rename as...
9431 (compute_file_name_parts): this.
9432 Update to compute the new variables, including dir_prefix.
9433 Adjust dependencies.
9434 * src/output.c (prepare): Output them.
9435 * src/reader.c: Adjust to use gram_in, not finput.
9436 * src/scan-skel.l (@dir_prefix@): New.
9437
ad6a9b97
JMG
94382005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9439
9440 * lib/subpipe.c: New function end_of_output_subpipe() added
9441 to allow support for non-posix systems. This is a no-op function
9442 for posix systems.
9443
9444 * lib/subpipe.h: New function end_of_output_subpipe() added
9445 to allow support for non-posix systems. This is a no-op function
9446 for posix systems.
9447
9448 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9449 handle the lack of pipe/fork functionality on non-posix systems.
9450
9451 * djgpp/Makefile.maint: DJGPP specific file.
9452
9453 * djgpp/README.in: DJGPP specific file.
9454
9455 * djgpp/config.bat: DJGPP specific configuration file.
9456
9457 * djgpp/config.sed: DJGPP specific configuration file.
9458
9459 * djgpp/config.site: DJGPP specific configuration file.
9460
9461 * djgpp/config_h.sed: DJGPP specific configuration file.
9462
9463 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9464
9465 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9466
fc695704
AD
94672005-10-02 Akim Demaille <akim@epita.fr>
9468
9469 * data/location.cc: New, extract from...
9470 * data/lalr1.cc: here.
9471 (location.hh): Include it after the user prologue, in case the
9472 filename type is defined by the user.
9473 Forward declation location and position before the pre-prologue.
9474 (yyresult_): Rename as...
9475 (yyresult): this, it's a local variable, not an attribute.
9476 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9477
94782005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
9479
9480 * examples/extexi: Restore the #line generation.
9481
fb9712a9
AD
94822005-09-30 Akim Demaille <akim@epita.fr>,
9483 Alexandre Duret-Lutz <adl@gnu.org>
9484
9485 Move the token type and YYSTYPE in the parser class.
9486 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9487 (parser::token): New, from the moved free definition of tokens.
9488 (parser::semantic_value): Now a full definition instead of an
9489 indirection to YYSTYPE.
9490 (b4_post_prologue): No longer included in the header file, but
9491 in the implementation file.
9492 * doc/bison.texi (C+ Language Interface): Update.
9493 * src/parse-gram.y: Support unary %define.
9494 * tests/actions.at: Define global_tokens_and_yystype for backward
9495 compatibility until we update the tests.
9496 * tests/calc.at: Idem.
9497 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9498 to simplify the code.
9499
55f0c7b1
PE
95002005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9501
9502 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9503 Ah, the good old days! Problem reported by Peter Klein.
9504 * bootstrap (gnulib_modules): Add strerror, strtoul.
9505 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9506 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9507
fb9712a9 95082005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
9509
9510 * data/c.m4 (b4_error_verbose_if): New.
9511 * data/lalr1.cc: Use it.
9512 (YYERROR_VERBOSE_IF): Remove.
9513 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9514 parser members, replaced by...
9515 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9516 local variables.
9517 (yysyntax_error_): Takes the state number as argument.
9518 (yyreduce_print_): Use the argument yyrule, not the former
9519 attribute yyn_.
9520
8a6f72f3
PE
95212005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9522
9523 * bootstrap (gnulib_modules): Add verify.
9524 * lib/.cvsignore: Add verify.h.
9525 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9526 * src/system.h (verify): Remove.
9527 Include verify.h instead.
9528 * src/tables.c (tables_generate): Use new API for 'verify'.
9529
0d50976f
PE
95302005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9531
ebc3737e
PE
9532 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9533 local variables whose names begin with 'yy'.
9534 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9535 Trivial changes from Joel E. Denny.
9536
0d50976f
PE
9537 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9538 it itself.
9539 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9540 don't use alloca any more.
9541
9542 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9543 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 9544 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
9545 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9546 to match yacc.c, to test more hosts.
9547
a05b79df
PE
95482005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9549
55289366
PE
9550 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9551 doesn't affect behavior.
9552 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9553 Solaris, AIX, MSC.
9554 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9555 This works a bit better with glibc, if user code has already included
9556 stdlib.h.
9557 * doc/bison.texinfo (Bison Parser): Document that users can't
9558 arbitrarily use malloc and free for other purposes. Document
9559 that <alloca.h> and <malloc.h> might be included.
9560 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9561 user must declare alloca.
9562
a05b79df
PE
9563 * HACKING (release): Forwarn the Translation Project about
9564 stable releses.
9565
3ab2ca22
AD
95662005-09-20 Akim Demaille <akim@epita.fr>
9567
9568 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9569
a9739e7c
PE
95702005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9571
a702593e
PE
9572 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9573 (YYSTACK_ALLOC_MAXIMUM): Use it.
9574 (yysyntax_error): New function.
9575 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9576 multiple syntax errors are reported, and alloca is being used.
9577 Instead, reallocate buffers twice as big each time, so that
9578 we waste at most half the allocated memory. Start with a small
9579 (128-byte) buffer that will suffice in most cases anyway.
9580 Use yysyntax_error to do most of the work.
9581
9582 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9583 yynerrs is the number of errors reported, not the number of
9584 errors encountered.
9585
a9739e7c
PE
9586 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9587 Mark it as expected to fail.
9588 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9589 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9590 Don't start user-code symbols with "yy", to avoid name space problems.
9591
f479c6c6
AD
95922005-09-19 Akim Demaille <akim@epita.fr>
9593
9594 Remove the traits, failed experiment.
9595 It never proved useful, and anyway because of the current
9596 definition, it was not possible to have several specialization of
9597 this traits, making it useless.
9598 * data/lalr1.cc (yy:traits): Remove.
9599 Inline its definitions in the parser class.
9600
e2586f82
AD
96012005-09-19 Akim Demaille <akim@epita.fr>
9602
9603 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9604 least Mac OSX with a /usr/local install of gettext.
9605
2e8cf949
AD
96062005-09-19 Akim Demaille <akim@epita.fr>
9607
9608 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9609 and yytoken for similarity with the other skeletons.
9610
c7fb0b90
AD
96112005-09-19 Akim Demaille <akim@epita.fr>
9612
4e26c69e 9613 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 9614
1bd0deda
PE
96152005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9616
9617 * NEWS: Version 2.1.
9618
9619 * NEWS: Remove notice of yytname change, since it was never in an
9620 official release.
9621 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9622 diagnostic.
9623 * src/output.c (prepare): Likewise.
9624 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9625 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9626 is not defined. This is an awful hack, but it's enough for now.
9627 All callers changed.
9628 * tests/glr-regression-at (make_value): Args are const pointers now,
9629 to avoid GCC warning.
9630 (Duplicated user destructor for lookahead): New test. Currently
9631 skipped. It fails on my host but I'm not sure it'll always fail.
9632
96332005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
9634
9635 * src/symtab.h (struct symbol): Declare the printer and destructor
9636 as const, to avoid accidental calls to free.
9637 (symbol_destructor_set, symbol_printer_set): Adjust.
9638 * src/symtab.c: Adjust.
9639
1bd0deda 96402005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
9641
9642 * data/c.m4 (b4_token_enums): New.
9643 (b4_token_defines): Rename as...
9644 (b4_token_enums_defines): this.
9645 (b4_token_defines): New, output only the #defines.
9646 * data/yacc.c, data/glr.c: Adjust.
9647 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9648 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9649 as default values.
9650
dbcdae2d
AD
96512005-09-16 Akim Demaille <akim@epita.fr>
9652
9653 * data/lalr1.cc (yylex_): Remove, inline its code.
9654 (yyreport_syntax_error_): Remove, replaced by...
9655 (yysyntax_error_): this which returns a string and leaves to the
9656 caller the call to the users' error function.
9657 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9658 Move from members of the parser object...
9659 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9660 to local variables of the parse function.
9661
70d8f291
AD
96622005-09-16 Akim Demaille <akim@epita.fr>
9663
9664 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9665 since it's in Bison's name space.
9666
b47dbebe
PE
96672005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9668
ae199bf1
PE
9669 * data/glr.c (yyresolveValue): Add default case to pacify
9670 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9671
b47dbebe
PE
9672 * NEWS: Document when yyparse started to return 2.
9673 * doc/bison.texinfo (Parser Function): Document when yyparse
9674 returns 2.
9675
9676 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9677 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9678 changed.
9679 (class position): file_name -> filename (reverting). All uses changed.
9680
96812005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9682
9683 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9684 do anything if $@ exists. This reverts part of the 2005-07-07
9685 patch.
9686
00292f66
PE
96872005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9688
9689 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9690 contains obsolete information and isn't worth distributing as a
9691 separate file anyway.
9692 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9693 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9694 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9695 (yyparse): Abort if user code uses longjmp to throw an unexpected
9696 value.
9697
a420f962
PE
96982005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9699
00292f66
PE
9700 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9701 Suggested by twlevo@xs4all.nl.
9702
127287e9
PE
9703 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9704 This avoids a diagnostic from gcc -Wswitch-enum.
9705 Problem reported by twlevo@xs4all.nl.
9706
a420f962
PE
9707 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9708 standards. Use "file name" or "file" or "name", depending on
9709 the context.
9710 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9711 not to hack/foo.tab.c.
9712 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
9713 * data/glr.c: b4_filename -> b4_file_name.
9714 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9715 All uses changed.
9716 (class position): filename -> file_name. All uses changed.
9717 * data/yacc.c: b4_filename -> b4_file_name.
9718 * lib/bitset.h: filename -> file_name in local vars.
9719 * lib/bitset_stats.c: Likewise.
9720 * src/files.c: Likewise.
9721 * src/scan-skel.l ("@output ".*\n): Likewise.
9722 * src/files.c (file_name_split): Renamed from filename_split.
9723 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
9724
97252005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9726
9727 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9728 to accommodate latest gnulib.
9729
9730 * tests/glr-regression.at (Duplicate representation of merged trees):
9731 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9732
9733 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9734 needed.
9735
42a6501d
PE
97362005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9737
9738 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9739 All uses changed. Invoke user destructor after an error during a
9740 split parse (trivial change from Joel E. Denny).
9741
9742 * tests/glr-regression.at
9743 (User destructor after an error during a split parse): New test case.
9744 Problem reported by Joel E. Denny in:
9745 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9746
ef9a1faf
PE
97472005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9748
5b4aaf78
PE
9749 * README-cvs: Give URLs for recommended tools.
9750 Mention Gzip version problem, and bootstrapping issues.
9751 Remove troubleshooting section, as it's somewhat obsolete.
9752
b5240ba5
PE
9753 * bootstrap (no_cache): New var, to accommodate different wget
9754 variants. Use it instead of '-C off'. Problem reported by
9755 twlevo@xs4all.nl.
9756
ef9a1faf
PE
9757 * data/glr.c (yydestroyStackItem): New function.
9758 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9759 debugging information. Problem reported by Joel E. Denny.
9760
e6efa9da
AD
97612005-08-25 Akim Demaille <akim@epita.fr>
9762
9763 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9764
adc90f13
PE
97652005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9766
9767 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9768 Don't invoke destructor on unresolved entries.
9769 * tests/glr-regression.at
9770 (User destructor for unresolved GLR semantic value): New test case.
9771 Problem reported by Joel E. Denny in:
9772 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9773
f9315de5
PE
97742005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9775
15d29c1f
PE
9776 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9777 Add strnlen.c.
9778 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9779 lib-prefix.m4, po.m4.
9780
dd5f2af2
PE
9781 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9782 in yydestruct diagnostic, since it might not be an error.
9783 Problem reported by Joel Denny near end of
9784 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 9785 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
9786 * data/yacc.c (yyreturn): Likewise.
9787 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9788
9789 * src/files.c: Remove obsolete FIXME comment.
9790
9791 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9792 with the other templates, and to fix bogus run-on messages such
9793 as the one reported at the end of
9794 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9795 All callers changed to avoid the newline.
9796 (yyprocessOneStack): Output two lines rather than one, to accommodate
9797 the above change. This changes the debug output format slightly.
9798
f9315de5
PE
9799 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9800 reported by Joel E. Denny in
9801 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9802 (trivial change).
9803 * tests/glr-regression.at (Duplicate representation of merged trees):
9804 New test, from Joel E. Denny in:
9805 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9806 * THANKS: Add Joel E. Denny.
9807
9808 * configure.ac (AC_INIT): Bump to 2.0c.
9809
04098407
PE
98102005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9811
9812 * NEWS: Version 2.0b.
9813
ca5d2013
PE
9814 * Makefile.am (SUBDIRS): Put examples before tests, so that
9815 "make check" doesn't finish with "All 1 tests passed".
9816
3d54b576
PE
9817 * tests/regression.at (Token definitions): Don't rely on
9818 AT_PARSER_CHECK for data that contains backslashes. It currently
9819 uses 'echo', and 'echo' isn't portable if its argument contains
9820 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9821 that the byte '\0xff' is not printable in the C locale; it is,
9822 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9823 not printable, so use '\0x81' to test.
9824
d53ae497
PE
9825 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9826 version of GCC, since the macro is used with non-GCC compilers.
9827
fc01665e
PE
9828 Fix core dump reported by Pablo De Napoli in
9829 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9830 * tests/regression.at (Invalid inputs with {}): New test.
9831 * src/parse-gram.y (token_name): Translate type before using
9832 it as an index.
9833
04098407
PE
9834 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9835 the user's name space. All uses changed to __attribute__
9836 ((__unused__)).
9837 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9838 Add __attribute__ ((__noreturn__)).
9839
9840 * etc/clcommit: Remove. We weren't using it, and it failed
9841 "make maintainer-distcheck".
9842 * Makefile.maint: Merge from coreutils.
9843 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9844 (syntax-check-rules): Change list of rules as described below.
9845 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9846 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9847 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9848 (sc_trailing_space): New rules.
9849 (sc_xalloc_h_in_src): Remove.
9850 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9851 (sc_space_tab, sc_error_exit_success, sc_changelog):
9852 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9853 (makefile-check, po-check, author_mark_check):
9854 (makefile_path_separator_check, copyright-check):
9855 Use grep -n, to make it easier to find violations.
9856 Use CVS_LIST and CVS_LIST_EXCEPT.
9857 (header_regexp, h_re): Remove.
9858 (dd_c): New macro.
9859 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9860 (my-distcheck): Use more-modern GCC flags.
9861 (signatures, %.asc): Remove.
9862 (rel-files, announcement): Remove signatures.
9863 Restore old updating code, even though we don't use it, so
9864 that we're the same as coreutils.
9865 (alpha, beta, major): Depend on news-date-check.
9866 Make the upload commands.
9867
9868 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9869 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9870 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9871 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9872 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9873 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9874 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9875 * tests/sets.at: Likewise.
9876
9877 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9878 we comment out the Autoconf version number.
9879 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9880 it's error-prone and "make maintainer-distcheck" rejects it.
9881
9882 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9883 Indent calls to "error" to pacify "make maintainer-distcheck",
9884 when the calls are not intended to be translated.
9885 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9886
9887 * src/Makefile.am (DEFS): Use +=, to pacify
9888 "make maintainer-distcheck".
9889 (bison_SOURCES): Add scan-skel.h.
9890 (sc_tight_scope): New rule, from coreutils.
9891
9892 * src/files.c (src_extension, header_extension):
9893 Now static, not extern.
9894 * src/getargs.c (short_options): Likewise.
9895 * src/muscle_tab.c (muscle_table): Likewise.
9896 * src/parse-gram.y (current_class, current_type, current_prec):
9897 Likewise.
9898 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9899 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9900 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9901 void, to avoid warning when NLS is disabled.
9902 * src/output.c: Include scan-skel.h.
9903 (scan_skel): Remove decl, since scan-skel.h does this.
9904 (output_skeleton):
9905 Indent calls to "error" to pacify "make maintainer-distcheck".
9906 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9907 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9908 "make maintainer-distcheck".
9909 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9910 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9911 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9912 (skel_lex_destroy, scan_skel): Move these decls to...
9913 * src/scan-skel.h: New file.
9914 * src/uniqstr.c (uniqstr_assert):
9915 Indent calls to "error" to pacify "make maintainer-distcheck".
9916
9917 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9918 not @VAR@.
9919
9920 * tests/torture.at: Revamp to avoid misuse of atoi that
9921 "make maintainer-distcheck" complained about.
9922
9923 * examples/extexi (message): Don't print a message more than once,
9924 and omit line-number decoration that makes Emacs compile think
9925 that informative messages are worth worrying about.
9926
99272005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9928
9929 * configure.ac: Update version number.
9930
9931 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9932 accidentally.
9933 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9934 autogenerated by the maintainer.
9935 * examples/calc++/.cvsignore: Add *.yy.
9936
9937 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9938 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9939 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9940
9941 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9942
9943 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9944 from maintainer-distcheck about casting the argument of 'free'.
9945
9946 * NEWS: Mention recent yytname changes.
9947 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9948
9949 * bootstrap: For translations that have not yet been upgraded to
9950 the new runtime-po domain, prime the pump by extracting the
9951 relevant strings from the obsolete translations. This code can be
9952 removed once the bison-runtime domain has been translated by each
9953 team.
9954
9955 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9956 now that token names are already quoted.
9957
9958 Fix problem reported by Anthony Heading.
9959 * data/glr.c (YYTOKEN_TABLE): New macro.
9960 (yytname): Define if YYTOKEN_TABLE.
9961 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9962 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9963 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9964 * src/output.c (prepare_symbols): Output token_table_flag.
9965
0ffda363
PE
99662005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9967
9968 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9969 again if the first call fails.
9970
9971 * data/glr.c (yytnamerr): New function.
9972 (yyreportSyntaxError): Use it to dequote most string literals.
9973 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9974 with other skeletons. All uses changed.
9975 (yytnameerr_): New function.
9976 (yyreport_syntax_error): Use it to dequote most string literals.
9977 * data/yacc.c (yytnamerr): New function.
9978 (yyerrlab): Use it to decode most string literals.
9979 * doc/bison.texinfo (Decl Summary, Calling Convention):
9980 Clarify quoting convention of yytname.
9981 * src/output.c (prepare_symbols): Quote all names. This undoes
9982 the 2005-04-17 change, which is now accomplished (mostly) via
9983 changes in the parsers as described above.
9984 * tests/regression.at (Token definitions, Web2c Actions):
9985 Undo most 2005-04-17 change here, too.
9986
99872005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9988
9989 Fix more problems reported by twlevo@xs4all.nl.
9990 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9991 remove trailing spaces. This loses the exit status of ./types,
9992 and isn't needed since ./types shouldn't be emitting trailing
9993 spaces.
9994 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9995 as the stack isn't valid in that case.
9996
9997 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9998 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9999 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10000 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10001 is used.
10002 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10003 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10004 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10005 Likewise.
10006
10007 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10008 overly-picky compilers that reject 'char *foo = "bar";'.
10009
10010 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10011 to FILE * parameter, not to stderr. This fixes a typo introduced
10012 in the 2005-07-12 change.
10013
10014 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10015 warnings from GCC 4.
10016
10017 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10018 (yyglrShiftDefer, yysplitStack):
10019 Remove unused parameters b4_pure_formals. All uses changed.
10020 (yyglrShift): Remove unused parameters b4_user_formals.
10021 All uses changed.
10022 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10023
6100a9aa
PE
100242005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10025
258b75ca
PE
10026 Destructor cleanups and regularization among the three skeletons.
10027 * NEWS: Document the behavior changes.
10028 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10029 stack before failing, as the cleanup code will do it for us now.
10030 * data/lalr1.cc (yyerrlab): Likewise.
10031 * data/glr.c (yyparse): Pop everything off the stack before
10032 freeing it, so that destructors get called properly.
10033 * data/lalr1.cc (yyreturn): Likewise.
10034 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10035 This is more consistent.
10036 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10037 why destructors might be called. 1.875 -> 2.1.
10038 (Destructor Decl, Decl Summary, Table of Symbols):
10039 Some English-language cleanups for %destructor.
10040 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10041 Add output line for destructor of start symbol.
10042 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10043 because of that same extra output line.
10044
1a059451
PE
10045 * NEWS: Document minor wording changes in diagnostics of
10046 Bison-generated parsers.
10047 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10048 Remove unused formals. All uses changed.
10049 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10050 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10051 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10052 Rename yyoverflowab to yyexhaustedlab.
10053 When memory exhaustion occurs during syntax-error reporting,
10054 report it separately rather than in a single diagnostic; this
10055 eases translation.
10056 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10057 (Memory Exhausted): Renamed from Parser Stack Overflow.
10058 Revamp wording slightly to prefer "memory exhaustion".
10059 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10060
97460c78
PE
10061 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10062
30757c8c
PE
10063 Add i18n support to the GLR skeleton. Partially fix the C++
10064 skeleton; a C++ expert needs to finish this. Remove debugging
10065 msgids; there's little point to having them translated, since they
10066 can be understood only by someone who can read the
10067 (English-language) source code.
10068
10069 Generate runtime-po/bison-runtime.pot automatically, so that we
10070 don't have to worry about garbage getting in that file. We'll
10071 make sure after the next official release that old msgids don't
10072 get lost. See
10073 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10074
10075 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10076 Now auto-generated.
10077 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10078 Fix typos in explanations of the runtime file.
10079 * bootstrap: Change gettext keyword from YYI18N to YY_.
10080 Use standard Makefile.in.in in runtime-po, since we'll arrange
10081 for backward-compatible bison-runtime.po files in a different way.
10082 * data/glr.c (YY_): New macro, from yacc.c.
10083 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10084 Translate messages intended for users.
10085 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10086 the wording in the other skeletons. We don't know that the memory
10087 is virtual.
10088 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10089 Use same method that yacc.c uses.
10090 Don't translate debugging messages.
10091 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10092 it doesn't work (yet), and requires C++ expertise to fix.
10093 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10094 Move defn to a more logical place, to be consistent with other
10095 skeletons.
10096 Don't translate debugging messages.
10097 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10098 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10099 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10100 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10101
ac8c5689
PE
10102 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10103 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10104 void, not int.
10105 * tests/glr-regression.at (Badly Collapsed GLR States):
10106 Likewise.
10107 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10108 yylex should return 0 at EOF rather than aborting.
10109
6100a9aa
PE
10110 Improve tests for stack overflow in GLR parser.
10111 Problem reported by twlevo@xs4all.nl.
10112 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10113 All uses removed.
10114 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10115 can handle the problem.
10116 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10117 (yyparse): New local variable yyresult to record the result.
10118 Use result of setjmp to set it, rather than storing itinto
10119 struct.
10120 (yyDone): Remove label.
10121 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10122 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10123 if YYABORT is used).
10124 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10125 yyparse status; put status > 1 into diagnostic.
10126 Check that status==2 works.
10127 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10128 Use exit status 3 for failure to open (which shouldn't happen).
10129
15f40952
PE
101302005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10131
67fd79c4
PE
10132 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10133 1 on syntax error; just let yyparse do its thing.
10134 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10135 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10136 (Exploding the Stack Size with Alloca):
10137 (Exploding the Stack Size with Malloc):
10138 Expect exit status 2, not 1, since the parser is supposed to blow
10139 its stack. Problem reported by twlevo@xs4all.nl.
10140
15f40952
PE
10141 * data/glr.c (yyparse): Don't assume that the initial calls
10142 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10143 Print a stack-overflow message and fail instead.
10144 Initialize the line-number information before creating the stack,
10145 so that the stack-overflow message can report line zero safely.
10146
f32c66b5
PE
101472005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10148
a22ff96f 10149 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
10150 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10151 (yyuserMerge): Provide a default case if b4_mergers is empty.
10152 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10153 * tests/glr-regression.at
10154 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 10155 Add casts to pacify C++ compilers.
1beb0b24
PE
10156 * tests/glr-regression.at (Improper merging of GLR delayed action
10157 sets): Declare yylex before using it.
f32c66b5 10158 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
10159 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10160 test for valgrind; valgrind is independent of g++.
10161 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10162 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10163 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10164 Use a destructor, so that we can expand the stack. Change
10165 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 10166
d741bd1b
PE
101672005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10168
10169 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10170 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10171
0410a6e0
PE
101722005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10173
10174 * PACKAGING: New file, suggested by Bruno Haible and taken from
10175 similar wording in gettext's PACKAGING file.
10176 * NEWS: Mention PACKAGING.
10177 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10178
f7ab6a50
PE
101792005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10180
baf785db 10181 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10182 * bootstrap: Get runtime translations into runtime-po.
10183 Create runtime-po files automatically, if possible.
10184 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10185 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10186 does not infringe on the user's name space.
10187 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10188 * doc/bison.texinfo (Internationalization): Revamp the English
10189 and Texinfo syntax a bit, to try to make it clearer.
10190 (Bison Options, Option Cross Key): Mention --print-localedir.
10191 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10192 YYENABLE_NLS. Quote a bit more.
10193 * runtime-po/.cvsignore: New file.
10194 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10195 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10196 * runtime-po/quot.sed: Likewise.
10197 * runtime-po/boldquot.sed: Likewise.
10198 * runtime-po/en@quot.header: Likewise.
10199 * runtime-po/en@boldquot.header: Likewise.
10200 * runtime-po/insert-header.sin: Likewise.
10201 * runtime-po/remove-potcdate.sin: Likewise.
10202 * runtime-po/Makevars: Likewise.
10203 * runtime-po/LINGUAS: Likewise.
10204 * runtime-po/de.po: Likewise; we will rely on the translation project
10205 to maintain this, so "bootstrap" should get it.
0410a6e0 10206 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10207 its value.
10208 * src/main.c (main): Bind the bison-runtime domain, too.
10209
102102005-07-12 Bruno Haible <bruno@clisp.org>
10211
10212 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10213 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10214 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10215 * runtime-po: New directory.
10216 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10217 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10218 * runtime-po/Rules-quot: New file, copied from po/.
10219 * runtime-po/quot.sed: Likewise.
10220 * runtime-po/boldquot.sed: Likewise.
10221 * runtime-po/en@quot.header: Likewise.
10222 * runtime-po/en@boldquot.header: Likewise.
10223 * runtime-po/insert-header.sin: Likewise.
10224 * runtime-po/remove-potcdate.sin: Likewise.
10225 * runtime-po/Makevars: New file.
10226 * runtime-po/POTFILES.in: New file.
10227 * runtime-po/LINGUAS: New file.
10228 * runtime-po/bison-runtime.pot: New file.
10229 * runtime-po/de.po: New file.
10230 * m4/bison.m4: New file.
10231 * Makefile.am (SUBDIRS): Add runtime-po.
10232 (aclocaldir, aclocal_DATA): New variables.
10233 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10234 Define aclocaldir.
10235 * src/getargs.c (usage): Document --print-localedir option.
10236 (PRINT_LOCALEDIR_OPTION): New enum item.
10237 (long_options): Add --print-localedir option.
10238 (getargs): Handle --print-localedir option.
10239 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10240 (Internationalization): New section.
10241
22dda0f0
AD
102422005-07-12 Akim Demaille <akim@epita.fr>
10243
10244 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10245 for consistency with the rest of the code.
10246 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10247 Add separators.
10248
82b248ad
AD
102492005-07-12 Akim Demaille <akim@epita.fr>
10250
10251 * src/parse-gram.y: Use %printer instead of YYPRINT.
10252
fa0e9314
AD
102532005-07-12 Akim Demaille <akim@epita.fr>
10254
867a3e00
AD
10255 * src/symtab.h, src/symtab.c (symbol_print): New.
10256 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10257 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10258
102592005-07-12 Akim Demaille <akim@epita.fr>
10260
10261 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10262 b4_at_dollar and b4_dollar_dollar.
10263
e054b190
PE
102642005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10265
10266 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10267 and Pennello's paper.
10268
34160ec4
PE
102692005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10270
407d4a75
PE
10271 * data/yacc.c (yyparse): Undo previous patch. Instead,
10272 set yylsp[0] and yyvsp[0] only if the initial action
10273 sets yylloc and yylval, respectively.
10274
34160ec4
PE
10275 * data/yacc.c (yyparse): In the initial action, set
10276 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10277 This avoids the use of undefined variables if the initial
10278 action does not set yylloc and/or yylval.
10279
c3d5a4a7
PE
102802005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10281
b34d96c1
PE
10282 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10283 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10284 Remove from CVS. These files are automatically generated.
10285 * examples/extexi: Clarify that this file is now part of Bison,
10286 not GNU M4, and that it works with any POSIX-compatible Awk.
10287 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10288 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10289 so that we also get calc++-parser.yy. Geneate it.
10290 Use $(AWK), not gawk, since any conforming Awk will do.
10291 Put comment before action, since older 'make' can't handle comment
10292 in action.
10293 $(BUILT_SOURCES): List all built sources, not just some of them.
10294 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10295 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10296 $($(calc_sources_generated)): Remove unnecessary test for existence
10297 of target. (This had a shell syntax error anyway; a stray "x".)
10298 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10299 calc++-parser.yy.
10300 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10301
c3d5a4a7
PE
10302 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10303 implied by the other modules.
10304
828c373b
AD
103052005-07-06 Akim Demaille <akim@epita.fr>
10306
10307 Bind examples/calc++ to the package.
10308 * examples/calc++/Makefile: Remove, replaced by...
10309 * examples/calc++/Makefile.am: ... this new file.
10310 * examples/calc++/test: Remove input.
10311 * examples/calc++/compile: Remove.
10312 * examples/Makefile.am: New.
10313 * configure.ac, Makefile.am: Adjust.
10314 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10315
63cb01d6
PE
103162005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10317
fd2df2ed
PE
10318 * data/glr.c (yyFail): Drastically simplify; since the format argument
10319 never had any % directives, we can simply pass it to yyerror.
10320 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10321 be modified later, as that is the usual style in glr.c.
10322 Problems reported by Paul Hilfinger.
10323
63cb01d6
PE
10324 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10325 and size overflow errors.
10326 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10327 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10328 (YYSIZEMAX): New macro.
10329 (yystpcpy): New function, taken from yacc.c.
10330 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10331 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10332 so that we don't have to maintain their signatures.
10333 (yyFail): Check for buffer overflow, by using vsnprintf rather
10334 than vsprintf. Allocate a bigger buffer if possible.
10335 Report an error if buffer allocation fails.
10336 (yyStackOverflow): New function.
10337 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10338 the initialization was successful. It might fail if storage was
10339 exhausted.
10340 (yyexpandGLRStack): Add more checks for storage allocation failure.
10341 Use yyStackOverflow to report failures.
10342 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10343 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10344 Don't assume stack number fits in int.
10345 (yysplitStack): Check for storage allocation failure.
10346 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10347 can print diagnostics on storage allocation failure. All callers
10348 changed.
10349 (yyresolveValue): Use yybool for boolean.
10350 (yyreportSyntaxError): Check for size-calculation overflow.
10351 This code is taken from yacc.c.
10352 (yyparse): Check for storage allocation errors when allocating
10353 the initial stack.
10354
1c59e0a1
AD
103552005-07-05 Akim Demaille <akim@epita.fr>
10356
10357 Extract calc++ from the documentation.
10358 * doc/bison.texinfo (Calc++): Add the extraction marks.
10359 * examples/extexi: New, from the aborted GNU Programming 2E.
10360 Separate the different paragraph of a file with empty lines.
10361 * examples/Makefile: Use it to extract the whole calc++ example.
10362
8a0adb01
AD
103632005-06-24 Akim Demaille <akim@epita.fr>
10364
10365 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10366 class typedefs.
10367
12545799
AD
103682005-06-22 Akim Demaille <akim@epita.fr>
10369
10370 * doc/bison.texinfo (C++ Language Interface): First stab.
10371 (C++ Parsers): Remove.
10372
99be0235
AD
103732005-06-22 Akim Demaille <akim@epita.fr>
10374
10375 * data/lalr1.cc (yylex_): Honor %lex-param.
10376
0ffd4fd1
AD
103772005-06-22 Akim Demaille <akim@epita.fr>
10378
10379 Start a set of simple examples.
10380 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10381 * examples/calc++/calc++-driver.hh,
10382 * examples/calc++/calc++-parser.yy,
10383 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10384 * examples/calc++/compile, examples/calc++/test: New.
10385
0925ebb4
PE
103862005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10387
10388 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10389 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10390 which stems from the 2005-05-27 patch.
10391
43d3b664
PH
103922005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10393
10394 * data/glr.c: Modify treatment of unused parameters to permit use
10395 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10396
3062864d
PE
103972005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10398
10399 Fix infringement on user name space reported by Janos Zoltan Szabo.
10400 * data/yacc.c (yyparse): strlen -> yystrlen.
10401
989b5b8e
AD
104022005-05-30 Akim Demaille <akim@epita.fr>
10403
10404 * data/lalr1.cc (_): New.
10405 Translate the various messages.
10406
bedf57f5
PE
104072005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10408
10409 Fix infringement on user name space reported by Bruno Haible.
10410 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10411 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10412 the user's name space.
10413 (alloca): Include <stdlib.h> to get it, if it's not built in.
10414 (YYMALLOC, YYFREE): Define only if needed.
10415 (malloc, free): Declare, but only if needed, as this infringes on
10416 the user name space.
10417
4d1801f1
PE
104182005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10419
10420 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10421 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10422 with %d format.
10423 * lib/ebitset.c (min, max): Undef before defining.
10424 * lib/vbitset.c (min, max): Likewise.
10425 * lib/subpipe.c (create_subpipe): Save local variables in case
10426 vfork clobbers them.
10427
104282005-05-24 Bruno Haible <bruno@clisp.org>
10429
10430 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10431 error message syntax used by gcc-4.0.
10432
b94a9e1e
PE
104332005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10434
85ac3861
PE
10435 * README: Mention m4 1.4.3. Remove obsolete advice about
10436 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10437
b94a9e1e
PE
10438 * bootstrap: Remove workaround for problem I encountered with
10439 gettext 0.14.1; it seems to be fixed now.
10440
51c30d21
PE
104412005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10442
009ce67d
PE
10443 * NEWS: Version 2.0a.
10444
f2a97c62
PE
10445 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10446 the previous change.
10447
c8775f93
PE
10448 Various maintainer cleanups.
10449 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10450 conftest*, for benefit of CVS commands run at the same time as
10451 "configure". Add build-aux, since "bootstrap" now creates it and
10452 its subfiles.
10453 * Makefile.cfg (move_if_change): Remove.
10454 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10455 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10456 (po_repo, do-po-update, po-update, wget_files, get-targets):
10457 (config.guess-url_prefix, config.sub-url_prefix):
10458 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10459 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10460 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10461 Remove.
10462 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10463 this is now the recommended name.
10464 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10465 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10466 ylwrap. These files now go into build-aux.
10467 * config/move-if-change: Remove.
10468 * config/prev-version.txt: Bump from 1.75 to 2.0.
10469
3ea5f0ec
PE
10470 * bootstrap: Add stdio-safer, unistd-safer modules.
10471 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10472 we don't need it).
10473 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10474 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10475 * lib/subpipe.c: Include "unistd-safer.h".
10476 (create_subpipe): Make sure all the newly-created
10477 file descriptors are > 2, so that diagnostics don't
10478 get sent down them (which might cause Bison to hang, in theory).
10479 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10480 * src/files.c (xfopen): Use fopen_safer, not fopen.
10481
51c30d21
PE
10482 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10483 yesterday's yacc.c fix.
10484
cea1469d
PE
104852005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10486
3ea5f0ec
PE
10487 * data/glr.c, data/lalr1.cc: Update copyright date.
10488
cea1469d
PE
10489 Fix a destructor bug reported by Wolfgang Spraul in
10490 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10491 * data/yacc.c (yyabortlab): Don't call destructor, and
10492 don't set yychar to EMPTY.
10493 (yyoverflowlab): Don't call destructor.
10494 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10495 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10496 since we no longer output the message "discarding lookahead token
10497 end of input ()".
10498
5e6f62f2
PH
104992005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10500
10501 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10502 fix a small glitch in debugging output.
10503 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10504 after YY_SYMBOL_PRINT where needed.
10505
10506 (struct yyGLRState): Add some comments.
10507 (struct yySemanticOption): Add some comments.
10508 (union yyGLRStackItem): Add comment.
10509
10510 (yymergeOptionSets): Correct this to properly perform the union,
10511 avoiding infinite reported by Michael Rosien.
10512 Update comment.
10513
10514 * tests/glr-regression.at: Add test for GLR merging error reported
10515 by M. Rosien.
cea1469d 10516
0fb669f9
PE
105172005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10518
10519 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10520 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10521 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10522 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10523 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10524 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10525 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10526 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10527 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10528 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10529 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10530 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10531 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10532 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10533 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10534 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10535 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10536 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10537 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10538 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10539 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10540 src/output.h, src/parse-gram.c, src/parse-gram.h,
10541 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10542 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10543 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10544 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10545 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10546 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10547 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10548 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10549 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10550 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10551 tests/reduce.at, tests/regression.at, tests/sets.at,
10552 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10553 Update FSF postal mail address.
10554
51f4735e
PE
105552005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10556
10557 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10558 Problem reported by Ralf Menzel.
10559
80ce3401
PE
105602005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10561
10562 * tests/actions.at: Test that stack overflow invokes destructors.
10563 From Marcus Holland-Moritz.
10564 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10565 from here....
10566 (yyreturn): to here. That way, destructors are called properly
10567 even if the stack overflows, or the user calls YYACCEPT or
10568 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10569 (yyoverflowlab): Destroy the lookahead.
10570
105712005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10572
10573 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10574
72f000b0
PE
105752005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10576
10577 * NEWS: Bison-generated C parsers no longer quote literal strings
10578 associated with tokens.
10579 * src/output.c (prepare_symbols): Don't escape strings,
10580 since users don't want to see C escapes.
10581 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10582 in diagnostics.
c19683bb 10583 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
10584 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10585
1094323f
PE
105862005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10587
10588 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10589 the data size is known to be too small and we can't increase it.
10590 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10591
ca407bdf
PE
105922005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10593
10594 * src/parse-gram.y: Include quotearg.h.
10595 (string_as_id): Quote $1 before using it as a key, since the
10596 lexer no longer quotes it for us.
10597 (string_content): Don't strip quotes, since lexer no longer
10598 quotes it for us.
10599 * src/scan-gram.l: Include quotearg.h.
10600 ("\""): Omit quote.
10601 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10602 a key, since the rest of the lexer doesn't quote it.
10603 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10604 * tests/regression.at (Token definitions): Check for backslashes
10605 in token strings.
10606
10607 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10608 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10609 (yyparse): Revamp code to generate long syntax error message, to
10610 make it easier to translate, and to avoid problems with arithmetic
10611 overflow. Change "virtual memory" to "memory" in diagnostic, since
10612 we don't know whether the memory is virtual.
10613
1ce59070
PE
106142005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10615
10616 * NEWS: Bison-generated C parsers now use the _ macro to
10617 translate strings.
10618 * data/yacc.c (_) [!defined _]: New macro.
10619 All English strings wrapped inside this macro.
10620 * doc/bison.texinfo (Bison Parser): Document _.
10621 * po/POTFILES.in: Include src/parse-gram.c, since it now
10622 includes translateable strings that parse-gram.y doesn't.
10623
a749a695
PE
106242005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10625
10626 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10627 reverting the 2004-10-11 change to this function.
10628 (symbol_check_alias_consistency): Don't call symbol_type_set
10629 if the type name is already correct.
10630 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10631
8fb1053b
PE
106322005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10633
10634 * tests/regression.at (Token definitions): Don't use a token named
10635 c, as that generates a "#define c ..." that runs afoul of buggy
10636 stdlib.h that uses the identifier c as a member of struct
10637 drand48_data. Problem reported by Horst Wente.
10638
ff498c4a
PE
106392005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10640
10641 * bootstrap: Change translation URL from
10642 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10643 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10644 redirection glitches. Problem reported by twlevo@xs4all.nl.
10645
65211d70
PE
106462005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10647
10648 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10649 after operands; POSIX says this isn't portable for the c99 command.
10650
9577fb1f
PE
106512005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10652
10653 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10654 immediately if a data overrun has occurred; this may help us track
10655 down what may be a spurious failure on MacOS.
10656
78b178f7
PE
106572005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10658
a2599d0f
PE
10659 Respond to problems reported by twlevo@xs4all.nl.
10660
10661 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10662
78b178f7
PE
10663 * src/vcg.h: Comment fix.
10664 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10665 (G_CMAX): Change to -1 instead of INT_MAX.
10666
10667 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 10668
7296e729
PE
106692005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10670
10671 * src/tables.c (state_number_to_vector_number): Put it inside an
10672 "#if 0", since it's not currently used. Problem reported by
10673 Roland McGrath.
10674
05ac60f3
PE
106752005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10676
10677 * src/output.c (escaped_output): Renamed from
10678 escaped_file_name_output, since we now use it for symbol tags as
10679 well. All uses changed.
10680 (symbol_destructors_output, symbol_printers_output):
10681 Escape symbol tags too.
10682 Problem reported by Matyas Forstner in
10683 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10684
10685 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10686 not needed.
10687 * src/output.c (user_actions_output, token_definitions_output,
10688 symbol_destructors_output, symbol_printers_output): Likewise.
10689 * src/reader.c (prologue_augment): Likewise.
10690 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10691
10692 * src/vcg.c (output_edge): Don't quote linestyle arg.
10693 Problem reported by twlevo@xs4all.nl.
10694
7eb453ac
PE
106952005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10696
10697 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10698 example, reported by Derek M Jones. Also, make the example even
10699 more outrageous, to better illustrate how bad the problem is.
10700
4c04c52a
PE
107012005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10702
10703 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10704 putsym. Typo reported by Sebastian Piping.
10705
a61e1620
PE
107062005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10707
10708 * doc/bison.texinfo (Language and Grammar): some -> same
10709 (Epilogue): int he -> in the
10710 Typos reported by Sebastian Piping via Justin Pence.
10711
9ec93868
PE
107122005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10713
10714 * tests/glr-regression.at (Improper handling of embedded actions
10715 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10716 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10717 with dollar signs in test names.
10718 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10719 for a similar reason.
10720
73ce7e7e
PE
107212005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10722
10723 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10724 wants to redefine G_VIEW.
10725
2e72b98e
PE
107262005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10727
10728 * src/vcg.c (get_view_str): Remove case for normal_view.
10729 Problem reported by twlevo@xs4all.nl.
10730
e0d634e5
PE
107312005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10732
ccf830a4
PE
10733 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10734 Problem reported by twlevo@xs4all.nl.
10735
e0d634e5
PE
10736 * doc/bison.texinfo: Change @dircategory from "GNU programming
10737 tools" to "Software development". Requested by Richard Stallman
10738 via Karl Berry.
10739
7bbc8cb0
PE
107402005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10741
10742 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10743 Problem reported by twlevo@xs4all.nl.
10744
08b770bc
PE
107452005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10746
10747 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10748 keyword; it's not needed with modern compilers, and it doesn't
10749 affect correctness with older compilers. Suggested by
10750 twlevo@xs4all.nl.
10751
95f22ad2
PE
107522005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10753
10754 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10755 gcc -Wswitch-default.
10756 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10757 * data/yacc.c (yyparse): Likewise.
10758
d229d15c
PE
107592005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10760
10761 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10762 already. Let config.h define any nonstandard values.
10763
ecadd90f
PE
107642005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10765
10766 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10767 for the benefit of slower hosts. Problem reported by
10768 Nelson H. F. Beebe.
10769
213744b5
PE
107702005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10771
10772 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10773 being defined and not used.
10774 * data/lalr1.cc (yyparse): Likewise.
10775 Use "if (false)" rather than "if (0)".
10776
249d3236
PE
107772005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10778
10779 * TODO: Mention that we should allow NUL bytes in tokens.
10780
987cc1fb
PE
107812005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10782
10783 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10784 Problem reported by Hans Aberg.
10785
08fe02d9
PE
107862005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10787
10788 * src/getargs.c (version): Happy new year; update overall
10789 program copyright date from 2004 to 2005.
10790
10791 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10792 Problem reported by Hans Aberg.
10793 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10794 (Output file names.): Add a test for the case when standard output
10795 is closed.
10796
010c0266
PE
107972004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10798
10799 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10800 to fix an oversight in the Bison 2.0 manual.
10801
da12206a
PE
108022004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10803
10804 * NEWS: Version 2.0. Reformat the existing news items since
10805 1.875, so that related items are grouped together.
3a4734aa 10806 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
10807 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10808
c935d934
PE
10809 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10810 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10811 otherwise, we're not testing alloca. Unfortunately there's no
10812 simple way to consult HAVE_ALLOCA here.
10813
da12206a
PE
10814 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10815 for yymsg, too.
10816
10817 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10818 hand. This avoids a warning about comparing int to size_t when
10819 GCC warnings are enabled.
10820
0a2c5137
PE
108212004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10822
d7e14fc0
PE
10823 * NEWS: Bison-generated parsers no longer default to using the
10824 alloca function (when available) to extend the parser stack, due
10825 to widespread problems in unchecked stack-overflow detection.
10826 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10827 responsibility to set it to a positive value. This lets the user
10828 specify a value that is not a preprocessor constant.
10829 * data/yacc.c (YYMAXDEPTH): Likewise.
10830 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10831 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10832 to be a compile-time constant. However, explain the constraints on it.
10833 Also, explain the constraints on YYINITDEPTH.
10834 (Table of Symbols): Explain that alloca is no longer the default.
10835 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10836 to 1.
10837
0a2c5137
PE
10838 * doc/bison.texinfo (Location Default Action): Mention that n must
10839 be zero when k is zero. Suggested by Frank Heckenbach.
10840
e019c247
AD
108412004-12-22 Akim Demaille <akim@epita.fr>
10842
10843 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10844 (parser::state_type, parser::semantic_type, parser::location_type):
10845 Private, not public.
10846 (parser::parse): Return ints, not bool.
10847 Returning a bool introduces a problem: 0 corresponds to false, and
10848 it seems weird to return false on success. Returning true changes
10849 the conventions for yyparse.
10850 Alternatively we could return void and send an exception.
10851 There is no clear consensus (yet?).
10852 (state_stack, semantic_stack, location_stack): Rename as...
10853 (state_stack_type, semantic_stack_type, location_stack_type): these.
10854 Private, not public.
10855 * tests/c++.at: New.
10856 * tests/testsuite.at, tests/Makefile.am: Adjust.
10857
72731bb7
AD
108582004-12-21 Akim Demaille <akim@epita.fr>
10859
10860 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10861
9a0d8bec
AD
108622004-12-21 Akim Demaille <akim@epita.fr>
10863
10864 Don't impose std::string for filenames.
10865
10866 * data/lalr1.cc (b4_filename_type): New.
10867 (position::filename): Use it.
10868 (parser.hh): Move the inclusion of stack.hh and location.hh below
10869 the user code, so that needed headers for the filename type can be
10870 included first.
72731bb7
AD
10871 Forward declare them before the user code.
10872 * tests/Makefile.am (check-local, installcheck-local): Pass
10873 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 10874
99880de5
AD
108752004-12-20 Akim Demaille <akim@epita.fr>
10876
10877 Use more STL like names: my_class instead of MyClass.
10878
10879 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10880 (SemanticStack, SemanticType, StateStack, StateType)
10881 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10882 (Parser::value): Rename as...
10883 (location_stack, location_type, rhs_number_type, semantic_stack)
10884 (semantic_type, state_stack, state_type, token_number_type, stack)
10885 (slice, traits, parser::yylloc, parser::yylval): these.
10886
10887 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10888
9bec482e
PE
108892004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10890
10891 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10892 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10893
f6fbd3da
PE
108942004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10895
10896 Remove uses of 'short int' and 'unsigned short int'. This raises
10897 some arbitrary limits. It uses more memory but nowadays that's
10898 not much of an issue.
10899
10900 This change does not affect the generated parsers; that's a different
10901 task, as some users will want to conserve memory there.
10902
10903 Ideally we should use size_t to represent all object counts, and
10904 something like ptrdiff_t to represent signed differences of object
10905 counts; but that will require more code-cleanup than I have the
10906 time to do right now.
10907
10908 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10909 Use size_t, not int or short int, to count objects.
10910 * src/closure.c (nritemset, closure): Likewise.
10911 * src/closure.h (nritemset, closure): Likewise.
10912 * src/nullable.c (nullable_compute): Likewise.
10913 * src/print.c (print_core): Likewise.
10914 * src/print_graph.c (print_core): Likewise.
10915 * src/state.c (state_compare, state_hash): Likewise.
10916 * src/state.h (struct state): Likewise.
10917 * src/tables.c (default_goto, goto_actions): Likewise.
10918
10919 * src/gram.h (rule_number, rule): Use int, not short int.
10920 * src/output.c (prepare_rules): Likewise.
10921 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10922 errs, reductions): Likewise.
10923 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10924 Likewise.
10925 * src/tables.c (vector_number, tally, action_number,
10926 ACTION_NUMBER_MINIMUM): Likewise.
10927 * src/output.c (muscle_insert_short_int_table): Remove.
10928
efeed023
AD
109292004-12-17 Akim Demaille <akim@epita.fr>
10930
10931 * data/lalr1.cc: Extensive Doxygenation.
10932 (error_): Rename as...
10933 (error): this, since it is visible to the user.
10934 Adjust callers.
10935 (Parser::message): Now an automatic variable from...
10936 (Parser::yyreport_syntax_error_): here.
10937 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10938 Parser::error.
10939 * tests/input.at: Escape $.
10940
bc82c5a5
PE
109412004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10942
10943 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10944 Parenthesize rhs to avoid obscure problems with mistakes like
10945 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10946 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10947 b4_rhs_location): Likewise.
10948 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10949 b4_rhs_location): Likewise.
10950
fd19f271
AD
109512004-12-16 Akim Demaille <akim@epita.fr>
10952
10953 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10954 yacc.c: be sure to stay within yycheck_.
10955 * tests/actions.at: Re-enable C++ tests.
10956
10454ea4
AD
109572004-12-16 Akim Demaille <akim@epita.fr>
10958
10959 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10960 real.
10961
c5b95ccf
AD
109622004-12-16 Akim Demaille <akim@epita.fr>
10963
10964 Use #define to handle the %name-prefix.
10965
10966 * data/glr.c, data/yacc.c: Comment changes.
10967 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10968 so that one can refer to yylex in the parser file, and have it
10969 renamed, as is the case with other skeletons.
10970
617a8f12
AD
109712004-12-16 Akim Demaille <akim@epita.fr>
10972
10973 Move lalr1.cc internals into yy*.
10974
10975 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10976 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10977 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10978 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10979 (empty_, final_, terror_, errcode_, ntokens_)
10980 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10981 (looka_, ilooka_, error_range_, nerrs_):
10982 Rename as...
10983 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10984 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10985 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10986 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10987 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10988 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10989 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10990 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10991 these.
10992
1e547e6e
PE
109932004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10994
10995 Fix some problems reported by twlevo at xs4all.
10996 * src/symtab.c (symbol_new): Report an error if the input grammar
10997 contains too many symbols. This is better than calling abort() later.
10998 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10999 (struct node, struct graph):
11000 Rename member expand to stretch. All uses changed.
11001 (struct graph): Remove member layoutalgorithm. All uses removed.
11002 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11003 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11004 All uses changed.
11005 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11006
735d6bd4
AD
110072004-12-15 Akim Demaille <akim@epita.fr>
11008
11009 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11010 Add more Doxygen comments.
11011 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11012 (report_syntax_error_, translate_): Rename as...
11013 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11014 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11015
2e1f5829
AD
110162004-12-15 Akim Demaille <akim@epita.fr>
11017
11018 * data/lalr1.cc (lex_): Rename as...
11019 (yylex_): this.
11020 Move the trace here.
11021 Take the %name-prefix into account.
11022 Reported by Alexandre Duret-Lutz.
11023
a3cb6248
AD
110242004-12-15 Akim Demaille <akim@epita.fr>
11025
11026 Simplify the C++ parser constructor.
11027
11028 * data/lalr1.cc (debug_): Rename as...
11029 (yydebug_): so that the parser's internals are always in the yy*
11030 pseudo namespace.
11031 Adjust uses.
11032 (b4_parse_param_decl): Remove the leading comma as it is now only
11033 called as unique argument list.
11034 (Parser::Parser): Remove the constructor accepting a location and
11035 an initial debugging level.
11036 Remove from the other ctor the argument for the debugging level.
11037 (debug_level_type, debug_level, set_debug_level): New.
11038
11039 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11040 constructor calls.
11041
07fed891
AD
110422004-12-15 Akim Demaille <akim@epita.fr>
11043
11044 Remove b4_root related material: failure experiment
a3cb6248 11045 (which goal was to allow to derive from a class).
07fed891
AD
11046
11047 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11048 definitions and uses.
11049
e603eaa5
PE
110502004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11051
11052 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11053 not 2, since it's not portable to subtract 1 from the start of an
11054 array. The new item 0 is never set or used. All uses changed.
11055
11056 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11057 the default definition of YYLLOC_DEFAULT. Problem reported
11058 by Frank Heckenbach.
11059
fafb007d
PE
110602004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11061
11062 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11063 the normal case and one for the error case. Just use the
11064 first one uniformly. Problem reported by Frank Heckenbach.
11065 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11066 use exactly the same macro in both places.
11067 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11068 so that the normal-case YYRHSLOC works for the error case too.
11069 All uses changed.
11070 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11071 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11072 * doc/bison.texinfo (Location Default Action): Don't claim that
11073 we have an array of locations. Use the same macro for both glr
11074 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11075 the index is 0.
11076
48814dcd
PE
110772004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11078
a4e1a53b
PE
11079 * HACKING: Update email addresses to send announcements to.
11080
48814dcd
PE
11081 * configure.ac (AC_INIT): Bump version to 1.875f.
11082
337116ba
PE
110832004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11084
11085 * NEWS: Version 1.875e.
11086 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11087
11088 * src/scan-skel.l: Include "complain.h", for "fatal".
11089
11090 * src/relation.h (relation_print, relation_digraph):
11091 Relation sizes are of type relation_node, not size_t (this is
11092 merely a doc fix, since the two types are equivalent).
11093 (relation_transpose): Relation sizes are of type relation_node,
11094 not int.
11095 * src/relation.c: Likewise.
11096 (top, infinity): Now of type relation_node, not int.
11097 (traverse, relation_transpose): Use relation_node, not int.
11098
11099 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11100 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11101 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11102
11103 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 11104 specifying whether the test should be skipped. Use it tp
337116ba 11105 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 11106 fail on some hosts, and should be skipped.
337116ba 11107
da2a7671
PE
111082004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11109
11110 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11111 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11112 unless otherwise specified below.
11113
11114 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11115 to allocate kernel_base, kernel_items, kernel_size, since
11116 they needn't be initialized to 0.
11117 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11118 * src/closure.c (new_closure): Likewise, for itemset.
11119 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11120 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11121 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11122 (build_relations): Likewise for edge, states1, includes.
11123 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11124 * src/reader.c (packgram): Likewise, for ritem, rules.
11125 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11126 * src/relation.c (relation_digraph): Likewise for VERTICES.
11127 (relation_transpose): Likewise for new_R, end_R.
11128 * src/symtab.c (symbols_token_translations_init): Likewise for
11129 token_translations.
11130 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11131 (token_actions): Likewise for yydefact, actrow, conflrow,
11132 conflict_list.
11133 (save_column): Likewise for froms[symno], tos[symno].
11134 (goto_actions): Likewise for state_count.
11135 (pack_table): Likewise for base, pos, check.
11136 (tables_generate): Likewise for width.
11137
11138 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11139 for initial core. Just have a separate core, so we needn't worry
11140 about whether kernel_size and kernel_base are initialized.
11141
11142 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11143 kernel_size, kernel_items): Remove unnecessary initialization.
11144 * src/conflicts.c (conflicts): Likewise.
11145 * src/derives.c (derives): Likewise.
11146 * src/muscle_tablc (muscle_insert): Likewise.
11147 * src/relation.c (relation_digraph): Likewise.
11148 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11149 conflrow, conflict_table, conflict_list, table, check):
11150 Likewise.
11151
11152 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11153 This is because all callers pass unsigned int.
11154 * src/closure.h (new_closure): Likewise.
11155
11156 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11157 (build_relations): Initialize includes[i] in all cases.
11158 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11159 and rules[ruleno].precsym. Initialize members in order.
11160 * src/relation.c (relation_transpose): Always initialize new_R[i]
11161 and end_R[i].
11162 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11163
11164 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11165 conflict_list[0] was always 0, but now it isn't initialized.
11166
11167 * src/table.c (table_grow): When conflict_table grew, the grown
11168 area wasn't cleared. Fix this.
11169
11170 * lib/.cvsignore: Add strdup.c, strdup.h.
11171 * m4/.cvsignore: Add strdup.m4.
11172
00baeeac
PE
111732004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11174
11175 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11176 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11177 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11178 ngotos + 1 without checking for overflow.
11179 (build_relations): Use END_NODE, not -1, to denote end of edges.
11180 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11181 build_relations): Use goto_number, not int, for goto numbers.
11182 * src/tables.c (save_column, default_goto): Likewise.
11183
be3d9d42
AD
111842004-11-23 Akim Demaille <akim@epita.fr>
11185
11186 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11187 of #defining from yystype.
11188 Don't typedef yystype, C++ does not need it.
11189 This lets it possible to forward declare it as union.
11190
78e526d5
PE
111912004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11192
11193 * bootstrap (gnulib_modules): Add extensions.
11194 Problem reported by Jim Meyering.
11195
afbb696d
PE
111962004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11197
11198 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11199 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11200 src/system.h, src/tables.c: XFREE -> free, to accommodate
11201 recent change to gnulib xalloc.h.
78e526d5 11202 Problem reported by Jim Meyering.
afbb696d 11203
c1f8f16a
AD
112042004-11-17 Akim Demaille <akim@epita.fr>
11205
11206 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11207
db7e5eb5 112082004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11209 Alexandre Duret-Lutz <adl@gnu.org>
11210
11211 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11212 changes.
11213 (YYCDEBUG): Adjust.
11214 Use it instead of cdebug_.
11215 (Parser::debug_stream, Parser::set_debug_stream): New.
11216 (Parser::symprint_): Define cdebug_ for temporary backward
11217 compatibility.
11218 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11219 debug_stream ().
11220
68e11668
AD
112212004-11-17 Akim Demaille <akim@epita.fr>
11222
11223 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11224 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11225 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11226 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11227
97cbc73e
PE
112282004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11229
11230 * data/glr.c (yyloc_default): Remove; not used.
11231 Problem reported by Frank Heckenbach.
11232
e342c3be
AD
112332004-10-25 Akim Demaille <akim@epita.fr>
11234
11235 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11236 Introduce another definition to address simple location arrays.
11237 (yyGLRStack): New member: yyerror_range.
11238 (yyrecoverSyntaxError, yyparse): Update it.
11239 (yyrecoverSyntaxError): Use it when shifting the error token to
11240 have an accurate range, equivalent to the one computed by both
11241 yacc.c and lalr1.cc.
11242 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11243 that column numbers start at column 0, as per GNU Coding
11244 Standards, the others tests, and the doc.
11245 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11246 Adjust to the above change (first column is 0).
11247 And adjust the location of the "<error>", now covering the whole
11248 line.
11249
93602feb 112502004-10-22 Akim Demaille <akim@epita.fr>
04098407 11251 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11252
11253 Remove some arbitrary limits on goto numbers and relations.
11254 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11255 initial values, since they're never used.
11256 (set_goto_map): ngotos is now unsigned, so test for overflow
11257 by seeing whether it wraps around to zero.
11258 * src/lalr.h (goto_number): Now size_t, not short int.
11259 (GOTO_NUMBER_MAXIMUM): Remove.
11260 * src/relation.c (relation_print, traverse, relation_transpose):
11261 Check for END_NODE rather than looking at sign.
11262 * src/relation.h (END_NODE): New macro.
11263 (relation_node): Now size_t, not short int.
11264
dba08b04
PE
112652004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11266
11267 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11268 keyword, not an identifier. Problem reported by Baron Schwartz in
11269 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11270
df09ef2e
AD
112712004-10-11 Akim Demaille <akim@epita.fr>
11272
11273 * src/symtab.c (symbol_check_alias_consistency): Also check
11274 type names, destructors, and printers.
11275 Reported by Alexandre Duret-Lutz.
11276 Recode the handling of associativity and precedence in terms
11277 of symbol_precedence_set.
11278 Accept no redeclaration at all, not even equal to the previous
11279 value.
11280 (redeclaration): New.
11281 Use it to factor redeclaration complaints.
11282 (symbol_make_alias): Don't set the type of the alias, let
11283 symbol_check_alias_consistency do it as for other features.
11284 * src/symtab.h (symbol): Add new member prec_location, and
11285 type_location.
11286 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11287 * tests/input.at (Incompatible Aliases): New.
11288
146bc99d
PE
112892004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11290
11291 .cvsignore fixes to accommodate gnulib changes,
11292 and the practice of naming build directories "_build".
11293 * .cvsignore: Add "_*". Sort.
11294 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11295 * m4/.cvsignore: Add "*_gl.m4".
11296
e503aa60
AD
112972004-10-06 Akim Demaille <akim@epita.fr>
11298
11299 * src/parse-gram.y (add_param): Fix the truncation of trailing
11300 spaces.
11301
b4a20338
AD
113022004-10-05 Akim Demaille <akim@epita.fr>
11303
11304 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11305 whether the reducion was empty or not. This leaves room to
11306 improve the use of YYLLOC_DEFAULT in such a case.
11307 lalr1.cc is still experimental, so changing this is acceptable.
11308 And finally, there are probably not many users who changed the
11309 handling of locations in GLR, so changing is admissible too.
11310
11311 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11312 empty reduction, set @$ to an empty location ending the previously
11313 stacked symbol.
11314 Adjust uses to make sure the code is triggered on empty
11315 reductions.
11316 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11317 expected output: empty reductions have empty locations.
11318
f85a5e6f
AD
113192004-09-29 Akim Demaille <akim@epita.fr>
11320
11321 * data/lalr1.cc: Move towards a more standard C++ coding style
11322 for templates: Class < T > -> Class<T>.
11323
b203fc2c
AD
113242004-09-29 Akim Demaille <akim@epita.fr>
11325
11326 * data/lalr1.cc: Reinstall the former ctor, for sake of
11327 compatibility, but warn it will be removed.
11328 Move towards a more standard C++ coding style (i.e., type *var ->
11329 type* var).
11330
5b7e1e73
PE
113312004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11332
3fee967f
PE
11333 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11334 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11335
0dcca5c2
AD
113362004-09-27 Akim Demaille <akim@epita.fr>
11337
11338 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11339
6dde1c82
AD
113402004-09-27 Akim Demaille <akim@epita.fr>
11341
11342 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 11343 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
11344 and argument names.
11345 (b4_cc_constructor_call): Likewise.
11346
b233d555
AD
113472004-09-24 Akim Demaille <akim@epita.fr>
11348
11349 * src/parse-gram.y (add_param): Strip the leading and trailing
11350 blanks from a formal argument declaration.
11351 (YY_LOCATION_PRINT): New.
11352
619404e3
AD
113532004-09-24 Akim Demaille <akim@epita.fr>
11354
11355 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11356 after the location.
11357
dd8d9022
AD
113582004-09-24 Akim Demaille <akim@epita.fr>
11359
11360 * doc/bison.texinfo (Table of Symbols): Sort.
11361
0092f063
AD
113622004-09-21 Akim Demaille <akim@epita.fr>
11363
11364 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11365 the useless parentheses.
11366 Suggested by Paul Eggert.
11367
451364ed
AD
113682004-09-20 Akim Demaille <akim@epita.fr>
11369
11370 Let the initial-action act on the look-ahead, and use it for the
11371 "initial push" (corresponding to an hypothetical beginning-of-file).
11372 And let lalr1.cc honor %initial-action.
11373
11374 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11375 example.
11376 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11377 (Parser::Parser): Remove the ctor that used to initialize it.
11378 (Parser::parse): Like in the other skeletons, issue the "starting
11379 parse" message before any action.
11380 Honor %initial-action.
11381 Initialize the stacks with the lookahead.
11382 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11383 look-ahead.
11384 Push them in the stacks.
11385 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11386
18d192f0
AD
113872004-09-20 Akim Demaille <akim@epita.fr>
11388
11389 * doc/bison.texinfo (Initial Action Decl): New.
11390
b8458aa5
AD
113912004-09-20 Akim Demaille <akim@epita.fr>
11392
11393 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11394 clearer criterion to define it.
11395 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11396 When reducing on an empty RHS, use the latest stacked location as
11397 location.
11398 yylloc is not always available.
11399 * data/glr.c: Likewise.
11400 Also, honor initial-actions.
11401
3fc16193
AD
114022004-09-20 Akim Demaille <akim@epita.fr>
11403
11404 * data/yacc.c (YY_LOCATION_PRINT): New.
11405 Define when we know YYLTYPE's structure, i.e., when the default
11406 YYLLOC_DEFAULT is used.
11407 * data/c.m4 (b4_yysymprint_generate): Use it.
11408 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11409 value of the result.
11410 (error_start_): Replace with...
11411 (error_range_): this location array.
11412 This allows to replace code relying on the implementation of
11413 locations by portable code.
11414 * data/yacc.c (yylerrsp): Replace with...
11415 (yyerror_range): this.
11416 Every time a token is popped, update yyerror_range[0], to have an
11417 accurate location for the error token.
11418 * data/glr.c (YY_LOCATION_PRINT): New.
11419 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11420 deference a pointer.
11421 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11422 report the location in %printers.
11423
11424 * src/scan-skel.l: Instead of abort, report error messages to ease
11425 understanding skeleton scanning failures.
11426
ecfe33e7
AD
114272004-09-16 Akim Demaille <akim@epita.fr>
11428
11429 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11430 (iterator, const_iterator): these, to be more in the C++ spirit.
11431 Also, return reverse iterators so that when displaying the stack
11432 we display its bottom first.
11433 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11434 from yacc.c.
11435 We should probably use vector here though.
11436
1576d44d
AD
114372004-09-16 Akim Demaille <akim@epita.fr>
11438
11439 Have more complete shift traces.
11440
11441 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11442 to report Shifts instead of ad hoc YYDPRINTF invocations,
11443 including for the error token.
11444 * data/lalr1.cc (symprint_): Output the location.
11445 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11446 output the location within the %printer.
11447 Activate GLR tests, at least to make sure they compile properly.
11448 They still don't pass though.
11449 * tests/calc.at: Adjust expect verbose output, since now "Entering
11450 state..." is on a different line than the "Shifting" message.
11451
9c66f418
AD
114522004-09-08 Akim Demaille <akim@epita.fr>
11453
11454 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11455 Bison directive from the Bison file to the invocation of this
11456 macro, so that these directives are passed to
11457 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11458 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11459 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11460 the extra Bison directives instead of the whole series.
11461 Change the grammar so that there are recoverable errors, and
11462 unrecoverable errors. Now we can have the parser give up before
11463 consuming the whole input. As a result we now can observe that
11464 the lookahead is freed when needed.
11465 Change the parser source to parse argv[1] instead of a hard coded
11466 string.
11467 Simplify yylex, and give a value and location to EOF.
11468 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11469 passed directives already coded in the file.
11470 Add some tests to check the location of "error".
11471 For some tests, the C++ parser is correct, and not yacc.c.
11472 For other tests, they provide different, but unsatisfying, values,
11473 so keep the C++ value so that at least one parser is "correct"
11474 according to the test suite.
11475 (Actions after errors): Remove, this is subsumed by the
11476 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11477
52d5733f
AD
114782004-09-06 Akim Demaille <akim@epita.fr>
11479
11480 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 11481 (Parser::pop): New.
52d5733f
AD
11482 Use it.
11483
a0e68930
AD
114842004-09-06 Akim Demaille <akim@epita.fr>
11485
11486 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11487 argument, an informative message.
11488 Call YY_SYMBOL_PRINT.
11489 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11490 * data/lalr1.cc (destruct_): Likewise.
11491 In addition, no longer depend on b4_yysymprint_generate and
11492 b4_yydestruct_generate to generate these functions, do it "by
11493 hand".
11494
e757bb10
AD
114952004-09-03 Akim Demaille <akim@epita.fr>
11496
11497 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11498 invoked, yydestruct the lookahead.
11499 * tests/calc.at (Calculator $1): Update the expected lengths of
11500 traces: there is an added line for the discarded lookahead.
11501 * doc/bison.texinfo (Destructor Decl): Some rewording.
11502 Define "discarded" symbols.
11503
0fe1f06d
AD
115042004-09-02 Akim Demaille <akim@epita.fr>
11505
11506 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11507
284acc8b
AD
115082004-09-02 Akim Demaille <akim@epita.fr>
11509
11510 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11511 (YYDSYMPRINTF): Rename as...
11512 (YY_SYMBOL_PRINT): this.
11513 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11514 two.
11515 Use it instead of direct symprint_ calls.
11516 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11517 one.
11518
a5eb1ed2
AD
115192004-09-02 Akim Demaille <akim@epita.fr>
11520
b7c72fe1
AD
11521 * data/lalr1.cc (b4_yysymprint_generate): New.
11522 (symprint_): New member function, defined when YYDEBUG.
11523 Use it consistently instead of token/nterm debugging output by
11524 hand.
a5eb1ed2
AD
11525 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11526 %printer calls to use cdebug_ when using lalr1.cc.
11527
417141dd
AD
115282004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11529
11530 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11531 with #ifdef YYDEBUG.
11532
2fa09258
AD
115332004-08-26 Akim Demaille <akim@epita.fr>
11534
11535 * doc/bison.texinfo (Implementing Loops): Rename as...
11536 (Implementing Gotos/Loops): this.
11537
9378b508
PE
115382004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11539
11540 Adjust to latest gnulib.
11541 * bootstrap (gnulib_modules): Add xalloc-die.
11542 Set LC_ALL=C so that file names sort consistently.
11543 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11544 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11545 uintmax_t.m4, ulonglong.m4.
11546 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11547 po.m4 since we are now using _gl.m4 instead.
11548
87a8ad5c
PE
115492004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11550
11551 * src/scan-action.l: Remove. Scanning of semantic actions is
11552 handled in scan-gram.l.
11553
dca81a78
PE
115542004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11555
11556 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11557
11558 * src/location.h (struct): The file member is a uniqstr.
11559 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11560
c9cbf7c5
PE
115612004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11562
11563 Fix bug with non-%union parsers that have printers or destructors,
11564 which led to a Bison core dump. Reported by Peter Fales in
11565 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 11566
c9cbf7c5
PE
11567 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11568 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11569 not to our own type.
11570 * src/output.c (symbol_destructors_output, symbol_printers_output):
11571 Don't assume %union.
11572 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11573 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11574 UNION-FLAG. All callers changed.
11575 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11576 Use type char, not unsigned int, when declaring an array of char;
11577 this lets us remove a cast.
11578 (Printers and Destructors): Add non-%union test cases.
11579
fa7e68c3
PE
115802004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11581
11582 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11583 GLR writeups. E.g., avoid frenchspacing and the future tense,
11584 change "lookahead" to "look-ahead", and change "wrt" to "with
11585 respect to".
2fa09258 11586
fa7e68c3
PE
115872004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11588
11589 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11590 New sections, split off from the GLR Parsers section. Put the new
11591 Simple GLR Parser near the start of the GLR section, for clarity.
11592 Rewrite connective text.
11593
99a9344e
PE
115942004-06-21 Frank Heckenbach <frank@g-n-u.de>
11595
11596 * doc/bison.texinfo (Simple GLR Parsers): New section.
11597
8dd162d3
PE
115982004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11599
11600 * NEWS, TODO, doc/bison.texinfo:
11601 Use "look-ahead" instead of "lookahead", to be consistent.
11602 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11603 while we're fixing "look-ahead".
11604 * src/conflicts.c (shift_set): Renamed from shiftset.
11605 (look_ahead_set): Renamed from lookaheadset.
11606 * src/print.c: Likewise.
11607 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11608 name for "lookahead".
11609 (report_types, usage): Likewise.
11610 * src/getargs.h (report_look_ahead_tokens): Renamed from
11611 report_lookaheads.
11612 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11613 compute_lookaheads.
11614 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11615 (look_ahead_tokens_print): Renamed from lookaheads_print.
11616 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11617 state_rule_lookaheads_print.
11618 * src/state.h: Likewise.
11619 (reductions.look_ahead_tokens): Renamed from lookaheads.
11620 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11621 AT_DATA_LOOKAHEADS_GRAMMAR.
11622
57a90331
PE
116232004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11624
11625 * README: Update location of patched M4 distribution.
11626
8ed3234a
PE
116272004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11628
11629 Don't assume the C++ compiler takes the same arguments as the C compiler
11630 (trivial change).
11631 * configure.ac (O0CXXFLAGS): New var.
11632 * tests/atlocal.in (CXXFLAGS): Use it.
11633
07971983
PE
116342004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11635
11636 Fix some "make check" problems with C++ reported by
11637 Albert Chin-A-Young for Tru64 C++ in this thread:
11638 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11639
11640 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11641 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11642 Output to a .cc file for C++, not to a .c file.
11643 * tests/calc.at (AT_CHECK_CALC): Likewise.
11644 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11645 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11646
29058652
PE
116472004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11648
11649 * tests/calc.at, tests/actions.at: Workaround for SGI
11650 C++ compiler. (trivial change)
11651
62cb8a99
PE
116522004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11653
fd418816
PE
11654 Spent a few hours checking out which prerequisite versions the
11655 current sources actually require. I went all the way back to
11656 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11657 a seemingly endless set of combinations of versions more recent
11658 than that. The bottom line is that the current sources require
11659 fairly recent versions of the build tools, and it'll be some work
11660 to change this.
11661 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11662 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11663 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11664 Add comments explaining why those particular versions are
11665 currently needed.
2fa09258 11666
62cb8a99
PE
11667 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11668 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 11669 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
11670
11671 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11672 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11673
caa52c10
PE
116742004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11675
11676 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11677 0.11.5. Suggested by Bruno Haible.
11678 * bootstrap: Remove gettext version checking.
11679
11680 * doc/bison.texinfo (Decl Summary): Also mention that %union
11681 can depend on prerequisite types. Problem reported by Tim
11682 Van Holder.
11683
4bfd5e4e
PE
116842004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11685
2cef3017
PE
11686 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11687 * README-alpha: Don't tell people not to package this.
11688
b9c85d5c
PE
11689 * bootstrap: Don't assume $(...) works; use `...` instead.
11690 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11691 gettext better.
11692
4bfd5e4e
PE
11693 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11694 put into the -d output file, and mention what to do if YYSTYPE is
11695 defined as a macro.
11696
6a36ff94
PE
116972004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11698
6712933e
PE
11699 Undo change made earlier today: it caused autopoint to not bring
11700 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11701 autopoint's.
11702
11703 * bootstrap: Check that gettext version matches what's in
11704 configure.ac. Warn users to ignore robots.txt ERROR 404.
11705 * bootstrap: Undo today's earlier change (logged below).
11706 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 11707
6a36ff94
PE
11708 The gettext version checking is causing more trouble than it's
11709 curing; remove it. Problem reported by Paul Hilfinger.
11710
11711 * bootstrap: Issue a warning that one can expect a message
11712 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11713 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11714
209ea708
PE
117152004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11716
11717 Ensure that the C++ compiler used for testing actually works on a
11718 simple test program; if not, skip the C++-related tests. Problem
11719 reported by Vin Shelton in:
161a71f3 11720 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
11721
11722 * m4/cxx.m4: New file.
11723 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11724 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11725 * tests/local.at (AT_COMPILE_CXX): Use it.
11726
41ca2549
PE
117272004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11728
383e69dc
PE
11729 * data/glr.c (yylloc): Output this macro even if locations are not
11730 being generated, as the GLR parser needs it even in that case.
11731 Problem reported by Troy A. Johnson
11732 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11733
41ca2549
PE
11734 * configure.ac (AC_INIT): Update to 1.875e.
11735
e476c87d
PE
117362004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11737
11738 * NEWS: Version 1.875d.
11739 * configure.ac (AC_INIT): Likewise.
11740 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11741
11742 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11743 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11744 lalr1.cc runs afoul of the first, and the last two are no longer
11745 supported by GCC 3.4.0.
11746 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11747 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11748
233a88ad
PE
117492004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11750
11751 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11752 unsigned int, for compatibility with latest gnulib hash module.
11753 * src/state.c (state_hash, state_hasher): Likewise.
11754 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11755 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 11756
12ffdd28
PE
117572004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11758
11759 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11760
11761 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11762 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11763 character and string literals.
11764 (unexpected_end): New function.
11765 (unexpected_eof): Use it.
11766 (unexpected_newline): New function.
11767 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11768 actions.
e476c87d 11769
12ffdd28
PE
11770 * NEWS: Document %expect-rr.
11771
11772 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11773 Fix typo by replacing $1 with $option.
11774 Remove more 'intl'-related files.
9668e2be 11775 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
11776
11777 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11778 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11779 strtoul.c.
11780 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11781 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11782 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11783 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11784 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11785 * src/.cvsignore: Add *.output.
11786
11787 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11788 gets copied to the output file.
e476c87d 11789
1f65350a
PE
117902004-04-28 Paul Eggert <eggert@twinsun.com>
11791
11792 Get files from the gnulib and po repositories, instead of relying
11793 on them being in our CVS. Upgrade to latest versions of gnulib
11794 and Automake.
11795
11796 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11797 * bootstrap: Bootstrap from gnulib and po repositories.
11798 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11799 * README-cvs: Document these changes. Remove version numbers from
11800 mentions of build tools, since they change so often. Mention Flex.
11801
11802 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11803 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
11804 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11805 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 11806 does this for us.
12ffdd28
PE
11807 (AC_ISC_POSIX): Remove; we no longer support this
11808 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
11809 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11810 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11811 Do not check for C89 headers, except for locale.h which is used
11812 by the Yacc library and must port to K&R hosts.
11813 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11814 Do not check for C89 functions, except for setlocale which is
11815 used by the Yacc library.
11816 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11817 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11818 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11819 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11820 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11821 AM_GNU_GETTEXT): Remove; now done by:
11822 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11823 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11824 for us.
11825
11826 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11827 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11828 Define to empty, as gnulib.mk will do the rest for us.
11829 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11830 for us.
11831 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11832 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11833
11834 * src/files.c: Include gnulib's xstrndup.h.
11835
11836 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11837 (REALLOC): Use xnrealloc, for likewise.
11838 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11839 (strnlen, memrchr): Remove decls; functions no longer used.
11840 Include <stpcpy.h>.
11841
11842 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11843 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11844 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11845 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11846 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11847 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11848 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11849 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11850 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11851 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11852 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11853 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11854 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11855 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11856 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11857 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11858 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11859 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11860 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11861 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11862 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11863 Remove, as these files are now generated automatically
11864 by bootstrap or automake.
11865
11866 * po/ChangeLog: Remove: all but one entry was a duplicate
11867 of this file, and I moved that 2000-11-02 entry here.
11868
11869 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11870 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11871 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11872 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11873 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11874 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11875 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11876 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11877 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11878 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11879 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11880 xstrndup.h.
11881 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11882 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11883 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11884 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11885 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11886 * src/.cvsignore: Remove *_.c.
11887
11888
11889 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11890 support it. (The latest stable gzip doesn't.)
11891
118922004-04-27 Paul Eggert <eggert@twinsun.com>
11893
11894 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11895 case, as stos_ is now used by destructors due to the 2004-02-09
11896 change.
11897
11898 Remove more K&R C support.
11899 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11900 * lib/subpipe.c (errno): Remove decl.
11901 Include <stdlib.h> unconditionally.
11902 (EXIT_FAILURE): Remove macro.
11903 * src/complain.c (vfprintf, strerror): Remove.
11904 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11905 unconditionally.
11906 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11907 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11908 (strchr, strspn, memchr): Remove decls.
11909 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11910 unconditionally. Do not declare perror.
11911 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11912 unconditionally.
11913
11914 * src/complain.c (_): Remove useless defn, as system.h defines this.
11915
11916 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11917 with latest obstack.h.
11918 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11919 to procedure types, as obstack.h now does that for us.
11920 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11921
11922 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11923 so that this include file can stand alone.
11924 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11925 does this now. Include subpipe.h first after config.h, to
11926 test whether it can stand alone.
11927
11928 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11929 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11930 unused declaration.
11931
11932 * tests/synclines.at (%union synch line): Put a dummy member in
11933 the union, because empty unions aren't allowed in C. Caught
11934 by GCC 3.4.0.
11935
4f16766c
PE
119362004-04-13 Jim Meyering <jim@meyering.net>
11937
11938 * src/conflicts.c (conflicts_print): Correct format string typo:
11939 use `%%' to produce literal `%'. (trivial change)
11940
779e7ceb
PE
119412004-03-30 Paul Eggert <eggert@twinsun.com>
11942
11943 * src/getargs.c (version): Update copyright year to 2004.
11944
11945 * data/c.m4 (b4_int_type): Use 'short int' rather than
11946 'short', and similarly for 'long', 'unsigned', etc.
11947 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11948 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11949 yy_yypstack, yydumpstack): Likewise.
11950 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11951 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11952 Likewise.
11953 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11954 yy_stack_print, yyparse): Likewise.
11955 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11956 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11957 * lib/bitset.c (bitset_print): Likewise.
11958 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11959 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11960 * lib/bitsetv.c (bitsetv_dump): Likewise.
11961 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11962 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11963 Likewise.
11964 * src/LR0.c (allocate_itemsets): Likewise.
11965 * src/gram.h (rule_number, rule): Likewise.
11966 * src/lalr.h (goto_number): Likewise.
11967 * src/nullable.c (nullable_compute): Likewise.
11968 * src/output.c (prepare_rules): Likewise.
11969 * src/relation.c (relation_print, relation_digraph): Likewise.
11970 * src/relation.h (relation_node): Likewise.
11971 * src/state.h (state_number, transitions, errs, reductions,
11972 struct state): Likewise.
11973 * src/symtab.h (symbol_number, struct symbol): Likewise.
11974 * src/tables.c (vector_number, tally, action_number,
11975 default_goto, goto_actions): Likewise.
11976 * tests/existing.at (GNU Cim Grammar): Likewise.
11977 * tests/regression.at (Web2c Actions): Likewise.
11978
11979 * src/output.c (muscle_insert_short_int_table): Renamed from
11980 muscle_insert_short_table. All uses changed.
11981
d6328241
PH
119822004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11983
11984 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11985 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11986 Add %expect-rr rule.
4f16766c 11987
d6328241
PH
11988 * src/scan-gram.l: Recognize %expect-rr.
11989
4f16766c 11990 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 11991 expected_conflicts.
4f16766c 11992 (expected_rr_conflicts): Declare.
d6328241
PH
11993
11994 * src/conflicts.c (expected_sr_conflicts): Rename from
11995 expected_conflicts.
11996 (expected_rr_conflicts): Define.
11997 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11998 for GLR parsers.
11999 Use expected_sr_conflicts in place of expected_conflicts.
12000 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 12001
d6328241 12002 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 12003
1452af69
PE
120042004-03-08 Paul Eggert <eggert@gnu.org>
12005
12006 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 12007 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
12008
12009 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12010 in lalr1.cc.
12011 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12012 * src/scan-gram.l (scan_integer): New function.
12013 ({int}): Use it.
12014 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12015 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12016 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12017 Say "long int", not "long", for uniformity with GNU style.
12018
006d217d
PE
120192004-02-25 Paul Eggert <eggert@twinsun.com>
12020
12021 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12022 compilers. This fixes a problem with Intel's C++ compiler being
12023 chatty, reported by Guido Trentalancia in
161a71f3 12024 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 12025
c2729758
ADL
120262004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12027
12028 Support %destructor and merge error locations in lalr1.cc.
12029
12030 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12031 (Parser::stos_): Define unconditionally.
12032 (Parser::destruct_): New method. Generate its body with
12033 b4_yydestruct_generate.
12034 (Parser::error_start_): New attribute.
12035 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12036 token which are discarded.
12037 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12038 error_start_ when erroneous token are discarded.
12039 (Parser::parse) <yyerrlab1>: Compute the location of the error
12040 token so that it covers all the discarded tokens.
12041 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12042 it can be called with `%skeleton "lalr1.cc"', and do that.
12043
dd0e0635
PE
120442004-02-02 Paul Eggert <eggert@twinsun.com>
12045
12046 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12047 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12048 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12049 There's no need to mention top_builddir since Automake does that
12050 for us.
12051 (INCLUDES): Remove, as Automake says it's obsolescent.
12052 Contents migrated into AM_CPPFLAGS as described above.
12053 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12054
120552004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12056
12057 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12058 (yyreportSyntaxError): Handle case where lookahead token is
12059 YYEMPTY.
12060
be16239b
PH
120612004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12062
12063 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12064 resulting parsers are compilable with C++.
12065
5fa90832
PE
120662003-12-23 Paul Eggert <eggert@twinsun.com>
12067
12068 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12069 * src/output.c (output_skeleton): Rename local var.
12070 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12071 Bison tokens, as this runs afoul of the 2003-10-07 change that
12072 disallowed NUL bytes in character constants or string literals.
12073
12074 * tests/local.at: Require Autoconf 2.59's Autotest.
12075 * tests/testsuite.at: Don't include local.at, since we now assume
12076 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12077 including it.
12078 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12079 multiple inclusion warnings.
dd0e0635 12080
b165c324
AD
120812003-12-02 Akim Demaille <akim@epita.fr>
12082
12083 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12084 conditions.
12085 From Bruno Haible.
12086
26e06a21
ADL
120872003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12088
12089 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12090
92ac3705
PE
120912003-10-07 Paul Eggert <eggert@twinsun.com>
12092
6a5ecb38
PE
12093 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12094 if testsuite doesn't exist.
12095
92ac3705
PE
12096 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12097 literals, unfortunately.
12098 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12099 Complain about NUL bytes in character constants or string literals.
12100
91d2c560
PE
121012003-10-05 Paul Eggert <eggert@twinsun.com>
12102
12103 * NEWS: Don't document %no-default-prec, as it's still
12104 too experimental.
12105 * doc/bison.texinfo: Document %no-default-prec only if
12106 the defaultprec flag is set. Normally it's not.
12107
0cc3da3a
PE
121082003-10-04 Paul Eggert <eggert@twinsun.com>
12109
12110 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12111 non-modifiable lvalue, instead of a modifiable one.
12112 * doc/bison.texinfo (Actions): Document that $$ can
12113 be assigned to. Do not claim that $$ and $N are
12114 array element references: user code should not rely on this.
12115
22fccf95
PE
121162003-10-01 Paul Eggert <eggert@twinsun.com>
12117
12118 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12119 (grammar_declaration): Use it.
12120 * src/scan-gram.l: New token %no-default-prec.
12121 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12122 * NEWS, doc/bison.texinfo: Document the above.
12123
fc8f2965
AD
121242003-10-01 Akim Demaille <akim@epita.fr>
12125
12126 VCG no longer supports long_straight_phase.
12127
12128 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12129 * src/print_graph.c (print_graph): Adjust.
12130
39a06c25
PE
121312003-09-30 Frank Heckenbach <frank@g-n-u.de>
12132 and Paul Eggert <eggert@twinsun.com>
12133
12134 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12135 Table of Symbols): Document %default-prec.
12136 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12137 (grammar_declaration): Set default_prec on %default-prec.
12138 * src/scan-gram.l (%default-prec): New token.
12139 * src/reader.h (default_prec): New flag.
12140 * src/reader.c: Likewise.
12141 (packgram): Handle it.
12142 * tests/conflicts.at (%default-prec without %prec,
12143 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 12144
39a06c25
PE
121452003-09-30 Paul Eggert <eggert@twinsun.com>
12146
12147 * tests/testsuite.at: Include local.at, not input.at, fixing
12148 a typo in the 2003-08-25 patch.
12149
62b6aef9
AD
121502003-08-27 Akim Demaille <akim@epita.fr>
12151
12152 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12153 GCC warnings.
12154
89e1cc61
AD
121552003-08-26 Akim Demaille <akim@epita.fr>
12156
12157 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12158 "<\#" to avoid magic from Gnus when posting parts of this script.
12159
a08460b0
AD
121602003-08-26 Akim Demaille <akim@epita.fr>
12161
12162 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12163 (Parser::parse): here.
12164 Adjust: nerrs and errstatus is now replaced by...
12165 (Parser::nerrs_, Parser::errstatus_): New.
12166
603f1cfd
AD
121672003-08-25 Akim Demaille <akim@epita.fr>
12168
12169 * config/announce-gen, Makefile.cfg: New.
12170 * Makefile.am: Adjust.
12171 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12172 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12173
cd3684cf
AD
121742003-08-25 Akim Demaille <akim@epita.fr>
12175
12176 When reducing initial empty rules, Bison parser read an initial
12177 location that is not defined. This results in garbage, and that
12178 affects Bison's own parser. Therefore we need (i) to extend Bison
12179 to support a means to initialize this location, and (ii) to use
12180 this CVS Bison to fix CVS Bison's parser.
12181
12182 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12183 with...
12184 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12185 * src/parse-gram.y: Adjust.
12186 (%initial-action): New.
12187 (%error-verbose): Since we require CVS Bison, there is no reason
12188 not to use it.
12189 * src/scan-gram.l: Adjust.
12190 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12191 * data/yacc.c (yyparse): Use b4_initial_action.
12192
4e03e201
AD
121932003-08-25 Akim Demaille <akim@epita.fr>
12194
12195 * doc/bison.texinfo: Don't promote stdout for error messages.
12196
8c182d05
AD
121972003-08-25 Akim Demaille <akim@epita.fr>
12198
12199 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12200 From Alexandre Duret-Lutz.
12201
6a60c4cf
PE
122022003-08-25 Akim Demaille <akim@epita.fr>
12203
12204 Version 1.875c.
12205
25f66e1a
AD
122062003-08-25 Akim Demaille <akim@epita.fr>
12207
12208 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12209 Use them.
12210
5348bfbe
AD
122112003-08-25 Akim Demaille <akim@epita.fr>
12212
12213 * data/lalr1.cc (Parser::reduce_print_): New.
12214 Use it.
12215
47301314
AD
122162003-08-25 Akim Demaille <akim@epita.fr>
12217
12218 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12219 error recovery loops. This patch is based on
161a71f3 12220 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12221 Also, augment the similarity between lalr1.cc and yacc.c.
12222 Note: the locations of error recovery rules are not correct yet.
12223
12224 * data/lalr1.cc: Comment changes to augment the similarity between
12225 lalr1.cc and yacc.c.
12226 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12227 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12228 yyerrlab), when hitting EOF, pop the whole stack here instead of
12229 merely falling thru the default error handling mechanism.
12230 (yyerrorlab): New label, with the old contents of YYERROR,
12231 plus the following change: pop the stack of rhs corresponding
12232 to the production that invoked YYERROR. That is how Yacc
12233 behaves (required by POSIX).
12234 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12235 fail.
12236
1f7a61ff
AD
122372003-08-25 Akim Demaille <akim@epita.fr>
12238
12239 Tune local.at so that people can "autom4te -l autotest calc.at -o
12240 calc" for instance, to extract a sub test suite.
12241
12242 * tests/testsuite.at: Move the initialization, Autotest version
12243 requirement, and AT_TESTED invocation into...
12244 * tests/local.at: here.
12245 * tests/testsuite.at: Include it for compatibility with Autoconf
12246 2.57.
12247 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12248 be ignore.
12249
327b5b56
PE
122502003-08-04 Paul Eggert <eggert@twinsun.com>
12251
12252 Rework code slightly to avoid gcc -Wtraditional warnings.
12253 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12254 The returned value is now stored in *YY0. All callers changed.
12255 * src/output.c (merge_output): Adjust to the above change.
12256
0051e3ed
PE
122572003-07-26 Paul Eggert <eggert@twinsun.com>
12258
12259 * data/glr.c (YYASSERT): New macro.
12260 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12261 yyresolveStates, yyprocessOneStack):
12262 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12263 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12264
137437c6
PE
122652003-07-25 Paul Eggert <eggert@twinsun.com>
12266
5b620e06
PE
12267 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12268 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12269 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12270 by Frank Heckenbach, though I have omitted the structure-initialization
12271 part of his glr-knr.diff patch since I recall that the Portable
12272 C Compiler didn't require that change.
12273
137437c6
PE
12274 Let the user specify how to allocate and free memory.
12275 Derived from a suggestion by Frank Heckenbach in
161a71f3 12276 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12277 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12278 All uses of free, malloc, realloc changed to use these macros,
12279 and unnecessary casts removed.
12280 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12281
ddb85ca5
PE
122822003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12283
12284 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12285 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12286 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12287 (trivial change)
12288
39910e09
AD
122892003-06-25 Akim Demaille <akim@epita.fr>
12290
12291 * config/depcomp, config/install-sh: Update from masters.
12292
0ae99356
PE
122932003-06-20 Paul Eggert <eggert@twinsun.com>
12294
12295 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12296 and return properly parenthesized result.
12297 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12298 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12299 Remove unnecessary parentheses from uses.
12300 * doc/bison.texinfo (Location Default Action): Describe the
12301 conventions for parentheses.
12302
cd05d13c
PE
123032003-06-19 Paul Eggert <eggert@twinsun.com>
12304
81fd08ca
PE
12305 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12306 yyreportTree): Do not assume that size_t is the same width as int,
12307 when printing sizes. Print sizes using an unsigned format.
12308 Problem reported by Frank Heckenbach in
161a71f3 12309 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12310
cd05d13c
PE
12311 Port to Forte Developer 7 C compiler.
12312 * data/glr.c (struct YYLTYPE): If locations are not being used,
12313 declare a single dummy member, as empty structs do not conform
12314 to the C standard.
12315 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12316 the Forte Developer 7 C compiler complains that end-of-loop
12317 code is not reached.
12318
4dcf140b
PE
123192003-06-17 Paul Eggert <eggert@twinsun.com>
12320
12321 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12322 avoid warnings from picky compilers about redefinition of PARAMS.
12323
8dd76bee
PE
123242003-06-17 Paul Eggert <eggert@twinsun.com>
12325
12326 Version 1.875b.
12327
12328 * NEWS: Document 1.875b.
12329
12330 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12331 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12332 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12333 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12334 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12335 per recent gettext manual's suggestion.
12336 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12337 Use prototypes, not old-style definitions.
12338 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12339 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12340 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12341 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12342 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12343 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12344 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12345 vbitset_or_and_cmp, vbitset_copy): Likewise.
12346
12347 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12348 Do not include <stdlib.h>.
12349 (PARAMS): Define unconditionally for C89.
12350 (ATTRIBUTE_NORETURN): Remove.
12351 (ATTRIBUTE_UNUSED): Define unconditionally.
12352
12353 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 12354 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
12355 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12356 * lib/vbitset.c, lib/vbitset.h: New files.
12357 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12358 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12359 from libbitset.
12360
12361 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12362 `How Can I Reset @code{yyparse}', since texinfo does not allow
12363 arbitrary @ in node names.
12364
12365 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12366 shouldn't be needed according to the gettext 0.12.1 documentation
12367 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 12368 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 12369 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 12370 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 12371
8dd76bee
PE
12372 * lib/.cvsignore: Add stdbool.h.
12373 * m4/.cvsignore: Add nls.m4, po.m4.
12374
12375 Upgrade to CVS gnulib.
12376 * stdbool_.h: File renamed from stdbool.h.in.
12377 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12378 AC_HEADER_STDBOOL.
12379 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12380 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12381 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12382 (MOSTLYCLEANFILES): New var.
12383 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12384 (stdbool.h): New rule.
12385 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12386 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12387 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12388 m4/quote.m4: Upgrade to today's gnulib.
12389
12390 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12391 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12392 the tests right now.
12393 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12394 yyerror are declared before use; C99 requires this.
12395
25005f6a
PH
123962003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12397
12398 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12399 first.
12400 (yyrecoverSyntaxError): Correct the logic for setting and testing
12401 yyerrState.
12402 Correct comment on handling EOF.
12403 Allow states with only a default reduction, rather than failing
8dd76bee 12404 (I can't quite reconstruct why these were not allowed before).
25005f6a 12405
137437c6 12406 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 12407 buffer overruns, corrupting state.
8dd76bee
PE
12408
12409 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
12410 definition.
12411 * src/reader.h (max_left_semantic_context): New variable declaration.
12412 * src/scan-gram.l (max_left_semantic_context): Define.
12413 (handle_action_dollar): Update max_left_semantic_context.
12414 * data/glr.c (YYMAXLEFT): New definition.
12415 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12416 (yyresolveAction): Ditto.
12417
12418 Fixes to problems with location handling in GLR parsers reported by
12419 Frank Heckenbach (2003/06/05).
12420
12421 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12422 (YYRHSLOC): Add parentheses, and define only if locations used.
12423 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12424 locations not used.
12425 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12426 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 12427
25005f6a
PH
12428 * tests/cxx-type.at: Exercise location information; update tests
12429 to differentiate output with and without locations.
8dd76bee 12430 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
12431 because default YYLTYPE not yet defined.
12432 Change semantic actions to compute strings, rather than printing
12433 them directly (to test proper passing of semantics values). Change
12434 output to prefix notation and update test data and expected results.
12435 (yylex): Track locations.
12436 (stmtMerge): Return value rather than printing, and include arguments
12437 in value.
8dd76bee 12438
711f40b7
PE
124392003-06-03 Paul Eggert <eggert@twinsun.com>
12440
12441 Avoid warnings generated by GCC 2.95.4 when Bison is
12442 configured with --enable-gcc-warnings.
12443 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12444 yy::]b4_parser_class_name[::translate_,
12445 yy::Stack::operator[] (unsigned),
12446 yy::Stack::operator[] (unsigned) const,
12447 yy::Slice::operator[] (unsigned),
12448 yy::Slice::operator[] (unsigned) const):
12449 Rename local vars to avoid warnings.
12450 * tests/glr-regression.at (Improper handling of embedded actions
12451 and $-N in GLR parsers): Remove unused local variable from yylex.
12452 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12453 (void) as arg when not pure, since we now assume C89 when building
12454 Bison. Pacify GCC by using parameter.
12455
ac695f7d
PE
124562003-06-02 Paul Eggert <eggert@twinsun.com>
12457
12458 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12459 yy::Location::lines, yy::Location::columns): Rename arguments
12460 to avoid shadowing; this removes a warning generated by GCC 3.3.
12461
26ec81e0
PE
124622003-06-01 Paul Eggert <eggert@twinsun.com>
12463
12464 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12465 to g++, as GCC 3.3 complains if you do it.
12466 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12467 everything that WARNING_CFLAGS has, except omit warnings
12468 not suitable for C++.
12469 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12470 * tests/atlocal.in (CXXFLAGS): New var.
12471 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12472
12473 Fix a GLR parser bug I reported in February; see
161a71f3 12474 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
12475 The problem was that GLR parsers did not conform to the C standard,
12476 because actions like { $1 = $2 + $3; } expanded to expressions
12477 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12478 to a local variable. The C standard says that expressions
12479 like (var = f ()) + (var = f ()) have undefined behavior.
12480 Another problem was that GCC sometimes issues warnings that
12481 yyfill and its parameters are unused.
12482
12483 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12484 as possibly unused.
12485 (yyfill): New function.
12486 (YYFILL): Use it.
12487 (yyuserAction): Change type of yynormal to bool, so that it matches
12488 the new yyfill signature. Mark it as possibly unused.
12489
12490
12491 Follow up on a bug I reported in February, where a Bison-generated
12492 parser can loop. Provide a test case and a fix for yacc.c. I
12493 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12494 The original bug report is in:
161a71f3 12495 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
12496
12497 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12498 macro's size was becoming unwieldy.
12499 (yyerrlab): Do not discard an empty lookahead symbol, as this
12500 might destroy garbage.
12501 (yyerrorlab): New label, with the old contents of YYERROR,
12502 plus the following change: pop the stack of rhs corresponding
12503 to the production that invoked YYERROR. That is how Yacc
12504 behaves, and POSIX requires this behavior.
12505 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12506 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12507 Define 'alarm' to do nothing if unistd.h is not available.
12508 Add a new rule "exp: '-' error;" to test the above change to
12509 data/yacc.c. Use 'alarm' to abort any test taking longer than
12510 10 seconds, as it's probably looping.
12511 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12512 Also, the new yacc.c generates two fewer diagnostics for an
12513 existing test.
12514
d0829076
PE
125152003-05-24 Paul Eggert <eggert@twinsun.com>
12516
c6ae27df
PE
12517 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12518 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12519 This fixes a problem reported by John Bowman when the Compaq/HP
12520 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12521 -ansi -Wall -gall).
12522 * data/yacc.c (union yyalloc): Likewise.
12523 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 12524
d0829076
PE
12525 Switch from 'int' to 'bool' where that makes sense.
12526
12527 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12528 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12529 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12530 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12531 Return or accept bool, not int. All callers changed.
12532 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12533 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12534 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12535 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12536 bitset_or_and_cmp_): Likewise.
12537 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12538 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12539 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12540 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12541 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12542 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12543 bitset_stats_or_and_cmp): Likewise.
12544 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12545 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12546 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12547 ebitset_xor_cmp): Likewise.
12548 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12549 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12550 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12551 lbitset_xor_cmp): Likewise.
12552 * lib/bbitset.h: Include <stdbool.h>.
12553 (struct bitset_vtable): The following members now return bool, not
12554 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12555 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12556 or_and_cmp).
12557 * src/conflicts.c (count_rr_conflicts): Likewise.
12558 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12559 All uses changed.
12560 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12561 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12562 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12563 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12564 graph_flag): Likewise.
12565 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12566 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12567 graph_flag): Likewise.
12568 * src/output.c (error_verbose): Likewise.
12569 * src/output.h (error_verbose): Likewise.
12570 * src/reader.c (start_flag, typed): Likewise.
12571 * src/reader.h (typed): Likewise.
12572 * src/getargs.c (LOCATIONS_OPTION): New constant.
12573 (long_options, getargs): Use it.
12574 * src/lalr.c (build_relations): Use bool, not int.
12575 * src/nullable.c (nullable_compute): Likewise.
12576 * src/print.c (print_reductions): Likewise.
12577 * src/tables.c (action_row, pack_vector): Likewise.
12578 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12579 * src/output.c (prepare): Use it.
12580 * src/output.c (token_definitions_output,
12581 symbol_destructors_output, symbol_destructors_output): Use string,
12582 not boolean integer, to keep track of whether to output separator.
12583 * src/print_graph.c (print_core): Likewise.
12584 * src/state.c (state_rule_lookaheads_print): Likewise.
12585
12586 * config/install-sh: Sync from automake 1.7.5.
12587
6b2584b7
PE
125882003-05-14 Paul Eggert <eggert@twinsun.com>
12589
12590 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12591 semicolon after a grammar declaration, in the interest of possible
12592 future changes to the Bison input language.
12593 Do not allow a stray semicolon at the start of the grammar.
12594 (rhses.1): Allow one or more semicolons after any rule, including
12595 just before "|" as required by POSIX.
12596 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12597 grammar.
12598
caf37a36
ADL
125992003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12600
12601 %parse-param support for lalr1.cc.
12602
12603 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12604 b4_cc_constructor_calls, b4_cc_constructor_call,
12605 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12606 definitions.
12607 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12608 parse-param arguments.
12609 (yy::b4_parser_class_name): Declare instance variables to
12610 hold parse-param arguments.
12611 * tests/calc.at: s/value/semantic_value/ because value clashes
12612 with a member of yy::b4_parser_class_name. Adjust C++ code
12613 to handle %parse-param. Enable %parse-param test in C++.
12614
3ab37077
PE
126152003-05-12 Paul Eggert <eggert@twinsun.com>
12616
12617 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12618 English a bit. Fix fclose typo. Change "const char" to "char
12619 const", and use ANSI C rather than K&R for "main". Suggest
12620 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12621 and suggest yy_switch_to_buffer.
12622
126232003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
12624
12625 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12626 C89. This avoids a diagnostic on compilers that define __STDC__
12627 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 12628 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 12629
e743727f
PE
126302003-05-03 Paul Eggert <eggert@twinsun.com>
12631
12632 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12633 Do not overrun array bounds.
12634 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 12635 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 12636
916708d5
AD
126372003-04-29 Akim Demaille <akim@epita.fr>
12638
12639 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12640 * src/getargs.c, src/getargs.h: here, as bool, not int.
12641 (nondeterministic_parser): New.
12642 * src/parse-gram.y, src/scan-gram.l: Support
12643 %nondeterministic-parser.
12644 * src/output.c (prepare): Use nondeterministic_parser instead
12645 of glr_parser where appropriate.
12646 * src/tables.c (conflict_row, action_row, save_row)
12647 (token_actions, token_actions, pack_vector): Ditto.
12648
a06ea4aa
AD
126492003-04-29 Akim Demaille <akim@epita.fr>
12650
12651 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12652
211074ca
AD
126532003-04-29 Akim Demaille <akim@epita.fr>
12654
12655 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12656 with %pure-parser and %locations to exercise the patch from Yakov
12657 Markovitch below.
12658
6175ffe3
PE
126592003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12660
12661 * data/yacc.c: (b4_lex_param): Corrected for the case where
12662 %lex-param is provided and %pure-parser isn't.
12663
b1e95857
PE
126642003-04-27 Paul Eggert <eggert@twinsun.com>
12665
12666 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 12667 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
12668 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12669 if it is not defined.
12670 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12671
acda9df6
PE
126722003-04-26 Paul Eggert <eggert@twinsun.com>
12673
3470c57b
PE
12674 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12675 Declare to be of type suitable for the ninf value itself, not of
12676 type suitable for the corresponding table, since the latter might
12677 be unsigned but the ninf value might be negative. This fixes a
12678 bug reported by Alexandre Duret-Lutz in
161a71f3 12679 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 12680
acda9df6
PE
12681 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12682 invokes it. We shouldn't invoke it twice because it will attempt
12683 to put error.o in the archive twice. This fixes a glitch reported
12684 by Martin Mokrejs in
161a71f3 12685 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 12686
b5250f26
PE
126872003-04-21 Paul Eggert <eggert@twinsun.com>
12688
12689 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12690 to gnulib.
12691
089ac0f1
PE
126922003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12693
12694 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12695 Fix obvious typo that results in uncompilable GLR parsers
12696 when both %pure-parser and %locations are used. (trivial change)
12697
5ededac6
PE
126982003-04-17 Paul Eggert <eggert@twinsun.com>
12699
1b8f2fff
PE
12700 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12701 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12702 Do not insert the expected token via unput, as this runs afoul
12703 of a POSIX-compatibility bug in flex 2.5.31.
12704 All uses changed to BEGIN the parent state,
12705 since we no longer insert the expected token via unput.
12706 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12707 that is no longer emitted after the above change.
12708
5ededac6
PE
12709 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12710 the first one. This change is from Paul Hilfinger, and it fixes
12711 regression reported by Werner Lemberg in
161a71f3 12712 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
12713
12714 (resolve_sr_conflict): Don't invoke state_errs_set
12715 unless one or more tokens have been explicitly made errors.
12716 Otherwise, the above change causes Bison to abort.
12717
12718 * tests/existing.at (GNU pic Grammar): New test case, taken from
12719 Lemberg's email.
12720
b8be9132
AD
127212003-03-31 Akim Demaille <akim@epita.fr>
12722
12723 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12724
d423d460
AD
127252003-03-31 Akim Demaille <akim@epita.fr>
12726
12727 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12728 output.
12729
c7e441b4
AD
127302003-03-31 Akim Demaille <akim@epita.fr>
12731
12732 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12733 From Paul Hilfinger.
12734
231897ad
AD
127352003-03-29 Akim Demaille <akim@epita.fr>
12736
12737 * m4/error.m4: Do not put under dynamic conditions some code which
12738 expansion is under static control.
12739
5b066063
AD
127402003-03-29 Akim Demaille <akim@epita.fr>
12741
12742 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12743
22a74fec
AD
127442003-03-29 Akim Demaille <akim@epita.fr>
12745
12746 * doc/bison.texinfo (Strings are Destroyed): New.
12747
0eee27e7
PE
127482003-03-13 Paul Eggert <eggert@twinsun.com>
12749
12750 * .cvsignore: Add configure.lineno.
12751 * src/.cvsignore: Add yacc.
12752 * tests/.cvsignore: Add testsuite.log.
12753 * doc/fdl.texi: Sync with latest FSF version.
12754
f61aad93
PE
127552003-03-12 Paul Eggert <eggert@twinsun.com>
12756
537636c7
PE
12757 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12758 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12759 cursor, instead of leaving it undefined. This fixes a bug
12760 reported by Tim Van Holder in
161a71f3 12761 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
12762 * tests/input.at (Torturing the Scanner): Test the scanner on
12763 an empty input file, which was Tim Van Holder's test case.
12764
12765 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12766 <sys/resource.h> can be included, include sys/time.h and
12767 sys/times.h first, if available. This works around the SunOS
12768 4.1.4 porting bug reported by Bruce Becker in
161a71f3 12769 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
12770
12771 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12772 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12773 AC_HEADER_SYS_WAIT.
12774
f61aad93
PE
12775 Merge changes from gnulib. This was prompted because the CVS
12776 snapshot didn't build on Solaris 7 due to strnlen problems.
12777
12778 These changes need to be merged back into gnulib:
12779 * lib/hash.c: Include <stdbool.h> unconditionally.
12780 * m4/onceonly.m4 (m4_quote): New macro.
12781 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12782 Quote AC_FOREACH variable-expansions properly.
12783 The 2003-01-03 obstack.h change also needs merging.
12784 {end of changes requiring merging}
5b066063 12785
f61aad93
PE
12786 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12787 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12788 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12789 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12790 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12791 New files, imported from gnulib.
12792 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12793 above.
12794
12795 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12796 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12797 gnulib sources.
12798
12799 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12800 Add.
12801 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12802 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12803 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12804 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12805 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12806 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12807 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12808 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12809 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12810 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12811 (jm_PREREQ_ARGMATCH): Remove.
12812 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12813 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12814
12815 * src/system.h: Include <stdbool.h> unconditionally.
12816
12817 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12818 assuming at least C89 in the bitset code for some time now.
12819
d2ffe116
AD
128202003-03-03 Akim Demaille <akim@epita.fr>
12821
12822 * ro.po: New.
12823
052826fd
AD
128242003-03-02 Akim Demaille <akim@epita.fr>
12825
12826 * doc/bison.texinfo (Table of Symbols): Reactivate the
12827 documentation for %lex-param, and %parse-param.
12828
c4749565
AD
128292003-03-02 Akim Demaille <akim@epita.fr>
12830
12831 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12832 generate verbose error messages.
12833 Use the number of tokens as an upper bound in yytname, as it
12834 cannot be a non terminal.
12835
d5286af1
AD
128362003-03-02 Akim Demaille <akim@epita.fr>
12837
12838 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12839 message.
12840
22e304a6
AD
128412003-03-02 Akim Demaille <akim@epita.fr>
12842
22e304a6
AD
12843 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12844 Use them to exercise yycheck overrun.
12845 Based on Andrew Suffield's grammar.
12846
67a25fed
AD
128472003-03-02 Akim Demaille <akim@epita.fr>
12848
12849 Create tests/local.at for Bison generic testing macros.
12850
12851 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12852 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12853 This new file.
12854 * tests/calc.at (AT_CHECK_CALC): Adjust.
12855 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12856 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12857 * tests/local.at: here.
12858 (AT_COMPILE_CXX): Tags the tests using it as c++.
12859 Ignore the test if CXX is not functional.
12860
9c2b381f
PE
128612003-03-01 Paul Eggert <eggert@twinsun.com>
12862
12863 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12864 not loc->end, since loc->end might contain garbage and this leads
12865 to undefined behavior on some platforms.
12866 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12867 depend on *loc, so that the reader doesn't give the the false
12868 impression that *loc is initialized.
12869 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12870 does not survive the return.
12871
0433ba88
AD
128722003-03-01 Akim Demaille <akim@epita.fr>
12873
12874 * src/scan-gram.l (code_start): Always initialize it when entering
12875 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12876 yylex invocation. An alternative would be making it static, but
12877 then it starts with the second %%'s beginning, instead of its end.
12878
b305ea69
PE
128792003-02-28 Paul Eggert <eggert@twinsun.com>
12880
12881 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12882 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 12883 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 12884
c3d25e01
PE
128852003-02-26 Paul Eggert <eggert@twinsun.com>
12886
12887 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12888 Remove Sequent/Pyramid discussion (nobody uses them any more).
12889 Merge VMS and MS-DOS discussion; these ports may well be dead
12890 but let's keep mentioning them for now. Put <> around email
12891 addresses. Add copyright notice.
12892
c267ffbc
PE
128932003-02-24 Paul Eggert <eggert@twinsun.com>
12894
12895 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12896 to avoid collision with flex use of yylineno.
12897 Problem reported by Bruce Lilly in
161a71f3 12898 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
12899 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12900 * data/yacc.c (yy_reduce_print): Likewise.
12901
12902 * config/depcomp: Sync with Automake 1.7.3.
12903
f939fc12
AD
129042003-02-21 Akim Demaille <akim@epita.fr>
12905
12906 * data/lalr1.cc: Use temporary variables instead of casts to
12907 change integer types.
12908 Suggested by Paul Eggert.
12909
95923bd6
AD
129102003-02-21 Akim Demaille <akim@epita.fr>
12911
12912 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12913 to avoid confusions with lalr1.cc's notion of Position.
12914 Suggested by Paul Eggert.
12915
2cdc240e
AD
129162003-02-20 Akim Demaille <akim@epita.fr>
12917
12918 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12919 before initial_columns.
12920 (location.hh): Use consistent variable names when defining the
12921 operator<<.
12922 Use "last" so that we subtract from Positions, not from unsigned.
12923
5d003116
AD
129242003-02-20 Akim Demaille <akim@epita.fr>
12925
12926 * data/lalr1.cc (position.hh): New subfile, including the extended
12927 and Doxygen'ed documentation of class Position.
12928 (location.hh): Use it.
12929 Document a` la Doxygen.
ba1ecc07 12930 With the help of Benoit Perrot.
5d003116 12931
d02b25f9
AD
129322003-02-20 Akim Demaille <akim@epita.fr>
12933
12934 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12935 AT_YACC_IF.
12936 Redefine AT_YYERROR_SEES_LOC_IF using it.
12937 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12938 not defined.
12939 Don't use the location in yy::Parser::error_ and
12940 yy::Parser::print_ when not %locations.
12941 Activate more lalr1.cc tests.
12942
0d1c3a04
AD
129432003-02-19 Akim Demaille <akim@epita.fr>
12944
12945 * data/lalr1.cc: When displaying a line number, be sure to make it
12946 an int.
12947
60a777aa
AD
129482003-02-19 Akim Demaille <akim@epita.fr>
12949
12950 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12951 Remove, useless.
12952 (YYABORT, YYACCEPT, YYERROR): New.
12953 * tests/calc.at: Renable the lalr1.cc test.
12954
0b86fc41
AD
129552003-02-19 Akim Demaille <akim@epita.fr>
12956
12957 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12958 error recovery, mixing with/without pops and discarding of the
12959 lookahead.
12960 Exercise YYERROR.
12961 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12962
da99a5dc
PE
129632003-02-17 Paul Eggert <eggert@twinsun.com>
12964
12965 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12966 * tests/testsuite.at (AT_COMPILE): Use them.
12967 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 12968 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 12969
93b8c255
PE
129702003-02-12 Paul Eggert <eggert@twinsun.com>
12971
12972 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12973 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 12974 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
12975 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12976 Check for malloc failure, for consistency with yacc.c.
12977 (yytname_size): Remove, for consistency with yacc.c.
12978
12979 The bug still remains in data/lalr1.cc, as I didn't have time
12980 to fix it there.
12981
7548fed2
AD
129822003-02-06 Akim Demaille <akim@epita.fr>
12983
12984 * configure.ac (GXX): Rename as...
12985 (CXX): this, to keep the original Autoconf semantics.
12986 Require 2.57.
12987 * data/lalr1.cc: Fix b4_copyright invocations.
12988 If YYDEBUG is not defined, don't depend upon name_ being defined.
12989 (location.hh): Include string and iostream.
12990 (Position::filename): New member.
12991 (Position::Position ()): New.
12992 (operator<< (Position)): New.
12993 (operator- (Position, int)): New.
12994 (Location::first, Location::last): Rename as...
12995 (Location::begin, Location::end): these, to mock the conventional
12996 iterator names.
12997 (operator<< (Location)): New.
12998 * tests/atlocal.in (CXX): New.
12999 * tests/testsuite.at (AT_COMPILE_CXX): New.
13000 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13001 locations in a more synthetic way.
13002 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13003 lalr1.cc is used.
13004 Adjust the C locations to match those from Emacs: first column is
13005 column 0.
13006 Change all the expected results.
13007 Conform to the GCS: simplify the locations when applicable.
13008 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13009 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13010 these CPP macros with the m4 macros new defined by...
13011 (AT_CHECK_PUSHDEFS): this, i.e.:
13012 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 13013 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
13014 New macros.
13015 (AT_CHECK_POPDEFS): Undefine them.
13016 (AT_CHECK_CALC_LALR1_CC): New.
13017 Use it for the first lalr1.cc test.
13018
43a176ef
AD
130192003-02-04 Akim Demaille <akim@epita.fr>
13020
13021 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13022 Location as is defined.
13023
fc049e9c
AD
130242003-02-04 Akim Demaille <akim@epita.fr>
13025
13026 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13027 name_ being defined.
13028
a737b216
PE
130292003-02-03 Paul Eggert <eggert@twinsun.com>
13030
13031 * src/gram.h (start_symbol): Remove unused decl.
13032
13033 Use more-consistent naming conventions for local vars.
13034
13035 * src/derives.c (derives_compute): Change type of local var from
13036 int to rule_number.
13037 * src/gram.c (grammar_rules_partial_print): Likewise.
13038 * src/print.c (print_core): Likewise.
13039 * src/reduce.c (reduce_grammar_tables): Likewise.
13040
13041 * src/gram.c (grammar_dump): Change name of item_number *
13042 local var from r to rp.
13043 * src/nullable.c (nullable_compute): Likewise.
13044
13045 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13046
13047 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13048 for symbol or symbol_number var.
13049 * src/reader.c (grammar_start_symbol_set): Likewise.
13050 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13051 Likewise.
13052 * src/state.c (transitions_to): Likewise.
13053 * src/state.h: Likewise.
13054 * src/tables.c (symbol_number_to_vector_number): Likewise.
13055
13056 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13057 char * var.
13058
13059 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13060 var.
13061
13062 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13063 var.
13064
13065 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13066 Use str, not s, for char * var. Use ch, not c, for character var.
13067 Use size for size var.
13068
13069 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13070 char * var.
13071 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13072 uniqstr var.
13073 * src/uniqstr.h: Likewise.
13074
13075 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13076 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13077 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13078 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13079 param to have same name as that of enum, so that we don't use
13080 "s" to stand for a non-state.
13081
68e93ad5
AD
130822003-02-02 Akim Demaille <akim@epita.fr>
13083
13084 * src/scan-skel.l: Scan more than one inert character per yylex
13085 invocation.
13086
92898986
PE
130872003-02-01 Paul Eggert <eggert@twinsun.com>
13088
13089 Version 1.875a.
13090
1d9d5d71
PE
13091 * po/LINGUAS: Add ms.
13092
0435d061
AD
130932003-01-30 Akim Demaille <akim@epita.fr>
13094
13095 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13096
6029a57f
PH
130972003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13098
13099 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13100 of $1.
0435d061
AD
13101
13102 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 13103 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 13104 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 13105
6029a57f
PH
13106 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13107 (b4_rhs_location): Ditto.
0435d061 13108 (yyfill): New function to copy from stack tree into array
6029a57f 13109 incrementally.
0435d061
AD
13110 (yyuserAction): Modify to allow incremental move of semantic values
13111 to rhs array when in GLR mode.
13112 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
13113 as needed.
13114 Remove dummy use of yystack, as there is now a guaranteed use.
13115 (yydoAction): Modify to allow incremental move of semantic values
13116 to rhs array when in GLR mode.
13117 (yyresolveAction): Ditto.
13118 (yyglrShiftDefer): Update comment.
0435d061 13119 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
13120 (yyglrReduce): Ditto.
13121 (yydoAction): Ditto
0435d061 13122
6029a57f
PH
13123 * tests/glr-regr1.at: Rename to ...
13124 * tests/glr-regression.at: Add new regression test for the problems
13125 described above (adapted from S. Eken).
13126 Update copyright notice.
13127 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13128 * tests/Makefile.am: Ditto.
13129
6cee6297
PE
131302003-01-28 Paul Eggert <eggert@twinsun.com>
13131
13132 * data/lalr1.cc: Do not use @output_header_name@ unless
13133 b4_defines_flag is set. This fixes two bugs reported by
13134 Tim Van Holder in
161a71f3
PE
13135 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13136 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 13137
b2a836b5
PE
131382003-01-21 Paul Eggert <eggert@twinsun.com>
13139
13140 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13141 we don't need to worry about yyerrlab1 being reported as an
13142 "unused label" by non-GCC C compilers. The downside is that if
13143 locations are used then a couple of statements are duplicated each
13144 time YYERROR is invoked, but the upside is that the warnings
13145 should vanish.
13146 (yyerrlab1): Move code to YERROR.
13147 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13148 This reverts some of the 2002-12-27 change.
13149
4196b931
PE
131502003-01-17 Paul Eggert <eggert@twinsun.com>
13151
13152 * src/output.c (symbol_printers_output): Fix typo that led
13153 to core dump. Problem reported by Antonio Rus in
161a71f3 13154 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 13155
3ae831b4
AD
131562003-01-13 Akim Demaille <akim@epita.fr>,
13157 Quoc Peyrot <chojin@lrde.epita.fr>,
13158 Robert Anisko <anisko_r@lrde.epita.fr>
13159
13160 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13161 when the stacks contain one element, as the loop would otherwise
13162 free the last state, and then use the top state (the one we just
13163 popped). This means that the initial elements will not be freed
13164 explicitly, as is the case in yacc.c; it is not a problem, as
13165 these elements have fake values.
13166
e3aa65c5
PE
131672003-01-11 Paul Eggert <eggert@twinsun.com>
13168
13169 * NEWS: %expect-violations are now just warnings, reverting
13170 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13171 bootstrapping problem reported by Matthias Klose; see
161a71f3 13172 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13173 * src/conflicts.c (conflicts_print): Likewise.
13174 * tests/conflicts.at (%expect not enough, %expect too much,
13175 %expect with reduce conflicts): Likewise.
13176 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13177 that the warning is enabled if the number of conflicts changes
13178 (not necessarily increases).
13179
13180 * src/getargs.c (version): Update copyright year.
13181
f0057011
AD
131822003-01-09 Akim Demaille <akim@epita.fr>
13183
13184 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13185
1ee6d2a0
PE
131862003-01-08 Paul Eggert <eggert@twinsun.com>
13187
13188 * Makefile.maint (WGETFLAGS):
13189 New macro, containing "-C off" to disable proxy caches.
13190 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13191 (rel-check): Use $(WGET) instead of wget.
13192
d4fd77c4
PE
131932003-01-06 Paul Eggert <eggert@twinsun.com>
13194
13195 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13196 the GLR paper of Scott, Johnstone and Hussain.
13197
464c6927
PE
131982003-01-04 Paul Eggert <eggert@twinsun.com>
13199
d600ee67
PE
13200 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13201 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13202 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13203 (EXTRA_LIBRARIES): New var, for liby.a.
13204 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13205 (EXTRA_SCRIPTS): New var, for yacc.
13206
464c6927
PE
13207 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13208 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13209 Problem reported by Nelson H. F. Beebe.
13210
132112003-01-03 Paul Eggert <eggert@twinsun.com>
13212
13213 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13214 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13215 when compiling Bison 1.875's `bitset bset = obstack_alloc
13216 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13217
13218 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13219 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13220 grow to a huge size with typical invocation.
d600ee67 13221
464c6927
PE
13222 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13223 Use the pattern recommended by Autoconf 2.57, except also protect
13224 against double-definition.
13225 * src/system.h: Likewise.
13226 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13227
464c6927
PE
13228 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13229 All uses changed. Provide a definition in both C and C++.
13230 (yytrue, yyfalse): Define even if defined (__cplusplus).
13231
13232 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13233 Reported by Nelson H. F. Beebe.
d600ee67 13234
464c6927
PE
13235 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13236
0f42c7d5
PE
132372003-01-02 Paul Eggert <eggert@twinsun.com>
13238
13239 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13240 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13241 Bug reported by Nelson H. F. Beebe.
13242
dc546b0f
PE
132432003-01-01 Paul Eggert <eggert@twinsun.com>
13244
13245 * Version 1.875.
13246
2c09b6a7
PE
132472002-12-30 Paul Eggert <eggert@twinsun.com>
13248
13249 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13250 Moved here from...
13251 (<INITIAL>","): Here. This causes stray "," to be treated
13252 more uniformly.
13253
dc546b0f 13254 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13255 last brace in braced code when not in Yacc mode, for compatibility
13256 with Bison 1.35. This resurrects the 2001-12-15 patch to
13257 src/reader.c.
13258
13259 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13260 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13261
535c0f63
PE
132622002-12-28 Paul Eggert <eggert@twinsun.com>
13263
13264 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13265 that of SYM's type. This fixes Debian bug 168069, reported by
13266 Thomas Olsson.
d600ee67 13267
963fcc17
PE
132682002-12-28 Paul Eggert <eggert@twinsun.com>
13269
13270 Version 1.75f.
13271
13272 Switch back to the Yacc style of conflict reports, undoing some
13273 of the 2002-07-30 change.
13274 * doc/bison.texinfo (Understanding): Use Yacc style for
13275 conflict reports. Also, use new way of locating rules.
13276 * src/conflicts.c (conflict_report):
13277 Renamed from conflict_report_yacc, removing the old
13278 'conflict_report'. Translate the entire conflict report at once,
13279 so that we don't assume that "," has the same interpretation in
13280 all languages.
13281 (conflicts_output): Use Yacc-style conflict report for each state,
13282 instead of our more-complicated style.
13283 (conflicts_print): Use Yacc-style conflict report, except print
13284 the input file name when not emulating Yacc.
13285 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13286 Conflicted Reduction, %expect not enough, %expect too much,
13287 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13288 * tests/existing.at (GNU Cim Grammar): Likewise.
13289 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13290
13291 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13292 fatal): Don't invoke fflush; it's not needed and it might even be
13293 harmful for stdout, as stdout might not be open.
13294 * src/reduce.c (reduce_print): Likewise.
13295
b1efe548
PE
132962002-12-27 Paul Eggert <eggert@twinsun.com>
13297
13298 Fix a bug where error locations were not being recorded correctly.
13299 This problem was originally reported by Paul Hilfinger in
161a71f3 13300 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13301
13302 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13303 top of the location stack's error locations.
13304 (yyerrlab): Set it. When discarding a token, push its location
13305 onto yylerrsp so that we don't lose track of the error's end.
13306 (yyerrlab1): Now is only the target of YYERROR, so that we can
13307 properly record the location of the action that failed. For GCC
13308 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13309 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13310 (yyerrlab2): New label, which yyerrlab now falls through to.
13311 Compute the error's location by applying YYLLOC_DEFAULT to
13312 the locations of all the symbols that went into the error.
13313 * doc/bison.texinfo (Location Default Action): Mention that
13314 YYLLOC_DEFAULT is also invoked for syntax errors.
13315 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13316 Error locations include the locations of all the tokens that were
13317 discarded, not just the last token.
d600ee67 13318
983c5c2c
PE
133192002-12-26 Paul Eggert <eggert@twinsun.com>
13320
b1efe548
PE
13321 * src/files.c: Include quote.h.
13322 (compute_output_file_names): Warn if we detect conflicting
13323 outputs to the same file. This should catch the misunderstanding
13324 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13325
13326 * src/conflicts.c (conflicts_print): If the user specifies
13327 "%expect N", report an error if there are any reduce/reduce
13328 conflicts. This is what the manual says should happen.
13329 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13330 * tests/conflicts.at (%expect with reduce conflicts): New test.
13331
983c5c2c
PE
13332 Don't use m4_include on relative file names, as it doesn't work as
13333 desired if there happens to be a file with that name under ".".
d600ee67 13334
983c5c2c
PE
13335 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13336 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13337 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13338 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13339 * src/output.c (output_skeleton): Use full path names when
13340 specifying a file to include; don't rely on include path, as
13341 it's unreliable when the working file contains a file with
13342 that name.
d600ee67 13343
983c5c2c
PE
133442002-12-25 Paul Eggert <eggert@twinsun.com>
13345
13346 Remove obsolete references to bison.simple and bison.hairy.
13347 Problem mentioned by Aubin Mahe in
161a71f3 13348 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
13349 * data/glr.c: Comment fix.
13350 * doc/bison.1: Remove references. Also, mention "yacc".
13351
13352 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13353 with -g option.
13354
13355 * src/parse-gram.y (declaration): Use enum "report_states" rather
13356 than its numeric value 1.
13357
13358 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13359 opening a new one. This fixes Debian bug 165349, reported by
13360 Bruce Stephens.
13361
23f2d9dc
PE
133622002-12-24 Paul Eggert <eggert@twinsun.com>
13363
13364 Version 1.75e.
13365
13366 * Makefile.maint (cvs-update): Don't assume that the shell
13367 supports $(...), as Solaris sh doesn't.
13368
13369 * src/parse-gram.y (lloc_default): Remove test for empty
13370 nonterminals at the end, since it didn't change the result.
13371
133722002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
13373
13374 If the user does not define YYSTYPE as a macro, Bison now declares it
13375 using typedef instead of defining it as a macro. POSIX requires this.
13376 For consistency, YYLTYPE is also declared instead of defined.
13377
13378 %union directives can now have a tag before the `{', e.g., the
13379 directive `%union foo {...}' now generates the C code
13380 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13381 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13382 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13383 instead of `yyltype'.
13384
13385 `yystype' and `yyltype' are now obsolescent macros instead of being
13386 typedefs or tags; they are no longer documented and will be
13387 withdrawn in a future release.
13388
13389 * data/glr.c (b4_location_type): Remove.
13390 (YYSTYPE): Renamed from yystype.
13391 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13392 (struct YYLTYPE): Renamed from struct yyltype.
13393 (YYLTYPE): Renamed from yyltype.
13394 (yyltype, yystype): New (and obsolescent) macros,
13395 for backward compatibility.
13396 * data/yacc.c: Likewise.
13397
13398 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13399 does not specify a union tag. This is for compatibility with
13400 Solaris 9 yacc.
13401
13402 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13403 const *, since it is now modified by stripping surrounding { }.
13404 (current_braced_code): Remove.
13405 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13406 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13407 trailing " {...}". Now of type <chars>.
13408 (grammar_declaration): Adjust to bundled tokens.
13409 (code_content): Remove; stripping is now done by add_param.
13410 (print_token_value): Print contents of bundled tokens.
13411 (token_name): New function.
13412
13413 * src/reader.h (braced_code, current_braced_code): Remove.
13414 (token_name): New decl.
13415
13416 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13417 token_type, not braced_code code_kind. All uses changed.
13418 (SC_PRE_CODE): New state, for scanning after a keyword that
13419 has (or usually has) an immediately-following braced code.
13420 (token_type): New local var, to keep track of which token type
13421 to return when scanning braced code.
13422 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 13423 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
13424 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13425 instead of returning a token type immediately.
13426 (<INITIAL>"{"): Set token type.
13427 (<SC_BRACED_CODE>"}"): Use it.
13428 (handle_action_dollar, handle_action_at): Now returns bool
13429 indicating success. Fail if ! current_rule; this prevents a core dump.
13430 (handle_symbol_code_dollar, handle_symbol_code_at):
13431 Remove; merge body into caller.
13432 (handle_dollar, handle_at): Complain in invalid contexts.
13433
13434 * NEWS, doc/bison.texinfo: Document the above.
13435 * NEWS: Fix years and program names in copyright notice.
13436
879ca4f8
PE
134372002-12-17 Paul Eggert <eggert@twinsun.com>
13438
13439 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13440 Reporting, Table of Symbols): Omit mentions of %lex-param and
13441 %parse-param from the documentation for now.
13442
1c5fe69d
PE
134432002-12-15 Paul Eggert <eggert@twinsun.com>
13444
13445 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13446 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13447 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
13448 disagreed with the Bison documentation. Bug
13449 reported by Andrew Walrond.
d600ee67 13450
1c5fe69d
PE
13451 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13452 as the caller now does that.
13453 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13454 (YYEMPTY): Parenthesize right hand side, since others use it.
13455 (yyparse): Don't assume that our generated code is the only code
13456 that sets yychar.
13457
d1de5372
PE
134582002-12-13 Paul Eggert <eggert@twinsun.com>
13459
13460 Version 1.75d.
13461
13462 POSIX requires a "yacc" command.
13463 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13464 (MOSTLYCLEANFILES): Add yacc.
13465 (yacc): New rule.
1c5fe69d 13466 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
13467 as an alias for bison y.
13468
13469 * po/LINGUAS: Add da.
d600ee67 13470
d1de5372
PE
13471 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13472 problem with latest <getopt.h>.
13473 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13474
13475 * doc/fdl.texi: Upgrade to 1.2.
13476 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13477 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13478 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13479 gnulib.
13480 * config/install-sh: Sync with autotools.
13481
13482 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 13483 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
13484 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13485 locations are requested.
13486 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13487 locations are requested.
13488
d0f3fe23
PE
134892002-12-12 Paul Eggert <eggert@twinsun.com>
13490
13491 Remove unportable casts and storage allocation tricks.
13492 While we're at it, remove almost all casts, since they
13493 usually aren't needed and are a sign of trouble.
13494
13495 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13496
13497 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13498 the pointer DSET returned by malloc; this isn't portable.
13499 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13500 Similarly for DERIVES.
13501 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13502 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13503 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13504
13505 * src/derives.c (derives_compute): Do not bother invoking
13506 int_of_rule_number, since rule numbers are integers.
13507
13508 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13509 rather than XMALLOC (char, N).
13510
13511 * src/files.c (filename_split): Rewrite to avoid cast.
13512
13513 * src/gram.h (symbol_number_as_item_number,
13514 item_number_as_symbol_number, rule_number_as_item_number,
13515 item_number_as_rule_number):
13516 Now inline functions rather than macros, to avoid casts.
13517 * src/state.h (state_number_as_int): Likewise.
13518 * src/tables.c (state_number_to_vector_number,
13519 symbol_number_to_vector_number): Likewise.
13520
13521 * src/gram.h (int_of_rule_number): Remove; no longer used.
13522
13523 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13524 since the resulting storage is always stored into.
13525
13526 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13527 where it's needed.
13528
13529 * src/muscle_tab.c (muscle_m4_output):
13530 Now inline. Return bool, not int.
13531 * src/state.c (state_compare): Likewise.
13532 * src/symtab.c (symbol_check_defined,
13533 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13534 hash_compare_symbol, hash_symbol):
13535 Likewise.
13536 * src/uniqstr.c (uniqstr_print): Likewise.
13537 * src/muscle_tab.c (muscle_m4_output_processor):
13538 New function, to avoid casts.
13539 * src/state.c (state_comparator, stage_hasher): Likewise.
13540 * src/symtab.c (symbol_check_defined_processor,
13541 symbol_check_alias_consistency_processor, symbol_pack_processor,
13542 symbol_translation_processor, hash_symbol_comparator,
13543 hash_symbol_hasher): Likewise.
13544 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13545 * src/muscle_tab.c (muscles_m4_output):
13546 Use new functions instead of casting old functions unportably.
13547 * src/state.c (state_hash_new): Likewise.
13548 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13549 symbols_token_translations_init):
13550 Likewise.
13551 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13552
13553 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13554 var instead of casting to long, to avoid casts.
13555 (prepare_states): Use MALLOC rather than alloca, so that we don't
13556 have to worry about alloca.
13557 * src/state.c (state_hash_lookup): Likewise.
13558
13559 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13560 local var instead of casting to unsigned char, to avoid casts.
13561
13562 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13563 STATE_ALLOC): Remove.
13564 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13565 rather than calloc, and use offsetof to avoid allocating slightly
13566 too much storage.
13567 (state_new): Initialize all members.
13568
13569 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13570
13571 * src/symtab.c (symbol_free): Remove; unused.
13572 (symbol_get): Remove cast in lhs of assignment.
13573 (symbols_do): Now static. Accept generic arguments, not
13574 hashing-related ones.
13575
13576 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13577 (symbol_processor): Remove.
13578 (symbols_do): Remove decl; now static.
13579
13580 * src/system.h (alloca): Remove; decl no longer needed.
13581 (<stddef.h>): Include, for offsetof.
13582 (<inttypes.>, <stdint.h>): Include if available.
13583 (uintptr_t): New type, if system lacks it.
13584 (CALLOC, MALLOC, REALLOC): New macros.
13585 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13586 new macros.
13587
13588 * src/tables.c (table_size): Now int, to pacify GCC.
13589 (table_grow, table_ninf_remap): Use signed table size.
13590 (save_row): Don't bother initializing locals when not needed.
13591 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13592 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13593
13594 * src/vcg.h: Correct misspellings.
13595
13596 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13597
13598
13599 * src/getargs.c (getargs): Don't assume EOF == -1.
13600
26b4a969
PE
136012002-12-09 Paul Eggert <eggert@twinsun.com>
13602
13603 Change identifier spellings to avoid collisions with names
13604 that are reserved by POSIX.
13605
13606 Don't use names ending in _t, since POSIX reserves them.
13607 For consistency, remove _e and _s endings -- they're weren't
13608 needed to remove ambiguity. All uses changed.
13609 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13610 turn was just renamed from struniq_t.
13611 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13612 which in turn was just renamed from struniq_processor_t.
13613 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13614 in turn was renamed from hash_compare_struniq_t.
13615 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13616 (state_list): Renamed from state_list_t.
13617 * src/assoc.h (assoc): Renamed from assoc_t.
13618 * src/conflicts.c (enum conflict_resolution): Renamed from
13619 enum conflict_resolution_e.
13620 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13621 (rule_list): Renamed from rule_list_t.
13622 * src/getargs.h (enum trace): Renamed from enum trace_e.
13623 (enum report): Renamed from enum report_e.
13624 * src/gram.h (item_number): Renamed from item_number_t.
13625 (rule_number): Renamed from rule_number_t.
13626 (struct rule_s): Remove the "rule_s" part; not used.
13627 (rule): Renamed from rule_t.
13628 (rule_filter): Renamed from rule_filter_t.
13629 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13630 (goto_list): Renamed from goto_list_t.
13631 * src/lalr.h (goto_number): Renamed from goto_number_t.
13632 * src/location.h (location): Renamed from location_t.
13633 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13634 and moved here from:
13635 * src/muscle_tab.h (muscle_entry_t): here.
13636 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13637 (rule_list): Renamed from rule_list_t.
13638 * src/print_graph.c (static_graph): Renamed from graph.
13639 * src/reader.h (braced_code): Renamed from braced_code_t.
13640 Remove brace_code_e tag.
13641 * src/relation.h (relation_node): Renamed from relation_node_t.
13642 (relation_nodes): Renamed from relation_nodes_t.
13643 (relation): Renamed from relation_t.
13644 * src/state.h (state_number): Renamed from state_number_t.
13645 (struct state): Renamed from struct state_s.
13646 (state): Renamed from state_t.
13647 (transitions): Renamed from transitions_t. Unused (and
13648 misspelled) transtion_s tag removed.
13649 (errs): Renamed from errs_t. Unused errs_s tag removed.
13650 (reductions): Renamed from reductions_t. Unused tag
13651 reductions_s removed.
13652 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13653 (struct symbol_list): Renamed from struct symbol_list_s.
13654 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13655 (struct symbol): Renamed from struct symbol_s.
13656 (symbol): Renamed from symbol_t.
13657 * src/tables.c (vector_number): Renamed from vector_number_t.
13658 (action_number): Renamed from action_t.
13659 * src/tables.h (base_number): Renamed from base_t.
13660 * src/vcg.h (enum color): Renamed from enum color_e.
13661 (enum textmode): Renamed from enum textmode_e.
13662 (enum shape): Renamed from enum shape_e.
13663 (struct colorentry): Renamed from struct colorentry_s.
13664 (struct classname): Renamed from struct classname_s.
13665 (struct infoname): Renamed from struct infoname_s.
13666 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13667 (enum decision): Renamed from enum decision_e.
13668 (enum orientation): Renamed from enum orientation_e.
13669 (enum alignment): Renamed from enum alignment_e.
13670 (enum arrow_mode): Renamed from enum arrow_mode_e.
13671 (enum crossing_type): Renamed from enum crossing_type_e.
13672 (enum view): Renamed from enum view_e.
13673 (struct node): Renamed from struct node_s.
13674 (node): Renamed from node_t.
13675 (enum linestyle): Renamed from enum linestyle_e.
13676 (enum arrowstyle): Renamed from enum arrowstyle_e.
13677 (struct edge): Renamed from struct edge.
13678 (edge): Renamed from edge_t.
13679 (struct graph): Renamed from struct graph_s.
13680 (graph): Renamed from graph_t.
13681 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13682 Rename value_t -> value.
13683 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13684 value_t_as_yystype -> value_as_yystype.
13685
13686 Don't include <errno.h> in the mainstream code, since it
13687 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13688 * lib/get-errno.c, lib/get-errno.h: New files.
13689 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13690 get-errno.c.
13691 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13692 * src/output.c (output_skeleton): Likewise.
13693 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13694 instead of errno.
13695 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13696 Likewise.
13697 (handle_action_dollar, handle_action_at): Likewise.
13698 * src/system.h: Do not include <errno.h>.
13699 (TAB_EXT): Renamed from EXT_TAB.
13700 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13701
13702 Avoid str[a-z]*, since <string.h> reserves that name space.
13703 Change all instances of "struniq" in names to "uniqstr", and
13704 likewise for "STRUNIQ" and "UNIQSTR".
13705 * src/uniqstr.c: Renamed from src/struniq.c.
13706 * src/uniqstr.h: Renamed from src/struniq.h.
13707 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13708 * src/files.c (strsuffix): Remove; unused.
13709 (concat2): Renamed from stringappend. Now static.
13710 * src/files.h (strsuffix, stringappend): Remove; unused.
13711 * src/parse-gram.y (<chars>): Renamed from <string>.
13712 (<uniqstr>): Renamed from <struniq>.
13713 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13714 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13715 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13716 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13717 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13718 (N_EXPAND): Renamed from N_STRETCH.
13719
13720 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13721 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13722 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13723 Remove; unused.
13724 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13725 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13726 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13727 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13728 (BASE_MAXIMUM): Renamed from BASE_MAX.
13729 (BASE_MINIMUM): Renamed from BASE_MIN.
13730 (ACTION_MAX): Remove; unused.
13731 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13732 Unnecessary casts removed from above defines.
13733
13734
13735 Fix misspelling in names.
13736 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13737 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13738 G_NODE_ALIGNEMENT.
13739
13740
13741 * lib/timevar.c (timevar_report): Renamed from time_report,
13742 for consistency with other names.
13743 * lib/timevar.h (timevar_report): New decl.
13744 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13745
13746
13747 Sort include-file uses.
13748
13749 Reorder all include files under src to be in the order "system.h".
13750 then the ../lib include files in angle brackets (alphabetized),
13751 then the . include files in double-quotes (alphabetized). Fix
13752 dependency breakages encountered in this process, as follows:
13753 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13754 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13755 * src/state.h: Include "symtab.h".
13756
996b1c7e
PE
137572002-12-08 Paul Eggert <eggert@twinsun.com>
13758
13759 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13760 since this causes problems when __file__ contains character
13761 sequences like "@" that are treated specially by src/scan-skel.l.
13762 Instead, just use the file's basename. This fixes the bug
13763 reported by Martin Mokrejs in
161a71f3 13764 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 13765
e19c4e5d
PE
137662002-12-06 Paul Eggert <eggert@twinsun.com>
13767
13768 Add support for rules that do not have trailing semicolons, as
13769 POSIX requires. Improve the quality of locations in Bison
13770 diagnostics.
26b4a969 13771
e19c4e5d
PE
13772 * src/location.c: Include <quotearg.h>.
13773 (empty_location): Now const.
13774 (location_print): New function. Follow the recommendation of the
13775 GNU Coding Standards for locations that span file boundaries.
13776 * src/location.h: Do not include <quotearg.h>; no longer needed.
13777 (boundary): New type.
13778 (location_t): Use it. This allows locations to span file boundaries.
13779 All member uses changed: file -> start.file or end.file (as needed),
13780 first_line -> start.line, first_column -> start.column,
13781 last_line -> end.line, last_column -> end.column.
13782 (equal_boundaries): New function.
13783 (LOCATION_RESET, LOCATION_STEP): Remove.
13784 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13785 (empty_location): Now const.
13786 (location_print): New decl.
13787 * src/parse-gram.y (lloc_default): New function, which handles
13788 empty locations more accurately.
13789 (YYLLOC_DEFAULT): Use it.
13790 (%token COLON): Remove.
13791 (%token ID_COLON): New token.
26b4a969 13792 (rules): Use it.
e19c4e5d
PE
13793 (declarations, rules): Remove trailing semicolon.
13794 (declaration, rules_or_grammar_declaration):
13795 Allow empty (";") declaration.
13796 (symbol_def): Remove empty actions; no longer needed.
13797 (rules_or_grammar_declaration): Remove trailing semicolon.
13798 (semi_colon.opt): Remove.
13799 * src/reader.h: Include location.h.
13800 (scanner_cursor): New decl.
13801 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13802 rolling our own.
13803 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13804 of *loc.
13805 (STEP): Remove. No longer needed, now that adjust_location does
13806 the work. All uses removed.
13807 (scanner_cursor): New var.
13808 (adjust_location): Renamed from extend_location. It now sets
13809 *loc and adjusts the scanner cursor. All uses changed.
13810 Don't bother testing for CR.
13811 (handle_syncline): Remove location arg; now updates scanner cursor.
13812 All callers changed.
13813 (unexpected_end_of_file): Now accepts start boundary of token or
13814 comment, not location. All callers changed. Update scanner cursor,
13815 not the location.
13816 (SC_AFTER_IDENTIFIER): New state.
13817 (context_state): Renamed from c_context. All uses changed.
13818 (id_loc, code_start, token_start): New local vars.
13819 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13820 processing of Yacc white space and equivalents here.
13821 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13822 instead of returning ID immediately, since we need to search for
13823 a subsequent colon.
13824 (<INITIAL>"'", "\""): Save token_start.
13825 (<INITIAL>"%{", "{", "%%"): Save code_start.
13826 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13827 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13828 BEGIN context_state at end, not INITIAL.
13829 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13830 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13831 Return correct token start.
13832 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13833 the start of a character, string or multiline comment is found.
13834 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13835 Reduction): Adjust reported locations to match the more-precise
13836 results now expected.
13837 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13838 * tests/reduce.at (Useless Rules, Reduced Automaton,
13839 Underivable Rules): Likewise.
13840 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13841 or "|"' now that so many other tokens are allowed by the new grammar.
13842
13843 * src/complain.h (current_file): Remove duplicate decl;
13844 current_file is now owned by files.h.
13845 * src/complain.c, src/scan-gram.l: Include files.h.
13846
138472002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 13848
e19c4e5d
PE
13849 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13850 promotes to int; it might be unsigned int.
13851 * data/yacc.c (yy_reduce_print): Likewise.
13852
13853 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13854 be #defined in the prologue, not in the Bison declarations.
13855 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 13856
b64755e3
PE
138572002-12-02 Paul Eggert <eggert@twinsun.com>
13858
13859 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13860 * lib/strtoul.c: New file, from gnulib.
13861 This fixes a porting bug reported by Peter Klein in
161a71f3 13862 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 13863
6e746484
PE
138642002-11-30 Paul Eggert <eggert@twinsun.com>
13865
b64755e3
PE
13866 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13867 and put only a forward declaration in the prologue. This is for
13868 consistency with the other scanner helper functions.
13869
6ba55592
PE
13870 Type clashes now generate warnings, not errors, since it
13871 appears that POSIX may allow some grammars with type clashes.
13872 * src/reader.c (grammar_current_rule_check): Warn about
13873 type clashes instead of complaining.
13874 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13875
6e746484
PE
13876 Add Yacc library, since POSIX requires it.
13877 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13878 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13879 * lib/main.c, lib/yyerror.c: New files.
13880
13881 gram_error can be static; it need not be extern.
13882 * src/reader.h (gram_error): Remove decl.
13883 * src/parse-gram.y (gram_error): Now static. Add static decl.
13884 (print_token_value): Omit parameter names from forward decl,
13885 for consistency.
13886
88510f9c
PE
138872002-11-29 Paul Eggert <eggert@twinsun.com>
13888
6e746484
PE
13889 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13890 be declared before being used. E.g., one should typically
13891 declare them in the prologue. Use GNU coding style in examples.
13892 Put "const" consistently after the type it modifies. Mention
13893 that C99 supports "inline". Mention that yyerror traditionally
13894 returns "int".
13895
88510f9c
PE
13896 %parse-param and %lex-param now take just one argument, the
13897 declaration; the argument name is deduced from the declaration.
13898
13899 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13900 Reporting, Table of Symbols): Document this.
13901 * src/parse-gram.y (add_param): New function.
13902 (COMMA): Remove.
13903 (declaration): Implement new rule for %parse-param and %lex-param.
13904 * src/scan-gram.l: "," now elicits a warning, rather than being
13905 a token; this is more compatible with byacc.
13906 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13907
bb92250c
PE
139082002-11-27 Paul Eggert <eggert@twinsun.com>
13909
13910 Rename identifiers to avoid real and potential collisions.
13911
13912 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13913 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 13914 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
13915 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13916 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13917 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13918 All uses changed.
13919 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13920 The name "yycontrol" violates the name space rules, and this stuff
13921 wasn't being used anyway.
13922 (input): Remove action; this stuff wasn't being used.
13923 (gram_error): Rename local variable yylloc -> loc.
13924 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13925 (YY_DECL): Don't use "yy" at start of local variables.
13926 All uses changed, e.g., yylloc -> loc.
13927 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13928 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13929 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13930 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13931
13932 * src/parse-gram.y (gram_error): loc is now const *.
13933 * src/reader.h (gram_error): Likewise.
13934
3af4feb2
PE
139352002-11-24 Paul Eggert <eggert@twinsun.com>
13936
13937 Version 1.75c.
13938
13939 * tests/actions.at (Actions after errors): Use an output format
13940 more similar to that of the Printers and Destructors test.
13941 Test the position of the ';' token too.
13942 (Printers and Destructors): Likewise.
13943 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13944 unnecessarily alarming people when the test fails.
13945
13946 * data/yacc.c (yyerrlab1): Move this label down, so that the
13947 parser does not discard the lookahead token if the user code
13948 invokes YYERROR. This change is required for POSIX conformance.
13949
13950 * lib/error.c: Sync with gnulib.
13951
139522002-11-22 Paul Eggert <eggert@twinsun.com>
13953
13954 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13955 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13956 * lib/xmalloc.c: Likewise.
26b4a969 13957
58004308
PE
139582002-11-20 Paul Eggert <eggert@twinsun.com>
13959
13960 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13961
139622002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 13963
58004308
PE
13964 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13965 should use `if (! x) abort ();' rather than `assert (x);', and
13966 anyway it's one less thing to worry about configuring.
13967
13968 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13969 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13970 and replace all instances of assert with abort.
13971 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13972 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13973
13974 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13975 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13976 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13977 hash_find_entry, hash_rehash, hash_insert): Likewise.
13978 * src/conflicts.c (resolve_sr_conflict): Likewise.
13979 * src/lalr.c (set_goto_map, map_goto): Likewise.
13980 * src/nullable.c (nullable_compute): Likewise.
13981 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13982 * src/reader.c (packgram, reader): Likewise.
13983 * src/state.c (state_new, state_free, state_transitions_set,
13984 state_reduction_find): Likewise.
13985 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13986 symbol_pack): Likewise.
13987 * src/tables.c (conflict_row, pack_vector): Likewise.
13988 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13989 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13990 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13991 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13992
13993 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13994 (ARGMATCH_CONSTRAINT): New macro.
13995 (ARGMATCH_ASSERT): Use it.
13996
13997 * src/system.h (verify): New macro.
13998 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13999 rather than assert.
14000 * src/tables.c (tables_generate): Likewise.
14001
14002 * src/struniq.c (struniq_assert): Now returns void, and aborts
14003 if the assertion is false.
14004 (struniq_assert_p): Remove.
14005 * src/struniq.h: Likewise.
14006
76ae8198
PE
140072002-11-18 Paul Eggert <eggert@twinsun.com>
14008
14009 * data/glr.c (yygetLRActions): Replace `yyindex' with
14010 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14011 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 14012 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 14013
d3c4e709
AD
140142002-11-18 Akim Demaille <akim@epita.fr>
14015
14016 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14017 space.
14018 From Tim Van Holder.
14019
8d8a7238
PE
140202002-11-17 Paul Eggert <eggert@twinsun.com>
14021
14022 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14023 to "SyntaxError" for consistency with my 2002-11-15 change.
14024
14025 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14026 not define to {}, since this breaks the common use of `YYDPRINTF
14027 ((...));' if a single statement is desired (e.g. before `else').
14028 Work around GCC warnings by surrounding corresponding calls with
14029 {} if needed.
14030 (yyhasResolvedValue): Remove unused function.
14031 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14032 loop body.
14033 (yyreportSyntaxError): Renamed from yyreportParseError.
14034 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14035 All uses changed.
14036 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14037 extern when possible. Remove unused initializations.
14038
b0937b22
AD
140392002-11-16 Akim Demaille <akim@epita.fr>
14040
14041 Augment the similarity between GLR and LALR traces.
14042
14043 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14044 (YY_REDUCE_PRINT): New.
14045 (yyparse): Use them.
14046 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14047 YYDPRINT here.
14048 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14049 state reached after the reduction/recovery, since...
14050 (yyparse, yyprocessOneStack): Report the state we are entering in.
14051
c5e3e510
AD
140522002-11-16 Akim Demaille <akim@epita.fr>
14053
14054 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14055 Add support for --trace=skeleton.
14056 * src/scan-skel.l: %option debug.
14057 Scan strings of non-@ or \n instead of character by character.
14058 (scan_skel): Handle trace_skeleton.
14059 (QPUTS): New.
14060 (@output_parser_name@, @output_header_name@): ``Restore'' their
14061 support (used to be M4 macros).
14062 * data/yacc.c: Quote larger chunks, a la glr.c.
14063 * data/lalr1.cc: Likewise.
14064 The header guards are no longer available, so use some other
14065 string than `YYLSP_NEEDED'.
14066
4c6cc1db
AD
140672002-11-16 Akim Demaille <akim@epita.fr>
14068
14069 Make the ``Printers and Destructors'' test more verbose, taking
14070 `yacc.c''s behavior as (possibly wrong) reference.
14071
14072 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14073 instead of fprint on stdout.
14074 Set and report the last_line of the symbols.
14075 Consistently display values and locations.
14076
6d9e8019
PE
140772002-11-16 Paul Eggert <eggert@twinsun.com>
14078
14079 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14080
6e649e65
PE
140812002-11-15 Paul Eggert <eggert@twinsun.com>
14082
b25d88f6
PE
14083 * tests/actions.at (Actions after errors): New test case.
14084
6e649e65
PE
14085 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14086 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14087 tests/action.at, tests/calc.at, tests/conflicts.at,
14088 tests/cxx-type.at, tests/regression.at:
14089 "parse error" -> "syntax error" for POSIX compatibility.
14090 "parsing stack overflow..." -> "parser stack overflow" so
14091 that code matches Bison documentation.
14092
0f39aab9
AD
140932002-11-15 Akim Demaille <akim@epita.fr>
14094
14095 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14096 take two BRACED_CODE, not two string_content.
14097 Free the scanner's obstack when we are done.
14098 (code_content): New.
14099 * tests/calc.at: Adjust.
14100 * doc/bison.texinfo: Adjust.
14101 Also, make sure to include the `,' for these declarations.
14102
761c1926
AD
141032002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14104
14105 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14106 definition; avoids potential autoreconf problems.
14107
b0f98b10
AD
141082002-11-15 Akim Demaille <akim@epita.fr>
14109
14110 Always check the value returned by yyparse.
14111
14112 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14113 returned by yyparse.
14114 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14115 Adjust calls.
14116 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14117 returned by yyparse.
14118
970785f1
PH
141192002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14120
14121 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14122 on input.at test.
14123
8fcc7db1
PE
141242002-11-14 Paul Eggert <eggert@twinsun.com>
14125
7ec1b48e
PE
14126 * src/output.c (output_skeleton): Call xfopen instead of
14127 duplicating xfopen's body.
14128
cfff7583 14129 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 14130 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 14131
8fcc7db1
PE
14132 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14133 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14134 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14135 file twice in the grammar, as an extra check.
14136
14137 * tests/input.at (Torturing the Scanner): Surround the
14138 backslash-newline tests with "#if 0", to make it less likely that
14139 we'll run into compiler bugs. Bring back solitary \ inside
14140 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 14141 test backslash-newline in C character constant.
8fcc7db1 14142
4e8d992c
AD
141432002-11-14 Akim Demaille <akim@epita.fr>
14144
14145 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14146 status of the compiler.
f32b346d 14147 Calling `exit 1' is no longer needed.
4e8d992c
AD
14148 Reported by Nelson H. F. Beebe.
14149
9501dc6e
AD
141502002-11-14 Akim Demaille <akim@epita.fr>
14151
14152 * tests/atlocal.in (CPPFLAGS): We have config.h.
14153 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14154 New.
14155 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14156 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14157 * tests/regression.at, tests/torture.at: Use them for all the
14158 grammars that are to be compiled.
14159 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14160 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14161 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14162
18b519c0
AD
141632002-11-14 Akim Demaille <akim@epita.fr>
14164
14165 * doc/bison.texinfo: Various formatting changes (alignments in
14166 samples, additional @group/@end group, GCS in samples.
14167 Use @deffn instead of simple @table to define the directives,
14168 macros, variables etc.
14169
9a86cdb9
PE
141702002-11-13 Paul Eggert <eggert@twinsun.com>
14171
daa33def 14172 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14173 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14174
daa33def 14175 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14176 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14177 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14178 * tests/headers.at (export YYLTYPE): Likewise.
14179
14180 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14181 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14182
9a86cdb9
PE
14183 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14184 comments, since they're not portable. Use GNU coding style.
14185
9c1e26bd
AD
141862002-11-13 Akim Demaille <akim@epita.fr>
14187
14188 * data/yacc.c: Leave bigger chunks of quoted text.
14189 (YYDSYMPRINTF): New.
14190 Use it to report symbol activities.
14191 * data/glr.c (YYDSYMPRINTF): New.
14192 Use it.
14193
87f721cc
PE
141942002-11-12 Paul Eggert <eggert@twinsun.com>
14195
14196 Version 1.75b.
14197
14198 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14199 (yyglrReduce): Return yyok, not 0.
14200 This should avoid the enumerated-type warnings reported
464c6927 14201 by Nelson H. F. Beebe in
161a71f3 14202 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14203
14204 * lib/bbitset.h (BITSET_INLINE): Remove.
14205 * lib/bitset.h [! BITSET_INLINE]: Remove.
14206 (bitset_set, bitset_reset, bitset_test): Rename local vars
14207 to avoid shadowing warnings by GCC.
14208
14209 * data/glr.c (inline): Remove #define. It's the user's
14210 responsibility to #define it away, just like 'const'.
464c6927 14211 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14212 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14213
87f721cc
PE
14214 * Makefile.maint (po-check): Scan .l and .y files instead of the
14215 .c and the .h files that they generate. This fixes the bug
14216 reported by Tim Van Holder in:
161a71f3 14217 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14218 Look for N_ as well as for _. Try to avoid matching #define for
14219 N_ and _.
14220 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14221 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14222 * src/scan-gram.l: Revamp regular expressions so that " and '
14223 do not confuse xgettext.
14224
14225 * src/struniq.h (struniq_new): Do not declare the return type
14226 to be 'const'; this violates the C standard.
14227 * src/struniq.c (struniq_new): Likewise.
14228
be14ade5
AD
142292002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14230
14231 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14232 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14233 linker.
14234
05291fbc
AD
142352002-11-12 Akim Demaille <akim@epita.fr>
14236
14237 * Makefile.maint: Sync with Autoconf:
14238 (local_updates): New.
14239
1f5fd52e
AD
142402002-11-12 Akim Demaille <akim@epita.fr>
14241
14242 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14243
283f1e64
AD
142442002-11-12 Akim Demaille <akim@epita.fr>
14245
14246 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14247 locations.
14248
886b69d1
AD
142492002-11-12 Akim Demaille <akim@epita.fr>
14250
14251 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14252 not yyvalue.
14253
3df37415
AD
142542002-11-12 Akim Demaille <akim@epita.fr>
14255
14256 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14257 Use it to test the GLR parser.
14258
7bd6c77e
AD
142592002-11-12 Akim Demaille <akim@epita.fr>
14260
14261 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14262 defines it.
14263 * data/glr.c (yystos): New.
14264 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14265 (YYDSYMPRINT): New.
14266 (yyval): Don't define it, it is handled via M4.
14267 (yyrecoverParseError): Free verbosely the discarded symbols.
14268 * data/yacc.c (yysymprint): Remove, rather...
14269 (b4_yysymprint_generate): invoke.
14270 * data/c.m4 (b4_yysymprint_generate): New.
14271 Accept pointers as arguments, as opposed to the version from
14272 yacc.c.
14273 (b4_yydestruct_generate): Likewise.
14274 * tests/cations.at (Printers and Destructors): Use Bison directives
14275 instead of CPP macros.
14276 Don't rely on internal details.
14277
b0400cc6
AD
142782002-11-12 Akim Demaille <akim@epita.fr>
14279
14280 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14281 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14282 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14283 it against YYEMPTY and so forth), work on yytoken (i.e., set
14284 it to YYEMPTY etc.).
14285 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14286 (b4_symbol_actions): Remove.
14287 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14288 for 0, end-of-input.
14289
72f889cc
AD
142902002-11-12 Akim Demaille <akim@epita.fr>
14291
14292 * doc/bison.texinfo (Destructor Decl): New.
14293
b1ae9233
AD
142942002-11-12 Akim Demaille <akim@epita.fr>
14295
14296 * src/tables.c (tables_generate): Use free for pointers that
14297 cannot be NULL, not XFREE.
14298 (pack_vector): Use assert, not fatal, for bound violations.
14299 * src/state.c (state_new): Likewise.
14300 * src/reader.c (reader): Likewise.
14301 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14302 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14303 the file name.
14304
7ec2d4cd
AD
143052002-11-12 Akim Demaille <akim@epita.fr>
14306
14307 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14308 Restore.
14309 * src/scan-gram.l (last_string): Is global to the file, not to
14310 yylex.
14311 * src/parse-gram.y (input): Don't append the epilogue here,
14312 (epilogue.opt): do it here, and free the scanner's obstack.
14313 * src/reader.c (epilogue_set): Rename as...
14314 (epilogue_augment): this.
14315 * data/c.m4 (b4_epilogue): Defaults to empty.
14316
573a6cd3
AD
143172002-11-12 Akim Demaille <akim@epita.fr>
14318
14319 * src/getargs.c (long_options): Remove duplicates.
14320 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14321 Remove.
14322 * doc/bison.rnh: Remove.
14323 * doc/bison.texinfo (VMS Invocation): Remove.
14324
95612cfa
AD
143252002-11-12 Akim Demaille <akim@epita.fr>
14326
14327 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14328 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14329
14330 Use struniq for symbols.
14331
14332 * src/symtab.h (symbol_t): The tag member is a struniq.
14333 (symbol_type_set): Adjust.
14334 * src/symtab.c (symbol_new): Takes a struniq.
14335 (symbol_free): Don't free the tag member.
14336 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14337 (hash_compare_symbol, hash_symbol): these.
14338 Use the fact that tags as struniqs.
14339 (symbol_get): Use struniq_new.
14340 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14341 Returns a strniq.
14342 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14343 and type members are struniqs.
14344 * src/reader.c (get_merge_function)
14345 (grammar_current_rule_merge_set): Adjust.
14346 (TYPE, current_type): Are struniq.
14347
14348 Use struniq for file names.
14349
14350 * src/files.h, src/files.c (infile): Split into...
14351 (grammar_file, current_file): these.
14352 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14353 * src/reduce.c (reduce_print): Likewise.
14354 * src/getargs.c (getargs): Likewise.
14355 * src/complain.h, src/complain.c: Likewise.
14356 * src/main.c (main): Call struniqs_new early enough to use it for
14357 file names.
14358 Don't free the input file name.
14359
3e6656f9
AD
143602002-11-12 Akim Demaille <akim@epita.fr>
14361
14362 * src/symtab.c (symbol_free): Remove dead deactivated code:
14363 type_name are properly removed.
14364 Don't use XFREE to free items that cannot be NULL.
14365 * src/struniq.h, src/struniq.c: New.
14366 * src/main.c (main): Initialize/free struniqs.
14367 * src/parse-gram.y (%union): Add astruniq member.
14368 (yyprint): Adjust.
14369 * src/scan-gram.l (<{tag}>): Return a struniq.
14370 Free the obstack bit that used to store it.
14371 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14372
7672019c
PE
143732002-11-11 Paul Eggert <eggert@twinsun.com>
14374
14375 Revamp to fix many (but not all) of the C- and M4-related quoting
14376 problems. Among other things, this fixes the Bison bug reported
14377 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 14378 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
14379
14380 Use new @ escapes consistently. Represent brackets with @{ and @}
14381 rather than @<:@ and @:>@, since this works a bit better with dumb
14382 editors like vi. Represent @ with @@, since @ is now consistently
14383 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14384 __ofile__, to avoid unexpected expansions. Similarly, use @output
14385 rather than #output.
14386
14387 * data/c.m4 (b4_copyright): Omit file name from comment, since
14388 the file name could contain "*/".
14389 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14390 be quoted. All uses changed.
14391
14392 * data/glr.c: Use new @ escapes consistently.
14393 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14394 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14395 Remove, since they couldn't handle arbitrary characters in file
14396 names.
14397 * data/lalr1.cc: Likewise.
14398 * data/yacc.c: Likewise.
14399
14400 * src/files.c (output_infix): Remove; all uses removed.
14401 * src/files.h: Likewise.
14402
14403 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14404 mishandled funny characters in file names, and anyway it isn't
14405 needed any more.
14406 * data/yacc.c: Likewise.
14407 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14408
14409 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14410 * data/yacc.c: Likewise.
14411
14412 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14413 strings now.
14414 (muscle_init): Quote filename as a C string.
14415 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14416 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14417 * src/output.c (escaped_file_name_output): New function.
14418 (prepare_symbols): Quote tokens for M4.
14419 (prepare): Don't insert output_infix, output_prefix,
14420 output_parser_name, output_header_name; this is now down by scan-skel.
14421 Insert skeleton as a C string.
14422
14423 * src/output.c (user_actions_output, symbol_destructors_output,
14424 symbol_printers_output): Quote filenames for C and M4.
14425 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14426
14427 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14428 escapes other than \\ and \'; this simplifies the code.
14429 (<SC_STRING>): Likewise, for \\ and \".
14430 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14431 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14432 Use new escapes @{ and @} for [ and ].
14433
14434 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14435 them with auto vars.
14436 Switch to new escape scheme, where @ is the escape character uniformly.
14437 Abort if a stray escape character is found. Avoid unbounded input
14438 buffer when parsing non-escaped text.
14439
14440 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14441 __oline__, #output, $@, and @{ do not have unintended meanings.
14442
acea4f3b
PE
144432002-11-09 Paul Eggert <eggert@twinsun.com>
14444
14445 Fix the test failure due to GCC warnings described in
161a71f3 14446 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14447 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14448 evaluate to 0 if it's impossible for NINF to be in the respective
14449 table.
14450 (yygetLRActions, yyrecoverParseError): Use them.
14451
14452 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14453 counted in the token inserted at end of file. Now takes
14454 location_t *, not location_t, so that the location can be
14455 adjusted. All uses changed.
14456
14457 * tests/regression.at (Invalid inputs): Adjust wording in
14458 diagnostic to match the new behavior.
14459
14460 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14461 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14462 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14463 abort ();'. This reduces the runtime of the "Many lookaheads"
14464 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14465 GCC 3.2.
14466
20ef1ad5
PE
144672002-11-07 Paul Eggert <eggert@twinsun.com>
14468
14469 * src/parse-gram.y (CHARACTER): Remove unused token.
14470 All uses removed.
14471
14472 * src/scan-gram.l: Remove stack option. We no longer use the
14473 stack, since the stack was never deeper than 1; instead, use the
14474 new auto var c_context to record the stacked value.
14475
14476 Remove nounput option. At an unexpected end of file, we now unput
14477 the minimal input necessary to end cleanly; this simplifies the
14478 code.
14479
14480 Avoid unbounded token sizes where this is easy.
14481
14482 (unexpected_end_of_file): New function.
14483 Use it to systematize the error message on unexpected EOF.
14484 (last-string): Now auto, not static.
14485 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14486 (scanner_last_string_free): Remove; not used.
14487 (percent_percent_count): Move decl to just before use.
14488 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14489 not the (never otherwised-used) CHARACTER.
14490
93724f13
AD
144912002-11-07 Akim Demaille <akim@epita.fr>
14492
14493 Let yyerror always receive the msg as last argument, so that
14494 yyerror can be variadic.
14495
14496 * data/yacc.c (b4_yyerror_args): New.
14497 Use it when calling yyerror.
14498 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14499 Use it when calling yyerror.
14500 * doc/bison.texinfo (Error Reporting): Adjust.
14501 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14502 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14503
6e40b4eb
AD
145042002-11-06 Akim Demaille <akim@epita.fr>
14505
14506 #line should have quoted strings.
14507 Ideally, this should be done by m4_quotearg.
14508
14509 * src/scan-skel.l: Include quotearg.h.
14510 Quote __ofile__.
14511 * src/output.c (symbol_printers_output)
14512 (symbol_destructors_output): Quote the file name.
14513
2dfbfc12
AD
145142002-11-06 Akim Demaille <akim@epita.fr>
14515
14516 * tests/regression.at (Invalid inputs): Adjust to the recent
14517 messages.
14518
437c2d80
AD
145192002-11-06 Akim Demaille <akim@epita.fr>
14520
14521 Restore --no-lines.
14522 Reported by Jim Kent.
14523
14524 * data/c.m4 (b4_syncline): New.
14525 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14526 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14527 * src/output.c (user_actions_output): Likewise.
14528 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 14529 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 14530
900c5db5
AD
145312002-11-06 Akim Demaille <akim@epita.fr>
14532
14533 * src/main.c (main): Free `infile'.
14534 * src/scan-gram.l (handle_syncline): New.
14535 Recognize `#line'.
14536 * src/output.c (user_actions_output, symbol_destructors_output)
14537 (symbol_printers_output): Use the location's file name, not
14538 infile.
14539 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14540
e183b123 145412002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 14542
e183b123 14543 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 14544 either has GLR conflict entries.
e183b123 14545
193eb6b7
PE
145462002-11-05 Paul Eggert <eggert@twinsun.com>
14547
e183b123
PE
14548 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14549 "integer out of range" rather than "invalid value".
14550 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14551 accordingly.
14552
193eb6b7
PE
14553 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14554 Also, remove one static variable in the scanner.
14555
14556 * src/scan-gram.l (braces_level): Now auto, not static.
14557 Initialize to zero if the compiler is being picky.
14558 (INITIAL): Clear braces_level instead of incrementing it.
14559 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14560 as POSIX 1003.1-2001 requires.
14561 * src/system.h (IF_LINT): New macro, taken from coreutils.
14562 * configure.ac: Define "lint" if --enable-gcc-warnings.
14563
29c01725
AD
145642002-11-05 Akim Demaille <akim@epita.fr>
14565
14566 * src/scan-gram.l: When it starts with `%', complain about the
14567 whole directive, not just that `invalid character: %'.
14568
8aeac3ca
AD
145692002-11-04 Akim Demaille <akim@epita.fr>
14570
14571 * Makefile.maint: Update from Autoconf.
14572 (update, cvs-update, po-update, do-po-update): New.
14573
793a58bb
AD
145742002-11-04 Akim Demaille <akim@epita.fr>
14575
14576 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14577 and yyerror.
14578 Have yyerror `use' its arguments.
14579 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14580 returns true when location & yacc & pure & parse-param.
14581 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14582
c4d720cd
AD
145832002-11-04 Akim Demaille <akim@epita.fr>
14584
14585 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14586 clashes.
14587 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14588 font-lock-mode.
14589 Use complain_at.
14590 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14591 slot 0.
14592
613a0dc5
PE
145932002-11-03 Paul Eggert <eggert@twinsun.com>
14594
14595 * src/reader.c (get_merge_function, grammar_current_rule_check):
14596 Use consistent diagnostics for reporting type name clashes.
14597 Quote the types with <>, for consistency with Yacc.
14598 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14599
2a8d363a
AD
146002002-11-03 Akim Demaille <akim@epita.fr>
14601
14602 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14603 New.
14604 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14605 (b4_parse_param): Remove.
14606 Use b4_identification.
14607 Propagate b4_pure_args where needed to pass them to yyerror.
14608 * data/glr.m4 (b4_parse_param): Remove.
14609 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14610 (b4_lpure_formals): New.
14611 Use b4_identification.
14612 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14613 b4_user_formals and b4_user_args.
14614 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14615 (yyreportAmbiguity): When using a pure parser, also need
14616 the location, and the parse-params.
14617 Adjust callers.
14618 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14619 When using a pure parser, also need the parse-params.
14620 Adjust callers.
14621 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14622 (%pure-parser + %parse-param) LALR and GLR parsers.
14623 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14624 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14625 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14626 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14627 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14628 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14629 * doc/bison.texinfo: Untabify the whole file.
14630 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14631 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14632 (Error Reporting): Adjust to these new directives.
14633 Document %error-verbose, deprecate YYERROR_VERBOSE.
14634
9e32add8
AD
146352002-11-03 Akim Demaille <akim@epita.fr>
14636
14637 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14638 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14639 command line options.
14640 * tests/cxx-type.at: Formatting changes.
14641
b02d90a5
PE
146422002-11-03 Paul Eggert <eggert@twinsun.com>
14643
14644 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14645 to count columns correctly, and to check for invalid inputs.
9e32add8 14646
b02d90a5
PE
14647 Use mbsnwidth to count columns correctly. Account for tabs, too.
14648 Include mbswidth.h.
14649 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14650 (extend_location): New function.
14651 (YY_LINES): Remove.
14652
14653 Handle CRLF in C code rather than in Lex code.
14654 (YY_INPUT): New macro.
14655 (no_cr_read): New function.
14656
14657 Scan UCNs, even though we don't fully handle them yet.
14658 (convert_ucn_to_byte): New function.
14659
14660 Handle backslash-newline correctly in C code.
14661 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14662 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14663 all uses changed.
14664 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14665 Use {splice} wherever C allows backslash-newline.
14666 YY_STEP after space, newline, vertical-tab.
14667 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 14668
b02d90a5
PE
14669 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14670
14671 ({int}, handle_action_dollar, handle_action_at): Check for integer
14672 overflow.
9e32add8 14673
b02d90a5
PE
14674 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14675
14676 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14677 as well as \000. Check for UCHAR_MAX, not 255.
14678 Allow \x with an arbitrary positive number of digits, as in C.
14679 Check for overflow here.
14680 Allow \? and UCNs, for compatibility with C.
14681
14682 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14683 with quote slot used by complain_at.
14684
14685 * tests/input.at: Add tests for backslash-newline, m4 quotes
14686 in symbols, long literals, and funny escapes in strings.
14687
14688 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14689 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14690 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14691 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14692 * m4/mbswidth.m4: New file, from GNU coreutils.
14693
14694 * doc/bison.texinfo (Grammar Outline): Document // comments.
14695 (Symbols): Document that trigraphs have no special meaning in Bison,
14696 nor is backslash-newline allowed.
14697 (Actions): Document that trigraphs have no special meaning.
14698
14699 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14700 no longer used.
14701
147022002-11-02 Paul Eggert <eggert@twinsun.com>
14703
14704 * src/reader.c: Don't include quote.h; not needed.
14705 (get_merge_function): Reword warning to be consistent with
14706 type clash diagnostic in grammar_current_rule_check.
14707
14708 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14709 bug in trigraph handling.
14710
14711 * src/output.c (prepare_symbols): When printing token names,
14712 escape "[" as "@<:@" and likewise for "]".
14713
14714 * src/system.h (errno): Remove declaration, as we are now
14715 assuming C89 or better, and C89 guarantees errno.
14716
762b212b
PE
147172002-10-30 Paul Eggert <eggert@twinsun.com>
14718
14719 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14720 Check for close failures.
14721 * src/files.h (xfclose): Return void, not int, since it always
14722 returned zero.
14723 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14724 indicates one.
14725 * src/output.c (output_skeleton): Use xfclose rather than fclose
14726 and ferror. xfclose now checks ferror.
14727
14728 * data/glr.c (YYLEFTMOST_STATE): Remove.
14729 (yyreportTree): Use a stack-based leftmost state. This avoids
14730 our continuing battles with bogus warnings about initializers.
14731
56100c60
AD
147322002-10-30 Akim Demaille <akim@epita.fr>
14733
14734 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14735 #if.
14736
51b4a04c
PH
147372002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14738
14739 * tests/glr-regr1.at: New test for reported regressions.
14740 * tests/testsuite.at: Add glr-regr1.at test.
14741 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 14742
bf1ebda2
PE
147432002-10-24 Paul Eggert <eggert@twinsun.com>
14744
5c16c6b1
PE
14745 Version 1.75a.
14746
bf1ebda2
PE
14747 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14748 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14749 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14750 Don't assume strdup exists; POSIX says its an XSI extension.
14751 Check for buffer overflow on input.
14752
b526ee61
AD
147532002-10-24 Akim Demaille <akim@epita.fr>
14754
14755 * src/output.c (output_skeleton): Don't disable M4sugar comments
14756 too soon: it results in comments being expanded.
14757 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14758 first output.
14759
f1886bb2
AD
147602002-10-24 Akim Demaille <akim@epita.fr>
14761
14762 * data/yacc.c (m4_int_type): New.
14763 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14764 char' as only yacc.c wants K&R portability.
14765 * data/glr.c (yysigned_char): Remove.
14766 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14767 Reported by Quoc Peyrot.
14768
c5576256
PE
147692002-10-23 Paul Eggert <eggert@twinsun.com>
14770
14771 * src/main.c (main): With --trace=time, report times even if a
14772 non-fatal error occurs. Formerly, the times were reported in some
14773 such cases but not in others.
14774 * src/reader.c (reader): Just return if a complaint has been issued,
14775 instead of exiting, so that 'main' can report times.
14776
27b0ffea
AD
147772002-10-22 Akim Demaille <akim@epita.fr>
14778
14779 * src/system.h: Include sys/types.
14780 Reported by Bert Deknuydt.
14781
223a7883
PE
147822002-10-23 Paul Eggert <eggert@twinsun.com>
14783
14784 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14785 Suggested by Art Haas.
14786
147872002-10-22 Paul Eggert <eggert@twinsun.com>
14788
14789 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14790 decl; not needed any more.
14791 * src/main.c (main): Use return to exit, undoing yesterday's change.
14792 The last OS that we could find where this wouldn't work is
14793 SunOS 3.5, and that's too old to worry about now.
14794
14795 * data/glr.c (struct yyltype): Define members even when not
14796 doing locations. This is more consistent with yacc.c, and it
14797 works around the following bug reports:
161a71f3
PE
14798 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14799 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 14800
223a7883
PE
14801 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14802 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14803 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14804
8b76775a
AD
148052002-10-22 Akim Demaille <akim@epita.fr>
14806
14807 * data/README: New.
14808
6db10d14
PE
148092002-10-21 Paul Eggert <eggert@twinsun.com>
14810
14811 Be consistent about 'bool'; the old code used an enum in one
14812 module and an int in another, and this violates the C standard.
14813 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14814 * configure.ac (AC_HEADER_STDBOOL): Add.
14815 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14816 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14817 * src/symtab.c (hash_compare_symbol_t): Likewise.
14818 * src/system.h (bool, false, true): Use a definition consistent
14819 with ../lib/hash.c. All uses changed.
14820
14821 * src/complain.c (warning_issued): Renamed from warn_message_count,
14822 so that we needn't worry about integer overflow (!).
14823 Now of type bool. All uses changed.
14824 (complaint_issued): Renamed from complain_message_count; likewise.
14825
14826 * src/main.c (main): Use exit to exit with failure.
27b0ffea 14827
6db10d14
PE
14828 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14829 rather than 1 and 0.
14830 * src/main.c (main): Likewise.
14831 * src/getargs.c (getargs): Likewise.
14832 * src/reader.c (reader): Likewise.
14833
14834 * src/getarg.c (getargs): Remove duplicate code for
14835 "Try `bison --help'".
14836
14837 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14838 What was that "2" for?
14839
14840 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14841 * src/getargs.c (usage): Likewise.
14842
14843 * src/getargs.c (getargs): When there are too few operands, report
14844 the last one. When there are too many, report the first extra
14845 one. This is how diffutils does it.
14846
92a060fd
PE
148472002-10-20 Paul Eggert <eggert@twinsun.com>
14848
14849 Remove K&R vestiges.
14850 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14851 * src/complain.c (VA_START): Remove. Assume prototypes.
14852 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14853 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14854 fatal): Assume prototypes.
14855 * src/complain.h: Assume prototypes.
14856 * src/system.h (PARAMS): Remove.
14857 Include <limits.h> unconditionally, since it's guaranteeed even
14858 for a freestanding C89 compiler.
14859 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14860 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 14861
e7cb57c0
AD
148622002-10-20 Akim Demaille <akim@epita.fr>
14863
14864 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14865 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14866 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14867 (yyresolveStates, yyresolveAction, yyresolveStack)
14868 (yyprocessOneStack): Use them.
14869 (yy_reduce_print): New.
14870 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14871
0245f82d
AD
148722002-10-20 Akim Demaille <akim@epita.fr>
14873
14874 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14875 arguments and output `void'.
14876 (b4_c_function): Rename as...
14877 (b4_c_function_def): this.
14878 (b4_c_function_decl, b4_c_ansi_function_def)
14879 (b4_c_ansi_function_decl): New.
14880 Change the interpretation of the arguments: before `int, foo', now
14881 `int foo, foo'.
14882 * data/yacc.c (yyparse): Prototype and define thanks to these.
14883 Adjust b4_c_function_def uses.
14884 * data/glr.c (yyparse): Likewise, but ANSI only.
14885
39912f52
AD
148862002-10-20 Akim Demaille <akim@epita.fr>
14887
14888 * src/output.c (prepare): Move the definition of `tokens_number',
14889 `nterms_number', `undef_token_number', `user_token_number_max'
14890 to...
14891 (prepare_tokens): Here.
14892 (prepare_tokens): Rename as...
14893 (prepare_symbols): this.
14894 (prepare): Move the definition of `rules_number' to...
14895 (prepare_rules): here.
14896 (prepare): Move the definition of `last', `final_state_number',
14897 `states_number' to...
14898 (prepare_states): here.
14899 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14900
20c1e2ad
AD
149012002-10-20 Akim Demaille <akim@epita.fr>
14902
14903 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14904
21964f43
AD
149052002-10-20 Akim Demaille <akim@epita.fr>
14906
14907 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14908 * data/c.m4: here.
14909
66d30cd4
AD
149102002-10-20 Akim Demaille <akim@epita.fr>
14911
14912 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14913 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14914 `pair'.
14915 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14916 `name' to...
14917 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14918 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14919 These.
14920
95f2c9fe
PE
149212002-10-19 Paul Eggert <eggert@twinsun.com>
14922
14923 Do not create a temporary file, as that involves security and
14924 cleanup headaches. Instead, use a pair of pipes.
14925 Derived from a suggestion by Florian Krohm.
14926 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14927 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14928 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14929 (BISON_PREREQ_SUBPIPE): Add.
14930 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14931 Add subpipe.h, subpipe.c.
14932 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14933 * po/POTFILES.in: Add lib/subpipe.c.
14934 * src/output.c: Include "subpipe.h".
14935 (m4_invoke): Remove decl.
14936 (scan_skel): New decl.
14937 (output_skeleton): Use pipe rather than temporary file for m4 input.
14938 Check that m4sugar.m4 is readable, to avoid deadlock.
14939 Check for pipe I/O error.
14940 * src/scan-skel.l (readpipe): Remove decl.
14941 (scan_skel): New function, to be used in place of m4_invoke.
14942 Read from stream rather than file.
66d30cd4 14943
95f2c9fe
PE
14944 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14945 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14946 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14947 this generates a more-accurate value anyway.
14948
14949 * lib/timevar.c (timervar_accumulate): Rename locals to
14950 avoid confusion with similarly-named more-global.
14951 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14952
14953 * src/output.c (prepare): Use xstrdup to convert char const *
14954 to char *, to avoid GCC warning.
14955
c19988b7
AD
149562002-10-19 Akim Demaille <akim@epita.fr>
14957
14958 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14959 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14960 Use them to have `calc.y' ready for %pure-parser.
14961 * data/yacc.c (YYLEX): Pass a yylex return type to
14962 b4_c_function_call.
14963
ae7453f2
AD
149642002-10-19 Akim Demaille <akim@epita.fr>
14965
14966 Prototype support of %lex-param and %parse-param.
14967
14968 * src/parse-gram.y: Add the definition of the %lex-param and
14969 %parse-param tokens, plus their rules.
14970 Drop the `_' version of %glr-parser.
14971 Add the "," token.
14972 * src/scan-gram.l (INITIAL): Scan them.
14973 * src/muscle_tab.c: Comment changes.
14974 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14975 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14976 (muscle_entry_s): The `value' member is no longer const.
14977 Adjust all dependencies.
14978 * src/muscle_tab.c (muscle_init): Adjust: use
14979 MUSCLE_INSERT_STRING.
14980 Initialize the obstack earlier.
14981 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14982 (muscle_pair_list_grow): New.
14983 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14984 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14985 * tests/calc.at: Use %locations, not --locations.
14986 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14987
0e575721
AD
149882002-10-19 Akim Demaille <akim@epita.fr>
14989
14990 * src/getargs.c (usage): Take status as argument and exit
14991 accordingly.
14992 Report the traditional `Try ... --help' message when status != 0.
14993 (usage, version): Don't take a FILE * as arg, it is pointless.
14994 (getargs): When there is an incorrect number of arguments, make it
14995 an error, and report it GNUlically thanks to `usage ()'.
14996
724ce7f5
PE
149972002-10-18 Paul Eggert <eggert@twinsun.com>
14998
3a781eb2
PE
14999 * data/glr.c (yyreportParseError): Don't assume that sprintf
15000 yields the length of the printed string, as this is not true
15001 on SunOS 4.1.4. Reported by Peter Klein.
15002
724ce7f5
PE
15003 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15004 * tests/conflicts.at (%nonassoc and eof): Likewise.
15005 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15006
473d0a75
AD
150072002-10-17 Akim Demaille <akim@epita.fr>
15008
15009 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15010 * src/getargs.c (trace_types, trace_args): Adjust.
15011 * src/reader.c (grammar_current_rule_prec_set)
15012 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15013 Standardize error messages.
15014 And s/@prec/%prec/!
15015 (reader): Use trace_flag to enable scanner/parser debugging,
15016 instead of an adhoc scheme.
15017 * src/scan-gram.l: Remove trailing debugging code.
15018
e76d2469
PE
150192002-10-16 Paul Eggert <eggert@twinsun.com>
15020
93e2236a
PE
15021 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15022 MUSCLE_TAB_H.
15023
e76d2469
PE
15024 * NEWS: Officially drop support for building Bison with K&R C,
15025 since it didn't work anyway and it's not worth worrying about.
15026 * Makefile.maint (wget_files): Remove ansi2knr.c.
15027 (ansi2knr.c-url_prefix): Remove.
15028 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15029 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15030 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15031
5bd1c419
PE
150322002-10-15 Paul Eggert <eggert@twinsun.com>
15033
15034 Stop using the "enum_" trick for K&R-style function definitions;
15035 it confused me, and I was the author! Instead, assume that people
15036 who want to use K&R C compilers (when using these modules in GCC,
15037 perhaps?) will run ansi2knr.
15038
15039 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15040 All uses of "enum_" changed to "enum ".
15041 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15042 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 15043
5bd1c419
PE
15044 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15045 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15046 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15047 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15048 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15049 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15050 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15051 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15052 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15053 Use function prototypes; this removes the need for declaring
15054 static functions simply to provide their prototypes.
15055 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15056 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15057 bitset_count_, bitset_create, bitset_dump, bitset_first,
15058 bitset_free, bitset_init, bitset_last, bitset_next,
15059 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15060 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15061 bitset_print, bitset_release_memory, bitset_toggle_,
15062 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15063 debug_bitset): Likewise.
15064 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15065 * lib/bitset_stats.c (bitset_log_histogram_print,
15066 bitset_percent_histogram_print, bitset_stats_and,
15067 bitset_stats_and_cmp, bitset_stats_and_or,
15068 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15069 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15070 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15071 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15072 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15073 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15074 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15075 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15076 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15077 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15078 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15079 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15080 bitset_stats_zero): Likewise.
15081 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15082 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15083 bitsetv_dump, debug_bitsetv): Likewise.
15084 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15085 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15086 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15087 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15088 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15089 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15090 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15091 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15092 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15093 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15094 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15095 Likewise.
15096 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15097 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15098 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15099 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15100 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15101 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15102 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15103 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15104 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15105 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15106 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 15107
ae26e1f0
AD
151082002-10-14 Akim Demaille <akim@epita.fr>
15109
15110 Version 1.75.
15111
d43baf71
AD
151122002-10-14 Akim Demaille <akim@epita.fr>
15113
15114 * tests/Makefile.am (maintainer-check-posix): New.
15115
7ebc83e3
AD
151162002-10-14 Akim Demaille <akim@epita.fr>
15117
15118 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15119 member.
15120
05846dae
AD
151212002-10-14 Akim Demaille <akim@epita.fr>
15122
15123 * src/tables.c (table_ninf_remap): base -> tab.
15124 Reported by Matt Rosing.
15125
1318e37d
PE
151262002-10-14 Paul Eggert <eggert@twinsun.com>
15127
447fbb17
PE
15128 * tests/action.at, tests/calc.at, tests/conflicts.at,
15129 tests/cxx-type.at, tests/headers.at, tests/input.at,
15130 tests/regression.at, tests/synclines.at, tests/torture.at:
15131 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15132 so that the tests still work even if POSIXLY_CORRECT is set.
15133 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 15134
1318e37d
PE
15135 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15136 for portability to K&R hosts. Fix typo: signed char is guaranteed
15137 only to 127, not to 128.
15138 * data/glr.c (yysigned_char): New type.
15139 * data/yacc.c (yysigned_char): Likewise.
15140 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15141
cc0f0794
PE
151422002-10-13 Paul Eggert <eggert@twinsun.com>
15143
5038f418
PE
15144 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15145 true due to limited range of data type" warning from GCC.
15146
cc0f0794
PE
15147 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15148 by wrapping enum yytokentype's definition inside #ifndef
15149 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15150
6fed0802
AD
151512002-10-13 Akim Demaille <akim@epita.fr>
15152
15153 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15154 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15155
32f0598d
AD
151562002-10-13 Akim Demaille <akim@epita.fr>
15157
15158 * Makefile.maint: Update from Autoconf 2.54.
15159 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15160
7ea9a33f
AD
151612002-10-13 Akim Demaille <akim@epita.fr>
15162
15163 * src/print.c (print_state): Separate the list of solved conflicts
15164 from the other items.
15165 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15166
ea99527d
AD
151672002-10-13 Akim Demaille <akim@epita.fr>
15168
15169 Let nondeterministic skeletons be usable with deterministic
15170 tables.
15171
15172 With the patch, GAWK compiled by GCC without -O2 passes its test
15173 suite using a GLR parser driven by LALR tables. It fails with -O2
15174 because `struct stat' gives two different answers on my machine:
15175 88 (definition of an auto var) and later 96 (memset on this var).
15176 Hence the stack is badly corrumpted. The headers inclusion is to
15177 blame: if I move the awk.h inclusion before GLR's system header
15178 inclusion, the two struct stat have the same size.
15179
15180 * src/tables.c (pack_table): Always create conflict_table.
15181 (token_actions): Always create conflict_list.
15182 * data/glr.c (YYFLAG): Remove, unused.
15183
f377f69f
AD
151842002-10-13 Akim Demaille <akim@epita.fr>
15185
15186 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15187 (O0FLAGS): New.
15188 (VALGRIND, GXX): New.
15189 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15190 * tests/bison.in: Run $PREBISON a pre-command.
15191 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15192 (maintainer-check-g++): New.
15193 * Makefile.am (maintainer-check): New.
15194
2a1fe6ed
AD
151952002-10-13 Akim Demaille <akim@epita.fr>
15196
15197 * data/glr.c: Formatting changes.
15198 Tweak some trace messages to match yacc.c's.
15199
f50adbbd
AD
152002002-10-13 Akim Demaille <akim@epita.fr>
15201
15202 GLR parsers sometimes raise parse errors instead of performing the
15203 default reduction.
15204 Reported by Charles-Henry de Boysson.
15205
15206 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15207 check the length of the traces when %glr.
f50adbbd
AD
15208 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15209 GLR's traces.
15210 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15211 Test GLR parsers.
15212 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15213 (yyltype): Remove the yy prefix from the member names.
15214 (yytable): Complete its comment.
15215 (yygetLRActions): Map error action number from YYTABLE from
15216 YYTABLE_NINF to 0.
15217 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15218 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15219 not satisfying as we could compare an YYACTION computed from
15220 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15221 only value for error actions.
15222 (yyreportParseError): In verbose parse error messages, don't issue
15223 `error' in the list of expected tokens.
15224 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15225 next action to perform to match glr.c's decoding.
15226 (yytable): Complete its comment.
15227
bcbad5b9
PE
152282002-10-13 Paul Eggert <eggert@twinsun.com>
15229
15230 Fix problem reported by Henrik Grubbstroem in
161a71f3 15231 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15232 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15233 because the Bison parser reads the second action before reducing
15234 the first one.
15235 * src/scan-gram.l (rule_length): New static var.
15236 Use it to keep track of the rule length in the scanner, since
15237 we can't expect the parser to be in lock-step sync with the scanner.
15238 (handle_action_dollar, handle_action_at): Use this var.
15239 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15240
14904b89
PE
152412002-10-12 Paul Eggert <eggert@twinsun.com>
15242
1fe611e5
PE
15243 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15244 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15245 Include <sys/time.h> when checking for clock_t and struct tms.
15246 Use same include order as source.
15247 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15248 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15249
1fe611e5
PE
15250 * lib/timevar.c: Update copyright date and clarify comments.
15251 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15252
1fe611e5
PE
15253 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15254 GCC version as of today, then merge Bison's changes.
15255 Change "GCC" to "Bison" in copyright notice. timevar.def's
15256 author is Akim, so change that too.
15257
98194095
PE
15258 * src/reader.c (grammar_current_rule_check):
15259 Don't worry about the default action if $$ is untyped.
15260 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15261 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15262
14904b89
PE
15263 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15264 * data/glr.c, data/lalr1.cc, data/yacc.c:
15265 Output token definitions before the first part of user declarations.
15266 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15267 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15268
ff6dca18
PE
152692002-10-11 Paul Eggert <eggert@twinsun.com>
15270
15271 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15272 (yyparse): here. This undoes some of the 2002-07-25 change.
15273 Compatibility problem reported by Ralf S. Engelschall with
15274 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15275
eb714592
AD
152762002-10-11 Akim Demaille <akim@epita.fr>
15277
15278 * tests/regression.at Characters Escapes): New.
15279 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15280 characters.
15281 Reported by Jan Nieuwenhuizen.
15282
b7195100
AD
152832002-10-11 Akim Demaille <akim@epita.fr>
15284
15285 * po/id.po: New.
15286
f28a0f2d
PE
152872002-10-10 Paul Eggert <eggert@twinsun.com>
15288
15289 Portability fixes for bitsets; this also avoids several GCC
15290 warnings.
15291
15292 * lib/abitset.c: Include <stddef.h>, for offsetof.
15293 * lib/lbitset.c: Likewise.
15294
15295 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15296 properly for vectors of objects. Do not assume that adding a
15297 header size to a multiple of a word size yields a value that is
15298 properly aligned for the whole union.
15299 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15300
15301 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15302 unique names for structures.
15303 * lib/ebitset.c (ebitset_bytes): Likewise.
15304 * lib/lbitset.c (lbitset_bytes): Likewise.
15305
15306 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15307 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15308 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15309 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15310 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15311 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15312 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15313 to improve the type-checking that GCC can do.
15314 * lib/bitset.c (bitset_op4_cmp): Likewise.
15315 * lib/bitset_stats.c (bitset_stats_count,
15316 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15317 bitset_stats_copy, bitset_stats_disjoint_p,
15318 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15319 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15320 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15321 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15322 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15323 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15324 bitset_stats_or_and_cmp): Likewise.
15325 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15326 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15327 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15328 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15329
15330 * lib/abitset.h: Include bitset.h, not bbitset.h.
15331 * lib/ebitset.h: Likewise.
15332 * lib/lbitset.h: Likewise.
15333
15334 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15335 All instances of parameters of type enum bitset_opts are now of
15336 type enum_bitset_opts, to conform to the C Standard, and similarly
15337 for enum_bitset_type.
15338 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15339 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15340
15341 Do not use "struct bitset_struct" to mean different things in
15342 different modules. Not only is this confusing, it violates
15343 the C Standard, which requires that structure types in different
15344 modules must be compatible if one is to be passed to the other.
15345 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15346 All instances of "struct bitset_struct *" replaced with "bitset".
15347 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15348 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15349 struct lbitset_struct, struct bitset_stats_struct): New types.
15350 All uses of struct bitset_struct changed to union bitset_union,
15351 etc.
ba0fe3c7 15352 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
15353 struct bitset_struct): Remove.
15354 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15355 struct bitset_struct): Remove.
15356 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15357 bitset_struct): Remove.
15358 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15359 Likewise.
15360
15361 Do not call a function of type T using a call that assumes the
15362 function is of a different type U. Standard C requires that a
15363 function must be called with a type that is compatible with its
15364 definition.
15365 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15366 New decls.
15367 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15368 New functions.
15369 * lib/ebitset.c (PFV): Remove.
15370 * lib/lbitset.c (PFV): Likewise.
15371 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15372 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15373 decls.
15374 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15375 (ebitset_vtable): Use them.
15376 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15377 lbitset_xor): New functions.
15378 (lbitset_vtable): Use them.
15379
15380 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15381 Declare.
15382
15383 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15384 GCC warning.
15385 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15386 Use offsetof, for simplicity.
15387
6fbe4984
PE
153882002-10-06 Paul Eggert <eggert@twinsun.com>
15389
15390 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15391 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 15392 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
15393 which was inadvertently undone by the 2002-09-30 patch.
15394 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15395 the same width as int.
15396
420f93c8
PE
153972002-10-04 Paul Eggert <eggert@twinsun.com>
15398
15399 Version 1.50.
15400
15401 * configure.ac (AC_INIT), NEWS: Increment version number.
15402
15403 * doc/bison.texinfo: Minor spelling, grammar, and white space
15404 fixes.
15405 (Symbols): Mention that any negative value returned from yylex
15406 signifies end-of-input. Warn about negative chars. Mention
15407 the portable Standard C character set.
15408
15409 The GNU coding standard says CFLAGS and YFLAGS are reserved
15410 for the installer to set.
15411 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15412 * src/Makefile.am (AM_CFLAGS): Likewise.
15413 (AM_YFLAGS): Renamed from YFLAGS.
15414
15415 Fix some MAX and MIN problems.
15416 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15417 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15418 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15419 * src/reader.c (reader): Use it.
15420
15421 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15422 POSIX 1003.1-2001 has removed fgrep.
15423
154242002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15425
15426 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15427 interpreted as signed.
15428 * lib/ebitset.c (ebitset_list): Fix bug.
15429
ff68026d
PE
154302002-10-01 Paul Eggert <eggert@twinsun.com>
15431
15432 More fixes for 64-bit hosts and large bitsets.
15433
15434 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15435 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15436 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15437 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15438 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15439 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15440 bitset_count_): Likewise.
15441 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15442 bitset_first, bitset_last): Likewise.
15443 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15444 bitset_stats_list_reverse, bitset_stats_size,
15445 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15446 Likewise.
15447 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15448 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15449 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15450 bitsetv_reflexive_transitive_closure): Likewise.
15451 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15452 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15453 Likewise.
15454 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15455 Likewise.
420f93c8 15456
ff68026d
PE
15457 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15458 Use size_t, not unsigned int, to count bytes.
15459 * lib/abitset.h (abitset_bytes): Likewise.
15460 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15461 Likewise.
15462 * lib/bitset.h (bitset_bytes): Likewise.
15463 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15464 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15465 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15466 * lib/ebitset.c (ebitset_bytes): Likewise.
15467 * lib/ebitset.h (ebitset_bytes): Likewise.
15468 * lib/lbitset.c (lbitset_bytes): Likewise.
15469 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 15470
ff68026d
PE
15471 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15472 abitset_subset_p, abitset_disjoint_p, abitset_and,
15473 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15474 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15475 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15476 abitset_or_and, abitset_or_and_cmp):
15477 Use bitset_windex instead of unsigned int.
15478 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15479 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15480 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15481 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15482 Likewise.
15483 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 15484
ff68026d
PE
15485 * lib/bitset.c (bitset_print):
15486 Use proper printf formats for widths of integer types.
15487 * lib/bitset_stats.c (bitset_percent_histogram_print,
15488 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15489 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15490 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15491 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 15492
ff68026d
PE
15493 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15494 BITSET_SIZE_MAX): New macros.
15495 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15496 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15497 to BITSET_WINDEX_MAX.
15498
15499 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15500 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15501 since we now return the bitset_bindex type (not int).
15502
15503 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15504 when computing sizes.
15505 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15506
15507 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15508 and avoid cast to unsigned.
15509
6aa452a6
AD
155102002-09-30 Akim Demaille <akim@epita.fr>
15511
15512 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15513 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15514 Updates from Michael Hayes.
15515
927f7817
AD
155162002-09-30 Art Haas <ahaas@neosoft.com>
15517
15518 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15519 invocations.
15520 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15521 defined.
15522
9738f41e
AD
155232002-09-27 Akim Demaille <akim@epita.fr>
15524
15525 Version 1.49c.
15526
a5c75d7f
AD
155272002-09-27 Akim Demaille <akim@epita.fr>
15528
15529 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15530 (Because of AC_LIBSOURCE).
15531
8280e179
AD
155322002-09-27 Akim Demaille <akim@epita.fr>
15533
15534 Playing with Autoscan.
15535
15536 * configure.ac: Remove the old LIBOBJ tweaks.
15537 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15538 * lib/strrchr.c: New.
15539 * lib/strtol.c: New, from the Coreutils 4.5.1.
15540
ae64af35
AD
155412002-09-27 Akim Demaille <akim@epita.fr>
15542
15543 Playing with Autoscan.
15544
15545 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15546 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15547 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15548 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15549 Coreutils 4.5.1.
15550
d1a1114f
AD
155512002-09-24 Akim Demaille <akim@epita.fr>
15552
15553 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15554 (Frequently Asked Questions, Parser Stack Overflow): New.
15555
b906441c
AD
155562002-09-13 Akim Demaille <akim@epita.fr>
15557
15558 Playing with autoscan.
15559
15560 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15561 * src/files.c (skeleton_find): Remove, unused.
15562 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15563 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15564
bd701811
AD
155652002-09-13 Akim Demaille <akim@epita.fr>
15566
15567 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15568 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15569
e0a13e7b
AD
155702002-09-13 Akim Demaille <akim@epita.fr>
15571
15572 * configure.ac: Require 2.54.
15573 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15574 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15575 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15576 Remove, provided by Autoconf macros.
15577
c97011bf
AD
155782002-09-12 Akim Demaille <akim@epita.fr>
15579
15580 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15581
d862b1be
AD
155822002-09-12 Akim Demaille <akim@epita.fr>
15583
15584 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15585 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15586 Reported by Martin Mokrejs.
15587
3d38c03a
AD
155882002-09-10 Akim Demaille <akim@epita.fr>
15589
15590 * src/parse-gram.y: Associate a human readable string to each
15591 token type.
15592 * tests/regression.at (Invalid inputs): Adjust.
15593
b6347355
AD
155942002-09-10 Gary V. Vaughan <gary@gnu.org>
15595
15596 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15597 with an Autoconf-2.5x style configure.ac.
15598
09ba4ab2
PE
155992002-09-06 Paul Eggert <eggert@twinsun.com>
15600
15601 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15602 exception applies only to yacc.c. This is a modification of a
15603 patch originally suggested by Akim Demaille.
15604
21846f69
AD
156052002-09-06 Akim Demaille <akim@epita.fr>
15606
09ba4ab2
PE
15607 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15608 here to...
15609 * data/yacc.c: here.
15610
21846f69
AD
15611 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15612 LocationType.
15613 (b4_ltype): Default to yy::Location from location.hh.
15614
c0ad8bf3
AD
156152002-09-04 Jim Meyering <jim@meyering.net>
15616
15617 * data/yacc.c: Guard the declaration of yytoknum also with
15618 `#ifdef YYPRINT', so it is declared only when used.
15619
3a93251e
AD
156202002-09-04 Akim Demaille <akim@epita.fr>
15621
15622 * configure.in: Rename as...
15623 * configure.ac: this.
15624 Bump to 1.49c.
15625
427c0dda
AD
156262002-09-04 Akim Demaille <akim@epita.fr>
15627
15628 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15629 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15630 translate maintainer only messages.
15631
6a254321
PE
156322002-08-12 Paul Eggert <eggert@twinsun.com>
15633
645e30d1
PE
15634 Version 1.49b.
15635
6a254321
PE
15636 * Makefile.am (SUBDIRS): Remove intl.
15637 (DISTCLEANFILES): Remove.
15638 * NEWS: Mention that GNU M4 is now required. Clarify what is
15639 meant by "larger grammars". Mention the pt_BR translation.
15640 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15641 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15642 Bump version from 0.11.2 to 0.11.5.
15643 (BISON_PREREQ_STAGE): Remove.
15644 (AM_GNU_GETTEXT): Use external gettext.
15645 (AC_OUTPUT): Remove intl/Makefile.
15646
15647 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15648
15649 * data/glr.c: Include string.h, for strlen.
15650 (yyreportParseError): Use size_t for yysize.
15651 (yy_yypstack): No longer nested inside yypstates, as nested
15652 functions are not portable. Do not assume size_t is the
15653 same width as int.
15654 (yypstates): Do not assume that ptrdiff_t is the same width
15655 as int, and similarly for yyposn and YYINDEX.
15656
15657 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15658
15659 * lib/Makefile.am (INCLUDES): Do not include from the intl
15660 directory, which has been removed.
15661 * src/Makefile.am (INCLUDES): Likewise.
15662
15663 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15664 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15665 New vars.
15666
15667 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15668 * tests/Makefile.am (EXTRA_DIST): Likewise.
15669
15670 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15671 Do not assume that bitset_windex is the same width as unsigned.
15672
15673 * lib/abitset.c (abitset_unused_clear): Do not assume that
15674 bitset_word is the same width as int.
15675 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15676 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15677 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15678 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15679 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15680
15681 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15682 portability to one's complement hosts!).
15683 * lib/ebitset.c (ebitset_op1): Likewise.
15684 * lib/lbitset.c (lbitset_op1): Likewise.
15685
15686 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15687 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15688 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15689 Sync with fileutils.
15690 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15691 lib/gettext.h: Sync with diffutils.
15692
15693 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15694 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15695
15696 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15697 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15698 check for void *.
15699
15700 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15701 size_t; the old version tried to do this but casted improperly.
15702 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15703 (bitset_test): Now returns int, not unsigned long.
15704
15705 * lib/bitset_stats.c: Include "gettext.h".
15706 (_): New macro.
15707 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15708 name locals "index", as it generates unnecessary warnings on some
15709 hosts that have an "index" function.
15710
15711 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15712 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15713 they need translation.
15714 * src/LR0.c (state_list_append, new_itemsets, get_state,
15715 append_states, generate_states): Likewise.
15716 * src/assoc.c (assoc_to_string): Likewise.
15717 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15718 * src/gram.c (grammar_dump): Likewise.
15719 * src/injections.c (injections_compute): Likewise.
15720 * src/lalr.c (lookaheads_print): Likewise.
15721 * src/relation.c (relation_transpose): Likewise.
15722 * src/scan-gram.l: Likewise.
15723 * src/tables.c (table_grow, pack_vector): Likewise.
15724
15725 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15726 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15727 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15728 * m4/mbstate_t.m4: Sync with fileutils.
15729 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15730
15731 * po/LINGUAS: Add pt_BR.
15732 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15733 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15734 lib/timevar.c.
15735 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15736 manual recommends.
15737 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15738
15739 * src/complain.c (strerror_r): Remove decl; not needed.
15740 (strerror): Use same pattern as ../lib/error.c.
15741
15742 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15743
15744 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15745
15746 * src/main.c (main): Cast result of bindtextdomain and textdomain
15747 to void, to avoid a GCC warning when --disable-nls is in effect.
15748
15749 * src/scan-gram.l: Use strings rather than escapes when possible,
15750 to minimize the number of warnings from xgettext.
15751 (handle_action_dollar, handle_action_at): Don't use isdigit,
15752 as it mishandles negative chars and it may not work as expected
15753 outside the C locale.
15754
15755 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15756 this is a GCC extension and is not portable to other compilers.
15757
15758 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15759 Do not include <ctype.h>; no longer needed.
15760 Do not include <malloc.h>; no longer needed (and generates
15761 warnings on OpenBSD 3.0).
15762
15763 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15764 it's not portable.
15765
15766 * tests/regression.at: Do not use 'cc -c input.c -o input';
15767 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15768
15769 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15770 exit status as failure, not just exit status 1. Sun C exits
15771 with status 2 sometimes.
15772
15773 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15774 Use it for the two large tests.
15775
c8f002c7
AD
157762002-08-02 Akim Demaille <akim@epita.fr>
15777
15778 * src/conflicts.c (conflicts_output): Don't output rules never
15779 reduced here, since anyway that computation doesn't work.
15780 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15781 (rule_useless_p, rule_never_reduced_p): New.
15782 (grammar_rules_partial_print): Use a filter instead of a range.
15783 Display the title only if needed.
15784 (grammar_rules_print): Adjust.
15785 (grammar_rules_never_reduced_report): New.
15786 * src/tables.c (action_row): Move the computation of rules never
15787 reduced to...
15788 (token_actions): here.
15789 * src/main.c (main): Make the parser before making the report, so
15790 that rules never reduced are computed.
15791 Call grammar_rules_never_reduced_report.
15792 * src/print.c (print_results): Report rules never reduced.
15793 * tests/conflicts.at, tests/reduce.at: Adjust.
15794
cd08e51e
AD
157952002-08-01 Akim Demaille <akim@epita.fr>
15796
15797 Instead of attaching lookaheads and duplicating the rules being
15798 reduced by a state, attach the lookaheads to the reductions.
15799
15800 * src/state.h (state_t): Remove the `lookaheads',
15801 `lookaheads_rule' member.
15802 (reductions_t): Add a `lookaheads' member.
15803 Use a regular array for the `rules'.
15804 * src/state.c (reductions_new): Initialize the lookaheads member
15805 to 0.
15806 (state_rule_lookaheads_print): Adjust.
15807 * src/state.h, src/state.c (state_reductions_find): New.
15808 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15809 (count_rr_conflicts): Adjust.
15810 * src/lalr.c (LArule): Remove.
15811 (add_lookback_edge): Adjust.
15812 (state_lookaheads_count): New.
15813 (states_lookaheads_initialize): Merge into...
15814 (initialize_LA): this.
15815 (lalr_free): Adjust.
15816 * src/main.c (main): Don't free nullable and derives too early: it
15817 is used by --verbose.
15818 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15819
bb0027a9
AD
158202002-08-01 Akim Demaille <akim@epita.fr>
15821
15822 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15823 `rule_number_t**'.
15824 (set_derives, free_derives): Rename as...
15825 (derives_compute, derives_free): this.
15826 Adjust all dependencies.
15827 * src/nullable.c (set_nullable, free_nullable): Rename as...
15828 (nullable_compute, nullable_free): these.
15829 (rule_list_t): Store rule_t *, not rule_number_t.
15830 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15831 pointers, instead of their numbers.
15832 * src/main.c (main): Call nullable_free, and derives_free earlier,
15833 as they were lo longer used.
15834
3325ddc4
AD
158352002-08-01 Akim Demaille <akim@epita.fr>
15836
15837 * lib/timevar.c (get_time): Include children time.
15838 * src/lalr.h (LA, LArule): Don't export them: used with the
15839 state_t.
15840 * src/lalr.c (LA, LArule): Static.
15841 * src/lalr.h, src/lalr.c (lalr_free): New.
15842 * src/main.c (main): Call it.
15843 * src/tables.c (pack_vector): Check whether loc is >= to the
15844 table_size, not >.
15845 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15846 (tables_generate): do it, since that's also it which allocates
15847 them.
15848 Don't free LA and LArule, main does.
15849
c6f1a33c
AD
158502002-07-31 Akim Demaille <akim@epita.fr>
15851
15852 Separate parser tables computation and output.
15853
15854 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15855 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15856 (yydefgoto, yydefact, high): Move to...
15857 * src/tables.h, src/tables.c: here.
15858 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15859 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15860 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15861 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15862 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15863 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15864 (action_row, save_row, token_actions, save_column, default_goto)
15865 (goto_actions, sort_actions, matching_state, pack_vector)
15866 (table_ninf_remap, pack_table, prepare_actions): Move to...
15867 * src/tables.c: here.
15868 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15869 * src/output.c (token_actions, output_base, output_conflicts)
15870 (output_check): Merge into...
15871 (prepare_actions): this.
15872 (actions_output): Rename as...
15873 (user_actions_output): this.
15874 * src/main.c (main): Call tables_generate and tables_free.
15875
1509d42f
AD
158762002-07-31 Akim Demaille <akim@epita.fr>
15877
15878 Steal GCC's --time-report support.
15879
15880 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15881 stolen/adjusted from GCC.
15882 * m4/stage.m4: Remove time related checks.
15883 * m4/timevar.m4: New.
15884 * configure.in: Adjust.
15885 * src/system.h: Adjust to using timevar.h.
15886 * src/getargs.h, src/getargs.c: Support trace_time for
15887 --trace=time.
15888 * src/main.c (stage): Remove.
15889 (main): Replace `stage' invocations with timevar calls.
15890 * src/output.c: Insert pertinent timevar calls.
15891
273a74fa
AD
158922002-07-31 Akim Demaille <akim@epita.fr>
15893
15894 Let --trace have arguments.
15895
15896 * src/getargs.h (enum trace_e): New.
15897 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15898 (long_options, short_options): --trace/-T takes an optional
15899 argument.
15900 Change all the uses of trace_flag to reflect the new flags.
15901 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15902
15903 Strengthen `stage' portability.
15904
15905 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15906 * configure.in: Use it.
15907 Don't check for malloc.h and sys/times.h.
15908 * src/system.h: Include them when appropriate.
15909 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15910 times and struct tms are available.
15911
217598da
AD
159122002-07-30 Akim Demaille <akim@epita.fr>
15913
15914 In verbose parse error message, don't report `error' as an
15915 expected token.
15916 * tests/actions.at (Printers and Destructors): Adjust.
15917 * tests/calc.at (Calculator $1): Adjust.
15918 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15919 error message, do not report the parser accepts the error token in
15920 that state.
15921
52489d44
AD
159222002-07-30 Akim Demaille <akim@epita.fr>
15923
15924 Normalize conflict related messages.
15925
15926 * src/complain.h, src/complain.c (warn, complain): New.
15927 * src/conflicts.c (conflicts_print): Use them.
15928 (conflict_report_yacc): New, extracted from...
15929 (conflicts_print): here.
15930 * tests/conflicts.at, tests/existing.at: Adjust.
15931
e8832397
AD
159322002-07-30 Akim Demaille <akim@epita.fr>
15933
15934 Report rules which are never reduced by the parser: those hidden
15935 by conflicts.
15936
15937 * src/LR0.c (save_reductions): Don't make the final state too
15938 different: save its reduction (accept) instead of having a state
15939 without any action (no shift or goto, no reduce).
15940 Note: the final state is now a ``regular'' state, i.e., the
15941 parsers now contain `reduce 0' as default reduction.
15942 Nevertheless, since they decide to `accept' when yystate =
15943 final_state, they still will not reduce rule 0.
15944 * src/print.c (print_actions, print_reduction): Adjust.
15945 * src/output.c (action_row): Track reduced rules.
15946 (token_actions): Report rules never reduced.
15947 * tests/conflicts.at, tests/regression.at: Adjust.
15948
caf23d24
AD
159492002-07-30 Akim Demaille <akim@epita.fr>
15950
15951 `stage' was accidently included in a previous patch.
15952 Initiate its autoconfiscation.
15953
15954 * configure.in: Look for malloc.h and sys/times.h.
15955 * src/main.c (stage): Adjust.
15956 Report only when trace_flag.
15957
640748ee
AD
159582002-07-29 Akim Demaille <akim@epita.fr>
15959
15960 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15961 state_number_t.
15962 (errs_t): symbol_t*, not symbol_number_t.
15963 (reductions_t): rule_t*, not rule_number_t.
15964 (FOR_EACH_SHIFT): New.
15965 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15966 * src/print.c, src/print_graph.c: Adjust.
15967
88bce5a2
AD
159682002-07-29 Akim Demaille <akim@epita.fr>
15969
15970 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15971
15972 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15973 (endtoken, accept): these.
15974 * src/reader.c (reader): Set endtoken's default tag to "$end".
15975 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15976 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15977 Adjust.
15978
1bfb97db
AD
159792002-07-29 Akim Demaille <akim@epita.fr>
15980
15981 * src/reduce.c (reduce_grammar): When the language is empty,
15982 complain about the start symbol, not the axiom.
15983 Use its location.
15984 * tests/reduce.at (Empty Language): New.
15985
fc5734fe
AD
159862002-07-26 Akim Demaille <akim@epita.fr>
15987
15988 * src/reader.h, src/reader.c (gram_error): ... can't get
15989 yycontrol without making too strong assumptions on the parser
15990 itself.
15991 * src/output.c (prepare_tokens): Use the real 0th value of
15992 token_translations instead of `0'.
15993 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15994 visible here.
15995 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15996 for the time being: %locations ought to provide it to yyerror.
15997
3650b4b8
AD
159982002-07-25 Akim Demaille <akim@epita.fr>
15999
16000 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16001 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16002 * tests/regression.at (Web2c Actions): Adjust.
16003
4b3d3a8e
AD
160042002-07-25 Akim Demaille <akim@epita.fr>
16005
16006 Stop storing rules from 1 to nrules + 1.
16007
16008 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16009 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16010 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16011 Iterate from 0 to nrules.
16012 Use rule_number_as_item_number and item_number_as_rule_number.
16013 Adjust to `derive' now containing possibly 0.
16014 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16015 Handle the `- 1' part in rule numbers from/to item numbers.
16016 * src/conflicts.c (log_resolution): Fix the message which reversed
16017 shift and reduce.
16018 * src/output.c (action_row): Initialize default_rule to -1.
16019 (token_actions): Adjust.
16020 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16021 expected output.
16022 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16023
4a2a22f4
AD
160242002-07-25 Akim Demaille <akim@epita.fr>
16025
16026 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16027 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16028 (b4_c_knr_arg_decl): New.
16029 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16030 yyreport_parse_error.
16031
b8df3223
AD
160322002-07-25 Akim Demaille <akim@epita.fr>
16033
16034 * data/yacc.c (yyreport_parse_error): New, extracted from...
16035 (yyparse): here.
16036 (yydestruct, yysymprint): Move above yyparse.
16037 Be K&R compliant.
16038
a762e609
AD
160392002-07-25 Akim Demaille <akim@epita.fr>
16040
16041 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16042 replace...
16043 (b4_sint_type, b4_uint_type): these.
16044 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16045 * tests/regression.at (Web2c Actions): Adjust.
16046
12b0043a
AD
160472002-07-25 Akim Demaille <akim@epita.fr>
16048
16049 * src/gram.h (TIEM_NUMBER_MAX): New.
16050 (item_number_of_rule_number, rule_number_of_item_number): Rename
16051 as...
16052 (rule_number_as_item_number, item_number_as_rule_number): these.
16053 Adjust dependencies.
16054 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16055 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16056 (symbol_number_to_vector_number): New.
16057 (order): Of vector_number_t* type.
16058 (base_t, BASE_MAX, BASE_MIN): New.
16059 (froms, tos, width, pos, check): Of base_t type.
16060 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16061 (actrow): Of action_number_t type.
16062 (conflrow): Of unsigned int type.
16063 (table_ninf, base_ninf): New.
16064 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16065 (muscle_insert_int_table, muscle_insert_base_table)
16066 (muscle_insert_rule_number_table): New.
16067 (prepare_tokens): Output `toknum' as int_table.
16068 (action_row): Returns a rule_number_t.
16069 Use ACTION_MIN, not SHRT_MIN.
16070 (token_actions): yydefact is rule_number_t*.
16071 (table_ninf_remap): New.
16072 (pack_table): Use it for `base' and `table'.
16073 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16074 replaced with...
16075 (YYPACT_NINF, YYTABLE_NINF): these.
16076 (yypact, yytable): Compute their types instead of hard-coded
16077 `short'.
16078 * tests/regression.at (Web2c Actions): Adjust.
16079
5dde258a
AD
160802002-07-19 Akim Demaille <akim@epita.fr>
16081
16082 * src/scan-gram.l (id): Can start with an underscore.
16083
a945ec39
AD
160842002-07-16 Akim Demaille <akim@epita.fr>
16085
16086 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16087 Adjust all former `associativity' dependencies.
16088 * src/symtab.c (symbol_new): Default associativity is `undef', not
16089 `right'.
16090 (symbol_check_alias_consistence): Adjust.
16091
fae437e8
AD
160922002-07-09 Akim Demaille <akim@epita.fr>
16093
16094 * doc/bison.texinfo: Properly set the ``header'' part.
16095 Use @dircategory ``GNU programming tools'' as per Texinfo's
16096 documentation.
16097 Use @copying.
16098
1a715ef2
AD
160992002-07-09 Akim Demaille <akim@epita.fr>
16100
16101 * lib/quotearg.h: Protect against multiple inclusions.
16102 * src/location.h (location_t): Add a `file' member.
16103 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16104 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16105 `error_one_per_line' support.
16106
a5d50994
AD
161072002-07-09 Akim Demaille <akim@epita.fr>
16108
16109 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16110 * src/reader.c (lineno): Remove.
16111 Adjust all dependencies.
16112 (get_merge_function): Take a location and use complain_at.
16113 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16114 * tests/regression.at (Invalid inputs, Mixing %token styles):
16115 Adjust.
16116
b275314e
AD
161172002-07-09 Akim Demaille <akim@epita.fr>
16118
16119 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16120 recovery rule, and forbid extensions when --yacc.
16121 (gram_error): Use complain_at.
16122 * src/reader.c (reader): Exit if there were parse errors.
16123
865b9df1
AD
161242002-07-09 Akim Demaille <akim@epita.fr>
16125
16126 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16127 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16128 Reported by R Blake <blakers@mac.com>.
16129
c76e14da
AD
161302002-07-09 Akim Demaille <akim@epita.fr>
16131
16132 * data/yacc.c: Output the copyright notive in the header.
16133
7db2ed2d
AD
161342002-07-03 Akim Demaille <akim@epita.fr>
16135
16136 * src/output.c (froms, tos): Are state_number_t.
16137 (save_column): sp, sp1, and sp2 are state_number_t.
16138 (prepare): Rename `final' as `final_state_number', `nnts' as
16139 `nterms_number', `nrules' as `rules_number', `nstates' as
16140 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16141 unused.
16142 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16143 * data/lalr1.cc (nsym_): Remove, unused.
16144
e68e0410
AD
161452002-07-03 Akim Demaille <akim@epita.fr>
16146
16147 * src/lalr.h, src/lalr.c (goto_number_t): New.
16148 * src/lalr.c (goto_list_t): New.
16149 Propagate them.
16150 * src/nullable.c (rule_list_t): New.
16151 Propagate.
16152 * src/types.h: Remove.
16153
e1a4f3a4
AD
161542002-07-03 Akim Demaille <akim@epita.fr>
16155
16156 * src/closure.c (print_fderives): Use rule_rhs_print.
16157 * src/derives.c (print_derives): Use rule_rhs_print.
16158 (rule_list_t): New, replaces `shorts'.
16159 (set_derives): Add comments.
16160 * tests/sets.at (Nullable, Firsts): Adjust.
16161
536545f3
AD
161622002-07-03 Akim Demaille <akim@epita.fr>
16163
16164 * src/output.c (prepare_actions): Free `tally' and `width'.
16165 (prepare_actions): Allocate and free `order'.
16166 * src/symtab.c (symbols_free): Free `symbols'.
16167 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16168 * src/output.c (m4_invoke): Move to...
16169 * src/scan-skel.l: here.
16170 (<<EOF>>): Close yyout, and free its name.
16171
8b752b00
AD
161722002-07-03 Akim Demaille <akim@epita.fr>
16173
16174 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16175
16176 * src/LR0.c (new_state): Merge into...
16177 (state_list_append): this.
16178 (new_states): Merge into...
16179 (generate_states): here.
16180 (set_states): Don't ensure a proper `errs' state member here, do it...
16181 * src/conflicts.c (conflicts_solve): here.
16182 * src/state.h, src/state.c: Comment changes.
16183 (state_t): Rename member `shifts' as `transitions'.
16184 Adjust all dependencies.
16185 (errs_new): For consistency, also take the values as argument.
16186 (errs_dup): Remove.
16187 (state_errs_set): New.
16188 (state_reductions_set, state_transitions_set): Assert that no
16189 previous value was assigned.
16190 (state_free): New.
16191 (states_free): Use it.
16192 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16193 temporary storage: use `errs' and `nerrs' as elsewhere.
16194 (set_conflicts): Allocate and free this `errs'.
16195
613f5e1a
AD
161962002-07-02 Akim Demaille <akim@epita.fr>
16197
16198 * lib/libiberty.h: New.
16199 * lib: Update the bitset implementation from upstream.
16200 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16201 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16202 * src/main.c: Adjust bitset stats calls.
16203
26e0cadc
PE
162042002-07-01 Paul Eggert <eggert@twinsun.com>
16205
16206 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16207 char, so that negative chars don't collide with $.
16208
1154cced
AD
162092002-06-30 Akim Demaille <akim@epita.fr>
16210
16211 Have the GLR tests be `warning' checked, and fix the warnings.
16212
16213 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16214 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16215 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16216 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16217 (yyaddDeferredAction): static.
16218 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16219 (yyreportParseError): yyprefix is const.
16220 yytokenp is used only when verbose.
16221 (yy__GNUC__): Replace with __GNUC__.
16222 (yypdumpstack): yyi is size_t.
16223 (yypreference): Un-yy local variables and arguments, to avoid
16224 clashes with `yyr1'. Anyway, we are not in the user name space.
16225 (yytname_size): be an int, as is compared with ints.
16226 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16227 Use them.
16228 * tests/cxx-gram.at: Use quotation to protect $1.
16229 Use AT_COMPILE to enable warnings hunts.
16230 Prototype yylex and yyerror.
16231 `Use' argc.
16232 Include `string.h', not `strings.h'.
16233 Produce and prototype stmtMerge only when used.
16234 yylex takes a location.
16235
97650f4e
AD
162362002-06-30 Akim Demaille <akim@epita.fr>
16237
16238 We spend a lot of time in quotearg, in particular when --verbose.
16239
16240 * src/symtab.c (symbol_get): Store a quoted version of the key.
16241 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16242 Adjust all callers.
16243
d2576365
AD
162442002-06-30 Akim Demaille <akim@epita.fr>
16245
16246 * src/state.h (reductions_t): Rename member `nreds' as num.
16247 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16248 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16249
ccaf65bc
AD
162502002-06-30 Akim Demaille <akim@epita.fr>
16251
16252 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16253 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16254 (shifts_to): Rename as...
16255 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16256 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16257 (TRANSITION_IS_DISABLED, transitions_to): these.
16258
87675353
AD
162592002-06-30 Akim Demaille <akim@epita.fr>
16260
16261 * src/print.c (print_shifts, print_gotos): Merge into...
16262 (print_transitions): this.
16263 (print_transitions, print_errs, print_reductions): Align the
16264 lookaheads columns.
16265 (print_core, print_transitions, print_errs, print_state,
16266 print_grammar): Output empty lines separator before, not after.
16267 (state_default_rule_compute): Rename as...
16268 (state_default_rule): this.
16269 * tests/conflicts.at (Defaulted Conflicted Reduction),
16270 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16271 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16272
ce4ccb4b
AD
162732002-06-30 Akim Demaille <akim@epita.fr>
16274
16275 Display items as we display rules.
16276
16277 * src/gram.h, src/gram.c (rule_lhs_print): New.
16278 * src/gram.c (grammar_rules_partial_print): Use it.
16279 * src/print.c (print_core): Likewise.
16280 * tests/conflicts.at (Defaulted Conflicted Reduction),
16281 (Unresolved SR Conflicts): Adjust.
16282 (Unresolved SR Conflicts): Adjust and rename as...
16283 (Resolved SR Conflicts): this, as was meant.
16284 * tests/regression.at (Web2c Report): Adjust.
16285
bc933ef1
AD
162862002-06-30 Akim Demaille <akim@epita.fr>
16287
16288 * src/print.c (state_default_rule_compute): New, extracted from...
16289 (print_reductions): here.
16290 Pessimize, but clarify the code.
16291 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16292
53d4308d
AD
162932002-06-30 Akim Demaille <akim@epita.fr>
16294
16295 * src/output.c (action_row): Let default_rule be always a rule
16296 number.
16297
574fb2d5
AD
162982002-06-30 Akim Demaille <akim@epita.fr>
16299
16300 * src/closure.c (print_firsts, print_fderives, closure):
16301 Use BITSET_EXECUTE.
16302 * src/lalr.c (lookaheads_print): Likewise.
16303 * src/state.c (state_rule_lookaheads_print): Likewise.
16304 * src/print_graph.c (print_core): Likewise.
16305 * src/print.c (print_reductions): Likewise.
16306 * src/output.c (action_row): Likewise.
16307 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16308
05811fd7
AD
163092002-06-30 Akim Demaille <akim@epita.fr>
16310
16311 * src/print_graph.c: Use report_flag.
16312
0e4d5753
AD
163132002-06-30 Akim Demaille <akim@epita.fr>
16314
16315 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16316 to...
16317 * src/relation.h, src/relation.c (traverse, relation_digraph)
16318 (relation_print, relation_transpose): New.
16319
24c7d800
AD
163202002-06-30 Akim Demaille <akim@epita.fr>
16321
16322 * src/state.h, src/state.c (shifts_to): New.
16323 * src/lalr.c (build_relations): Use it.
16324
9222837b
AD
163252002-06-30 Akim Demaille <akim@epita.fr>
16326
16327 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16328 (item_number_of_rule_number, rule_number_of_item_number): New.
16329 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16330 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16331 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16332 Propagate their use.
16333 Much remains to be done, in particular wrt `shorts' from types.h.
16334
260008e5
AD
163352002-06-30 Akim Demaille <akim@epita.fr>
16336
16337 * src/symtab.c (symbol_new): Initialize the `printer' member.
16338
8a731ca8
AD
163392002-06-30 Akim Demaille <akim@epita.fr>
16340
16341 * src/LR0.c (save_reductions): Remove, replaced by...
16342 * src/state.h, src/state.c (state_reductions_set): New.
16343 (reductions, errs): Rename as...
16344 (reductions_t, errs_t): these.
16345 Adjust all dependencies.
16346
32e1e0a4
AD
163472002-06-30 Akim Demaille <akim@epita.fr>
16348
16349 * src/LR0.c (state_list_t, state_list_append): New.
16350 (first_state, last_state): Now symbol_list_t.
16351 (this_state): Remove.
16352 (new_itemsets, append_states, save_reductions): Take a state_t as
16353 argument.
16354 (set_states, generate_states): Adjust.
16355 (save_shifts): Remove, replaced by...
16356 * src/state.h, src/state.c (state_shifts_set): New.
16357 (shifts): Rename as...
16358 (shifts_t): this.
16359 Adjust all dependencies.
16360 * src/state.h (state_t): Remove the `next' member.
16361
e5fb6710
AD
163622002-06-30 Akim Demaille <akim@epita.fr>
16363
16364 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16365 escaped in slot 0.
16366
c7ca99d4
AD
163672002-06-30 Akim Demaille <akim@epita.fr>
16368
16369 Use hash.h for the state hash table.
16370
16371 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16372 (allocate_storage): Use state_hash_new.
16373 (free_storage): Use state_hash_free.
16374 (new_state, get_state): Adjust.
16375 * src/lalr.h, src/lalr.c (states): Move to...
16376 * src/states.h (state_t): Remove the `link' member, no longer
16377 used.
16378 * src/states.h, src/states.c: here.
16379 (state_hash_new, state_hash_free, state_hash_lookup)
16380 (state_hash_insert, states_free): New.
16381 * src/states.c (state_table, state_compare, state_hash): New.
16382 * src/output.c (output_actions): Do not free states now, since we
16383 still need to know the final_state number in `prepare', called
16384 afterwards. Do it...
16385 * src/main.c (main): here: call states_free after `output'.
16386
df0e7316
AD
163872002-06-30 Akim Demaille <akim@epita.fr>
16388
16389 * src/state.h, src/state.c (state_new): New, extracted from...
16390 * src/LR0.c (new_state): here.
16391 * src/state.h (STATE_ALLOC): Move to...
16392 * src/state.c: here.
16393 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16394 * src/state.h, src/state.c: here.
16395
39f41916
AD
163962002-06-30 Akim Demaille <akim@epita.fr>
16397
16398 * src/reader.c (gensym): Rename as...
16399 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16400 (getsym): Rename as...
16401 (symbol_get): this.
16402
d57650a5
AD
164032002-06-30 Akim Demaille <akim@epita.fr>
16404
16405 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16406 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16407 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16408 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16409
5a08f1ce
AD
164102002-06-30 Akim Demaille <akim@epita.fr>
16411
16412 Make the test suite pass with warnings checked.
16413
16414 * tests/actions.at (Printers and Destructors): Improve.
16415 Avoid unsigned vs. signed issues.
16416 * tests/calc.at: Don't exercise the scanner here, do it...
16417 * tests/input.at (Torturing the Scanner): here.
16418
720623af
PH
164192002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16420
88e7e941 16421 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
16422 reorganize first lines parallel to yacc.c.
16423
fb8135fa
AD
164242002-06-28 Akim Demaille <akim@epita.fr>
16425
16426 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16427 (b4_token_enum, b4_token_defines): New, factored from...
16428 * data/lalr1.cc, data/yacc.c, glr.c: here.
16429
41442480
AD
164302002-06-28 Akim Demaille <akim@epita.fr>
16431
16432 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16433 unused variables.
16434 * src/output.c (merger_output): static.
16435
e0e5bf84
AD
164362002-06-28 Akim Demaille <akim@epita.fr>
16437
ba0fe3c7 16438 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
16439 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16440 pacify GCC.
16441 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16442
676385e2
PH
164432002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16444
16445 Accumulated changelog for new GLR parsing features.
16446
6a254321 16447 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
16448 conflicts_total_count.
16449 * src/conflicts.h: Ditto.
16450 * src/output.c (token_actions): Use the new name.
16451 (output_conflicts): Change conflp => conflict_list_heads, and
16452 confl => conflict_list for better readability.
16453 * data/glr.c: Use the new names.
16454 * NEWS: Add self to GLR announcement.
e0e5bf84 16455
676385e2
PH
16456 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16457
16458 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16459 Akim Demaille.
16460
16461 * data/bison.glr: Change name to glr.c
16462 * data/glr.c: Renamed from bison.glr.
16463 * data/Makefile.am: Add glr.c
e0e5bf84
AD
16464
16465 * src/getargs.c:
16466
676385e2 16467 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 16468 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 16469
676385e2
PH
16470 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16471
16472 * data/bison.glr: Be sure to restore the
16473 current #line when returning to the skeleton contents after having
16474 exposed the input file's #line.
16475
16476 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16477
16478 * data/bison.glr: Bring up to date with changes to bison.simple.
16479
16480 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16481
16482 * data/bison.glr: Correct definitions that use b4_prefix.
16483 Various reformatting.
16484 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16485 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16486 yytokenp argument; now part of stack.
16487 (yychar): Define to behave as documented.
16488 (yyclearin): Ditto.
e0e5bf84 16489
676385e2
PH
16490 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16491
16492 * src/reader.h: Add declaration for free_merger_functions.
16493
16494 * src/reader.c (merge_functions): New variable.
16495 (get_merge_function): New function.
16496 (free_merger_functions): New function.
16497 (readgram): Check for %prec that is not followed by a symbol.
16498 Handle %dprec and %merge declarations.
16499 (packgram): Initialize dprec and merger fields in rules array.
16500
16501 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16502 conflict_list_cnt, conflict_list_free): New variables.
16503 (table_grow): Also grow conflict_table.
e0e5bf84 16504 (prepare_rules): Output dprec and merger tables.
676385e2 16505 (conflict_row): New function.
e0e5bf84 16506 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
16507 default reduction in conflicted states for GLR parser so that there
16508 are spaces for the conflict lists.
16509 (save_row): Also save conflict information.
16510 (token_actions): Allocate conflict list.
16511 (merger_output): New function.
16512 (pack_vector): Pack conflict table, too.
16513 (output_conflicts): New function to output yyconflp and yyconfl.
16514 (output_check): Allocate conflict_tos.
16515 (output_actions): Output conflict tables, also.
16516 (output_skeleton): Output b4_mergers definition.
16517 (prepare): Output b4_max_rhs_length definition.
16518 Use 'bison.glr' as default skeleton for GLR parsers.
16519
16520 * src/gram.c (glr_parser): New flag.
16521 (grammar_free): Call free_merger_functions.
16522
16523 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16524 all pairs of conflicting reductions, rather than just all tokens
16525 causing conflicts. Needed to size conflict tables.
e0e5bf84 16526 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
16527 interface.
16528 (conflicts_print): Ditto.
16529 (count_total_conflicts): New function.
16530
16531 * src/reader.h (merger_list): New type.
16532 (merge_functions): New variable.
16533
16534 * src/lex.h (tok_dprec, tok_merge): New token types.
16535
16536 * src/gram.h (rule_s): Add dprec and merger fields.
16537 (glr_parser): New flag.
16538
16539 * src/conflicts.h (count_total_conflicts): New function.
16540
16541 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16542
16543 * doc/bison.texinfo (Generalized LR Parsing): New section.
16544 (GLR Parsers): New section.
16545 (Language and Grammar): Mention GLR parsing.
16546 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16547 Correct typo ("tge" -> "the").
16548
16549 * data/bison.glr: New skeleton for GLR parsing.
16550
16551 * tests/cxx-gram.at: New tests for GLR parsing.
16552
16553 * tests/testsuite.at: Include cxx-gram.at.
16554
16555 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 16556
676385e2
PH
16557 * src/parse-gram.y:
16558
16559 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16560
16561 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 16562
b5480d74 165632002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
16564
16565 * src/options.h, src/options.c: Remove.
16566 * src/getargs.c (short_options, long_options): New.
16567
60491a94
AD
165682002-06-27 Akim Demaille <akim@epita.fr>
16569
16570 * data/bison.simple, data/bison.c++: Rename as...
16571 * data/yacc.c, data/lalr1.cc: these.
16572 * doc/bison.texinfo (Environment Variables): Remove.
16573
9be0c25b
AD
165742002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16575
16576 * src/getargs.c (report_argmatch): Initialize strtok().
16577
1ae72863
AD
165782002-06-20 Akim Demaille <akim@epita.fr>
16579
16580 * data/bison.simple (b4_symbol_actions): New, replaces...
16581 (b4_symbol_destructor, b4_symbol_printer): these.
16582 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16583 user token numbers.
16584
87542d29
AD
165852002-06-20 Akim Demaille <akim@epita.fr>
16586
16587 * data/bison.simple (yydestructor): Rename as...
16588 (yydestruct): this.
16589
1a31ed21
AD
165902002-06-20 Akim Demaille <akim@epita.fr>
16591
16592 * src/symtab.h, src/symtab.c (symbol_type_set)
16593 (symbol_destructor_set, symbol_precedence_set): The location is
16594 the last argument.
16595 Adjust all callers.
16596
e776192e
AD
165972002-06-20 Akim Demaille <akim@epita.fr>
16598
16599 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16600 internals.
16601 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16602 Takes a location.
16603 * src/symtab.h, src/symtab.c (symbol_class_set)
16604 (symbol_user_token_number_set): Likewise.
16605 Adjust all callers.
16606 Promote complain_at.
16607 * tests/input.at (Type Clashes): Adjust.
16608
5c1180b3
AD
166092002-06-20 Akim Demaille <akim@epita.fr>
16610
16611 * data/bison.simple (YYLEX): Fix the declaration when
16612 %pure-parser.
16613
e3170060
AD
166142002-06-20 Akim Demaille <akim@epita.fr>
16615
16616 * data/bison.simple (yysymprint): Don't print the token number,
16617 just its name.
16618 * tests/actions.at (Destructors): Rename as...
16619 (Printers and Destructors): this.
16620 Also exercise %printer.
16621
253862fd
AD
166222002-06-20 Akim Demaille <akim@epita.fr>
16623
16624 * data/bison.simple (YYDSYMPRINT): New.
16625 Use it to remove many of the #if YYDEBUG/if (yydebug).
16626
366eea36
AD
166272002-06-20 Akim Demaille <akim@epita.fr>
16628
16629 * src/symtab.h, src/symtab.c (symbol_t): printer and
16630 printer_location are new members.
16631 (symbol_printer_set): New.
16632 * src/parse-gram.y (PERCENT_PRINTER): New token.
16633 Handle its associated rule.
16634 * src/scan-gram.l: Adjust.
16635 (handle_destructor_at, handle_destructor_dollar): Rename as...
16636 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16637 * src/output.c (symbol_printers_output): New.
16638 (output_skeleton): Call it.
16639 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16640 since there are already many grammar files with a user `yyprint'.
16641 Replace the calls to YYPRINT to calls to yysymprint.
16642 * tests/calc.at: Adjust.
16643 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16644 taking advantage of parser very internal details (stack size!).
16645
4f25ebb0
AD
166462002-06-20 Akim Demaille <akim@epita.fr>
16647
16648 * src/scan-gram.l: Complete the scanner with the missing patterns
16649 to pacify Flex.
16650 Use `quote' and `symbol_tag_get' where appropriate.
16651
93b68a0e
AD
166522002-06-19 Akim Demaille <akim@epita.fr>
16653
16654 * tests/actions.at (Destructors): Augment to test locations.
16655 * data/bison.simple (yydestructor): Pass it the current location
16656 if locations are enabled.
16657 Prototype only when __STDC__ or C++.
16658 Change the argument names to move into the yy name space: there is
16659 user code here.
16660
58612f1d
AD
166612002-06-19 Akim Demaille <akim@epita.fr>
16662
74310291
AD
16663 * data/bison.simple (b4_pure_if): New.
16664 Use it instead of #ifdef YYPURE.
16665
166662002-06-19 Akim Demaille <akim@epita.fr>
16667
16668 * data/bison.simple (b4_location_if): New.
58612f1d
AD
16669 Use it instead of #ifdef YYLSP_NEEDED.
16670
f25bfb75
AD
166712002-06-19 Akim Demaille <akim@epita.fr>
16672
16673 Prepare @$ in %destructor, but currently don't bind it in the
16674 skeleton, as %location use is not cleaned up yet.
16675
16676 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16677 (handle_action_at): New.
16678 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16679 a braced_code_t and a location as additional arguments.
16680 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16681 unquote one when outputting `b4_dollar_dollar'.
16682 Adjust callers.
16683 * data/bison.simple (b4_eval): Remove.
16684 (b4_symbol_destructor): Adjust.
16685 * tests/input.at (Invalid @n): Adjust.
16686
c732d2c6
AD
166872002-06-19 Zack Weinberg <zack@codesourcery.com>
16688
16689 * doc/bison.texinfo: Document ability to have multiple
16690 prologue sections.
16691
8c165d89
AD
166922002-06-18 Akim Demaille <akim@epita.fr>
16693
16694 * src/files.c (compute_base_names): When computing the output file
16695 names from the input file name, strip the directory part.
16696
ca98bf57
AD
166972002-06-18 Akim Demaille <akim@epita.fr>
16698
16699 * data/bison.simple.new: Comment changes.
16700 Reported by Andreas Schwab.
16701
0bfb02ff
AD
167022002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16703
16704 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16705 there are no `label `yyoverflowlab' defined but not used' warnings
16706 when yyoverflow is defined.
16707
24c0aad7
AD
167082002-06-18 Akim Demaille <akim@epita.fr>
16709
16710 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16711 new member.
16712 (symbol_destructor_set): Adjust.
16713 * src/output.c (symbol_destructors_output): Output the destructor
16714 locations.
16715 Output the symbol name.
16716 * data/bison.simple (b4_symbol_destructor): Adjust.
16717
5719c109
AD
167182002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16719 and Akim Demaille <akim@epita.fr>
16720
16721 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16722 what's left on the stack when the error recovery hits EOF.
16723 * tests/actions.at (Destructors): Complete to exercise this case.
16724
9280d3ef
AD
167252002-06-17 Akim Demaille <akim@epita.fr>
16726
16727 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16728 arguments is really empty, not only equal to `[]'.
16729 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16730 member.
16731 (symbol_destructor_set): New.
16732 * src/output.c (symbol_destructors_output): New.
16733 * src/reader.h (brace_code_t, current_braced_code): New.
16734 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16735 (handle_dollar): Rename as...
16736 (handle_action_dollar): this.
16737 (handle_destructor_dollar): New.
16738 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16739 (grammar_declaration): Use it.
16740 * data/bison.simple (yystos): Is always defined.
16741 (yydestructor): New.
16742 * tests/actions.at (Destructors): New.
16743 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16744
dafdc66f
AD
167452002-06-17 Akim Demaille <akim@epita.fr>
16746
16747 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16748 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16749 rule_length only when needed.
16750 * src/output.c (actions_output, token_definitions_output): Output
16751 the full M4 block.
16752 * src/symtab.c: Don't access directly to the symbol tag, use
16753 symbol_tag_get.
16754 * src/parse-gram.y: Use symbol_list_free.
16755
56c47203
AD
167562002-06-17 Akim Demaille <akim@epita.fr>
16757
16758 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16759 (symbol_list_prepend, get_type_name): Move to...
16760 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16761 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16762 Adjust all callers.
16763 (symbol_list_free): New.
16764 * src/scan-gram.l (handle_dollar): Takes a location.
16765 * tests/input.at (Invalid $n): Adjust.
16766
1e0bab92
AD
167672002-06-17 Akim Demaille <akim@epita.fr>
16768
16769 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16770 (symbol_list_prepend): New.
16771 * src/parse-gram.y (%union): `list' is a new member.
16772 (symbols.1): New, replaces...
16773 (terms_to_prec.1, nterms_to_type.1): these.
16774 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16775 Take a location as additional argument.
16776 Adjust all callers.
16777
04e60654
AD
167782002-06-15 Akim Demaille <akim@epita.fr>
16779
16780 * src/parse-gram.y: Move %token in the declaration section so that
16781 we don't depend upon CVS Bison.
16782
10e5b8bd
AD
167832002-06-15 Akim Demaille <akim@epita.fr>
16784
16785 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16786 * src/print.c (print_core): Use it.
16787
9801d40c
AD
167882002-06-15 Akim Demaille <akim@epita.fr>
16789
16790 * src/conflicts.c (log_resolution): Accept the rule involved in
16791 the sr conflicts instead of the lookahead number that points to
16792 that rule.
16793 (flush_reduce): Accept the current lookahead vector as argument,
16794 instead of the index in LA.
16795 (resolve_sr_conflict): Accept the current number of lookahead
16796 bitset to consider for the STATE, instead of the index in LA.
16797 (set_conflicts): Adjust.
16798 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16799
c0263492
AD
168002002-06-15 Akim Demaille <akim@epita.fr>
16801
16802 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16803 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16804 Adjust all dependencies.
16805 * src/lalr.c (initialize_lookaheads): Split into...
16806 (states_lookaheads_count, states_lookaheads_initialize): these.
16807 (lalr): Adjust.
16808
9757c359
AD
168092002-06-15 Akim Demaille <akim@epita.fr>
16810
16811 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16812 out of...
16813 (grammar_rules_print): here.
16814 * src/reduce.c (reduce_output): Use it.
16815 * tests/reduce.at (Useless Rules, Reduced Automaton)
16816 (Underivable Rules): Adjust.
16817
6b98e4b5
AD
168182002-06-15 Akim Demaille <akim@epita.fr>
16819
16820 Copy BYacc's nice way to report the grammar.
16821
16822 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16823 New.
16824 Don't print the rules' location, it is confusing and useless.
16825 (rule_print): Use grammar_rhs_print.
16826 * src/print.c (print_grammar): Use grammar_rules_print.
16827
6b98e4b5
AD
168282002-06-15 Akim Demaille <akim@epita.fr>
16829
16830 Complete and rationalize `useless thing' warnings.
16831
16832 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16833 (symbol_tag_print): New.
16834 Use them everywhere in place of accessing directly the tag member.
16835 * src/gram.h, src/gram.c (rule_print): New.
16836 Use it where a rule used to be printed `by hand'.
16837 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16838 (reduce_grammar_tables): Report the useless rules.
16839 (reduce_print): Useless things are a warning, not an error.
16840 Report it as such.
16841 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16842 (Reduced Automaton, Underivable Rules): Adjust.
16843 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16844 * tests/conflicts.at (Unresolved SR Conflicts)
16845 (Solved SR Conflicts): Adjust.
16846
ee000ba4
AD
168472002-06-15 Akim Demaille <akim@epita.fr>
16848
16849 Let symbols have a location.
16850
16851 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16852 (getsym): Adjust.
16853 Adjust all callers.
16854 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16855 Use location_t, not int.
16856 * src/symtab.c (symbol_check_defined): Take advantage of the
16857 location.
16858 * tests/regression.at (Invalid inputs): Adjust.
16859
8efe435c
AD
168602002-06-15 Akim Demaille <akim@epita.fr>
16861
16862 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16863 (input): Don't try to initialize yylloc here, do it in the
16864 scanner.
16865 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16866 * src/gram.h (rule_t): Change line and action_line into location
16867 and action_location, of location_t type.
16868 Adjust all dependencies.
16869 * src/location.h, src/location.c (empty_location): New.
16870 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16871 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16872 (grammar_current_rule_symbol_append)
16873 (grammar_current_rule_action_append): Expect a location as argument.
16874 * src/reader.c (grammar_midrule_action): Adjust to attach an
16875 action's location as dummy symbol location.
16876 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16877 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16878 the line numbers.
16879
1921f1d7
AD
168802002-06-14 Akim Demaille <akim@epita.fr>
16881
16882 Grammar declarations may be found in the grammar section.
16883
16884 * src/parse-gram.y (rules_or_grammar_declaration): New.
16885 (declarations): Each declaration may end with a semicolon, not
16886 just...
16887 (grammar_declaration): `"%union"'.
16888 (grammar): Branch to rules_or_grammar_declaration.
16889
4515534c
AD
168902002-06-14 Akim Demaille <akim@epita.fr>
16891
16892 * src/main.c (main): Invoke scanner_free.
16893
f958596b
AD
168942002-06-14 Akim Demaille <akim@epita.fr>
16895
16896 * src/output.c (m4_invoke): Extracted from...
16897 (output_skeleton): here.
16898 Free tempfile.
16899
2c569025
AD
169002002-06-14 Akim Demaille <akim@epita.fr>
16901
16902 * src/parse-gram.y (directives, directive, gram)
16903 (grammar_directives, precedence_directives, precedence_directive):
16904 Rename as...
16905 (declarations, declaration, grammar, grammar_declaration)
16906 (precedence_declaration, precedence_declarator): these.
16907 (symbol_declaration): New.
16908
592e8d4d
AD
169092002-06-14 Akim Demaille <akim@epita.fr>
16910
16911 * src/files.c (action_obstack): Remove, unused.
16912 (output_obstack): Remove it, and all its dependencies, as it is no
16913 longer needed.
16914 * src/reader.c (epilogue_set): Build the epilogue in the
16915 muscle_obstack.
16916 * src/output.h, src/output.c (muscle_obstack): Move to...
16917 * src/muscle_tab.h, src/muscle_tab.h: here.
16918 (muscle_init): Initialize muscle_obstack.
16919 (muscle_free): New.
16920 * src/main.c (main): Call it.
16921
0c15323d
AD
169222002-06-14 Akim Demaille <akim@epita.fr>
16923
16924 * src/location.h: New, extracted from...
16925 * src/reader.h: here.
16926 * src/Makefile.am (noinst_HEADERS): Merge into
16927 (bison_SOURCES): this.
16928 Add location.h.
16929 * src/parse-gram.y: Use location_t instead of Bison's.
16930 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16931 Use location_t instead of ints.
16932
e96c9728
AD
169332002-06-14 Akim Demaille <akim@epita.fr>
16934
16935 * data/bison.simple, data/bison.c++: Be sure to restore the
16936 current #line when returning to the skeleton contents after having
16937 exposed the input file's #line.
16938
75d1fe16
AD
169392002-06-12 Akim Demaille <akim@epita.fr>
16940
16941 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16942 eager.
16943 * tests/actions.at (Exotic Dollars): New.
16944
6c35d22c
AD
169452002-06-12 Akim Demaille <akim@epita.fr>
16946
16947 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16948 ['"/] too eagerly.
16949 * tests/input.at (Torturing the Scanner): New.
16950
1d6412ad
AD
169512002-06-11 Akim Demaille <akim@epita.fr>
16952
16953 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16954 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16955 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16956 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16957 * src/reader.c (reader): Use it.
16958
4cdb01db
AD
169592002-06-11 Akim Demaille <akim@epita.fr>
16960
16961 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16962 Adjust all callers.
16963 (scanner_last_string_free): New.
16964
44995b2e
AD
169652002-06-11 Akim Demaille <akim@epita.fr>
16966
16967 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16968 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16969 (last_string, YY_OBS_FREE): New.
16970 Use them when returning an ID.
16971
e9955c83
AD
169722002-06-11 Akim Demaille <akim@epita.fr>
16973
16974 Have Bison grammars parsed by a Bison grammar.
16975
16976 * src/reader.c, src/reader.h (prologue_augment): New.
16977 * src/reader.c (copy_definition): Remove.
16978
16979 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16980 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16981 (grammar_current_rule_prec_set, grammar_current_rule_check)
16982 (grammar_current_rule_symbol_append)
16983 (grammar_current_rule_action_append): Export.
16984 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16985 (symbol_list_action_append): Remove.
16986 Hook the routines from reader.
16987 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16988 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16989
16990 * src/reader.c (read_declarations): Remove, unused.
16991
16992 * src/parse-gram.y: Handle the epilogue.
16993 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16994 (grammar_start_symbol_set): this.
16995 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16996 * src/reader.c (readgram): Remove, unused.
16997 (reader): Adjust to insert eoftoken and axiom where appropriate.
16998
16999 * src/reader.c (copy_dollar): Replace with...
17000 * src/scan-gram.h (handle_dollar): this.
17001 * src/parse-gram.y: Remove `%thong'.
17002
17003 * src/reader.c (copy_at): Replace with...
17004 * src/scan-gram.h (handle_at): this.
17005
17006 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17007 New.
17008
17009 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17010 time being.
17011
17012 * src/reader.h, src/reader.c (grammar_rule_end): New.
17013
17014 * src/parse.y (current_type, current_class): New.
17015 Implement `%nterm', `%token' support.
17016 Merge `%term' into `%token'.
17017 (string_as_id): New.
17018 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17019 type name.
17020
17021 * src/parse-gram.y: Be sure to handle properly the beginning of
17022 rules.
17023
17024 * src/parse-gram.y: Handle %type.
17025 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17026
17027 * src/parse-gram.y: More directives support.
17028 * src/options.c: No longer handle source directives.
17029
17030 * src/parse-gram.y: Fix %output.
17031
17032 * src/parse-gram.y: Handle %union.
17033 Use the prologue locations.
17034 * src/reader.c (parse_union_decl): Remove.
17035
17036 * src/reader.h, src/reader.c (epilogue_set): New.
17037 * src/parse-gram.y: Use it.
17038
17039 * data/bison.simple, data/bison.c++: b4_stype is now either not
17040 defined, then default to int, or to the contents of %union,
17041 without `union' itself.
17042 Adjust.
17043 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17044
17045 * src/output.c (actions_output): Don't output braces, as they are
17046 already handled by the scanner.
17047
17048 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17049 characters to themselves.
17050
17051 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17052 that the epilogue has a proper #line.
17053
17054 * src/parse-gram.y: Handle precedence/associativity.
17055
17056 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17057 a terminal.
17058 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17059 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17060 at all to define terminals that cannot be emitted.
17061
17062 * src/scan-gram.l: Escape M4 characters.
17063
17064 * src/scan-gram.l: Working properly with escapes in user
17065 strings/characters.
17066
17067 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17068 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17069 grammar.
17070 Use more modest sizes, as for the time being the parser does not
17071 release memory, and therefore the process swallows a huge amount
17072 of memory.
17073
17074 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17075 stricter %token grammar.
17076
17077 * src/symtab.h (associativity): Add `undef_assoc'.
17078 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17079 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17080
17081 * tests/regression.at (Invalid %directive): Remove, as it is now
17082 meaningless.
17083 (Invalid inputs): Adjust to the new error messages.
17084 (Token definitions): The new grammar doesn't allow too many
17085 eccentricities.
17086
17087 * src/lex.h, src/lex.c: Remove.
17088 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17089 (copy_character, copy_string2, copy_string, copy_identifier)
17090 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17091 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17092 (parse_action): Remove.
17093 * po/POTFILES.in: Adjust.
17094
2e047461
AD
170952002-06-11 Akim Demaille <akim@epita.fr>
17096
cd05d13c 17097 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
17098 rule's action member: return the action as a string.
17099 Don't require `rule_length' as an argument: compute it.
17100 (grammar_current_rule_symbol_append)
17101 (grammar_current_rule_action_append): New, eved out from
17102 (readgram): here.
17103 Remove `action_flag', `rulelength', unused now.
17104
9af3fbce
AD
171052002-06-11 Akim Demaille <akim@epita.fr>
17106
17107 * src/reader.c (grammar_current_rule_prec_set).
17108 (grammar_current_rule_check): New, eved out from...
17109 (readgram): here.
17110 Remove `xaction', `first_rhs': useless.
17111 * tests/input.at (Type clashes): New.
17112 * tests/existing.at (GNU Cim Grammar): Adjust.
17113
1485e106
AD
171142002-06-11 Akim Demaille <akim@epita.fr>
17115
17116 * src/reader.c (grammar_midrule_action): New, Eved out from
17117 (readgram): here.
17118
da4160c3
AD
171192002-06-11 Akim Demaille <akim@epita.fr>
17120
17121 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17122 New.
17123 (readgram): Use them as replacement of inlined code, crule and
17124 crule1.
17125
f6d0f937
AD
171262002-06-11 Akim Demaille <akim@epita.fr>
17127
17128 * src/reader.c (grammar_end, grammar_symbol_append): New.
17129 (readgram): Use them.
17130 Make the use of `p' as local as possible.
17131
69078d4b
AD
171322002-06-10 Akim Demaille <akim@epita.fr>
17133
17134 GCJ's parser requires the tokens to be defined before the prologue.
17135
17136 * data/bison.simple: Output the token definition before the user's
17137 prologue.
17138 * tests/regression.at (Braces parsing, Duplicate string)
17139 (Mixing %token styles): Check the output from bison.
17140 (Early token definitions): New.
17141
5e424082
AD
171422002-06-10 Akim Demaille <akim@epita.fr>
17143
17144 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17145 assigning twice the same user number to a token, so that we can
17146 use it in...
17147 * src/lex.c (lex): here.
17148 Also use `symbol_class_set' instead of hand written code.
17149 * src/reader.c (parse_assoc_decl): Likewise.
17150
44536b35
AD
171512002-06-10 Akim Demaille <akim@epita.fr>
17152
17153 * src/symtab.c, src/symtab.c (symbol_class_set)
17154 (symbol_user_token_number_set): New.
17155 * src/reader.c (parse_token_decl): Use them.
17156 Use a switch instead of ifs.
17157 Use a single argument.
17158
8b9f2372
AD
171592002-06-10 Akim Demaille <akim@epita.fr>
17160
17161 Remove `%thong' support as it is undocumented, unused, duplicates
17162 `%token's job, and creates useless e-mail traffic with people who
17163 want to know what it is, why it is undocumented, unused, and
17164 duplicates `%token's job.
17165
17166 * src/reader.c (parse_thong_decl): Remove.
17167 * src/options.c (option_table): Remove "thong".
17168 * src/lex.h (tok_thong): Remove.
17169
3ae2b51f
AD
171702002-06-10 Akim Demaille <akim@epita.fr>
17171
17172 * src/symtab.c, src/symtab.c (symbol_type_set)
17173 (symbol_precedence_set): New.
17174 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17175 (value_components_used): Remove, unused.
17176
2f1afb73
AD
171772002-06-09 Akim Demaille <akim@epita.fr>
17178
17179 Move symbols handling code out of the reader.
17180
17181 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17182 (axiom): Move to...
17183 * src/symtab.h, src/symtab.c: here.
17184
17185 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17186 * src/reader.c (startval): Rename as...
17187 * src/symtab.h, src/symtab.c (startsymbol): this.
17188 * src/reader.c: Adjust.
17189
17190 * src/reader.c (symbol_check_defined, symbol_make_alias)
17191 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17192 (token_translations_init)
17193 Move to...
17194 * src/symtab.c: here.
17195 * src/reader.c (packsymbols): Move to...
17196 * src/symtab.h, src/symtab.c (symbols_pack): here.
17197 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17198 argument.
17199
e9bca3ad
AD
172002002-06-03 Akim Demaille <akim@epita.fr>
17201
17202 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17203 then statements.
17204
86eff183
AD
172052002-06-03 Akim Demaille <akim@epita.fr>
17206
17207 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17208 structs with non literals.
17209 * src/scan-skel.l: never-interactive.
17210 * src/conflicts.c (enum conflict_resolution_e): No trailing
17211 comma.
17212 * src/getargs.c (usage): Split long literal strings.
17213 Reported by Hans Aberg.
17214
717be197
AD
172152002-05-28 Akim Demaille <akim@epita.fr>
17216
17217 * data/bison.c++: Use C++ ostreams.
17218 (cdebug_): New member.
17219
670ddffd
AD
172202002-05-28 Akim Demaille <akim@epita.fr>
17221
17222 * src/output.c (output_skeleton): Be sure to allocate enough room
17223 for `/' _and_ for `\0' in full_skeleton.
17224
769b430f
AD
172252002-05-28 Akim Demaille <akim@epita.fr>
17226
17227 * data/bison.c++: Catch up with bison.simple:
17228 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17229 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17230 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17231 and popping traces.
17232
7067cb36
PH
172332002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17234
17235 * src/output.c (output_skeleton): Put an explicit path in front of
17236 the skeleton file name, rather than relying on the -I directory,
17237 to partially alleviate effects of having a skeleton file lying around
17238 in the current directory.
769b430f 17239
4a713ec2
PH
172402002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17241
769b430f 17242 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17243 obstack_printf should be obstack_fgrow1.
17244
b408954b
AD
172452002-05-26 Akim Demaille <akim@epita.fr>
17246
17247 * src/state.h (state_t): `solved_conflicts' is a new member.
17248 * src/LR0.c (new_state): Set it to 0.
17249 * src/conflicts.h, src/conflicts.c (print_conflicts)
17250 (free_conflicts, solve_conflicts): Rename as...
17251 (conflicts_print, conflicts_free, conflicts_solve): these.
17252 Adjust callers.
17253 * src/conflicts.c (enum conflict_resolution_e)
17254 (solved_conflicts_obstack): New, used by...
17255 (log_resolution): this.
17256 Adjust to attach the conflict resolution to each state.
17257 Complete the description with the precedence/associativity
17258 information.
17259 (resolve_sr_conflict): Adjust.
17260 * src/print.c (print_state): Output its solved_conflicts.
17261 * tests/conflicts.at (Unresolved SR Conflicts)
17262 (Solved SR Conflicts): Exercise --report=all.
17263
a49aecd5
AD
172642002-05-26 Akim Demaille <akim@epita.fr>
17265
17266 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17267 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17268 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17269 (token_number_t, item_number_as_token_number)
17270 (token_number_as_item_number, muscle_insert_token_number_table):
17271 Rename as...
17272 (symbol_number_t, item_number_as_symbol_number)
17273 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17274 these, since it is more appropriate.
17275
5504898e
AD
172762002-05-26 Akim Demaille <akim@epita.fr>
17277
17278 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17279 `Error:' lines.
17280 * data/bison.simple (yystos) [YYDEBUG]: New.
17281 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17282 error recovery.
17283 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17284
ec3bc396
AD
172852002-05-25 Akim Demaille <akim@epita.fr>
17286
17287 * doc/bison.texinfo (Debugging): Split into...
17288 (Tracing): this new section, its former contents, and...
17289 (Understanding): this new section.
17290 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17291 by...
17292 (report_flag): this.
17293 Adjust all dependencies.
17294 (report_args, report_types, report_argmatch): New.
17295 (usage, getargs): Report/support -r, --report.
17296 * src/options.h
17297 (struct option_table_struct): Rename as..,
17298 (struct option_table_s): this.
17299 Rename the `set_flag' member to `flag' to match with getopt_long's
17300 struct.
17301 * src/options.c (option_table): Split verbose into an entry for
17302 %verbose, and another for --verbose.
17303 Support --report/-r, so remove -r from the obsolete --raw.
17304 * src/print.c: Attach full item sets and lookaheads reports to
17305 report_flag instead of trace_flag.
17306 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17307
78df8250
PE
173082002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17309 and Paul Eggert <eggert@twinsun.com>
769b430f 17310
78df8250
PE
17311 * data/bison.simple (yyparse): Correct error handling to conform to
17312 POSIX and yacc. Specifically, after syntax error is discovered,
17313 do not reduce further before shifting the error token.
17314 Clean up the code a bit by removing the labels yyerrdefault,
17315 yyerrhandle, yyerrpop.
17316 * NEWS: Document the above.
17317
c0c9ea05
PH
173182002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17319
17320 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17321 type; it isn't always big enough, since it doesn't necessarily
17322 include non-terminals.
769b430f 17323 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17324 the latter can be removed.
17325 (yy_token_number_type): Remove, only one use.
17326 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17327 don't use TokenNumberType as element type.
769b430f 17328
c0c9ea05
PH
17329 * tests/regression.at: Modify expected output to agree with change
17330 to yyr1 and yytranslate.
769b430f 17331
6390a83f
FK
173322002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17333
17334 * src/reader.c (parse_action): Use copy_character instead of
17335 obstack_1grow.
17336
db7c8e9a
AD
173372002-05-13 Akim Demaille <akim@epita.fr>
17338
17339 * tests/regression.at (Token definitions): Prototype yylex and
17340 yyerror.
17341
fcc61800
PH
173422002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17343
158c687b 17344 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
17345 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17346 32-bit arithmetic.
17347 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17348
5683e9b2
AD
173492002-05-07 Akim Demaille <akim@epita.fr>
17350
17351 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17352 avoid GCC warnings.
17353
0c2d3f4c
AD
173542002-05-07 Akim Demaille <akim@epita.fr>
17355
17356 Kill GCC warnings.
17357
17358 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17359 over the RHS of each rule.
17360 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17361 * src/state.h (state_t): Member `nitems' is unsigned short.
17362 * src/LR0.c (get_state): Adjust.
17363 * src/reader.c (packgram): Likewise.
17364 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17365 `Type'.
17366 (muscle_insert_int_table): Remove, unused.
17367 (prepare_rules): Remove `max'.
17368
1565b720
AD
173692002-05-06 Akim Demaille <akim@epita.fr>
17370
17371 * src/closure.c (print_firsts): Display of the symbol tags.
17372 (bitmatrix_print): Move to...
17373 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17374 here.
17375 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17376
cfaee611
AD
173772002-05-06 Akim Demaille <akim@epita.fr>
17378
17379 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17380 hash_do_for_each.
17381
458be8e0
AD
173822002-05-06 Akim Demaille <akim@epita.fr>
17383
17384 * src/LR0.c (new_state, get_state): Instead of using the global
17385 `kernel_size' and `kernel_base', have two new arguments:
17386 `core_size' and `core'.
17387 Adjust callers.
17388
a900a624
AD
173892002-05-06 Akim Demaille <akim@epita.fr>
17390
17391 * src/reader.c (packgram): No longer end `ritem' with a 0
17392 sentinel: it is not used.
17393
d4e7d3a1
AD
173942002-05-05 Akim Demaille <akim@epita.fr>
17395
17396 New experimental feature: display the lookaheads in the report and
17397 graph.
17398
17399 * src/print (print_core): When --trace-flag, display the rules
17400 lookaheads.
17401 * src/print_graph.c (print_core): Likewise.
17402 Swap the arguments.
17403 Adjust caller.
17404
39ceb25b
AD
174052002-05-05 Akim Demaille <akim@epita.fr>
17406
17407 * tests/torture.at (Many lookaheads): New test.
17408
5372019f
AD
174092002-05-05 Akim Demaille <akim@epita.fr>
17410
17411 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17412 (GENERATE_MUSCLE_INSERT_TABLE): this.
17413 (output_int_table, output_unsigned_int_table, output_short_table)
17414 (output_token_number_table, output_item_number_table): Replace with...
17415 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17416 (muscle_insert_short_table, muscle_insert_token_number_table)
17417 (muscle_insert_item_number_table): these.
17418 Adjust all callers.
17419 (prepare_tokens): Don't free `translations', since...
17420 * src/reader.h, src/reader.c (grammar_free): do it.
17421 Move to...
17422 * src/gram.h, src/gram.c (grammar_free): here.
17423 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17424 b4_translate_max.
17425
5df5f6d5
AD
174262002-05-05 Akim Demaille <akim@epita.fr>
17427
17428 * src/output.c (output_unsigned_int_table): New.
17429 (prepare_rules): `i' is unsigned.
17430 `prhs', `rline', `r2' are unsigned int.
17431 Rename muscle `rhs_number_max' as `rhs_max'.
17432 Output muscles `prhs_max', `rline_max', and `r2_max'.
17433 Free rline and r1.
17434 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17435 to compute types instead of constant types.
17436 * tests/regression.at (Web2c Actions): Adjust.
17437
b87f8b21
AD
174382002-05-04 Akim Demaille <akim@epita.fr>
17439
17440 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17441 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17442 Adjust dependencies.
17443 * src/output.c (token_definitions_output): Be sure not to output a
17444 `#define 'a'' when fed with `%token 'a' "a"'.
17445 * tests/regression.at (Token definitions): New.
17446
8bb936e4
PE
174472002-05-03 Paul Eggert <eggert@twinsun.com>
17448
17449 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17450 for K&R C.
17451
174522002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17453
17454 * Makefile.am (SUBDIRS): Remove intl.
17455 (EXTRA_DIST): Add config/config.rpath.
17456
53c71a12
AD
174572002-05-03 Akim Demaille <akim@epita.fr>
17458
17459 * data/bison.simple (m4_if): Don't output empty enums.
17460 And actually, output valid enum definitions :(.
17461
289dd0cf
AD
174622002-05-03 Akim Demaille <akim@epita.fr>
17463
17464 * configure.bat: Remove, completely obsolete.
17465 * Makefile.am (EXTRA_DIST): Adjust.
17466 Don't distribute config.rpath...
17467 * config/Makefile.am (EXTRA_DIST): Do it.
17468
db85e524
AD
174692002-05-03 Akim Demaille <akim@epita.fr>
17470
17471 * configure.in (GETTEXT_VERSION): New.
17472 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17473
83ccf991
AD
174742002-05-03 Akim Demaille <akim@epita.fr>
17475
17476 * data/bison.simple (b4_token_enum): New.
17477 (b4_token_defines): Use it to output tokens both as #define and
17478 enums.
17479 Suggested by Paul Eggert.
17480 * src/output.c (token_definitions_output): Don't output spurious
17481 white spaces.
17482
1f418995
AD
174832002-05-03 Akim Demaille <akim@epita.fr>
17484
17485 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17486
45119f04
RA
174872002-05-02 Robert Anisko <robert@lrde.epita.fr>
17488
17489 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17490 Update the stack class, give a try to deque as the default container.
17491
b2d52318
AD
174922002-05-02 Akim Demaille <akim@epita.fr>
17493
17494 * data/bison.simple (yyparse): Do not implement @$ = @1.
17495 (YYLLOC_DEFAULT): Adjust to do it.
17496 * doc/bison.texinfo (Location Default Action): Fix.
17497
3a8b4109
AD
174982002-05-02 Akim Demaille <akim@epita.fr>
17499
17500 * src/reader.c (parse_braces): Merge into...
17501 (parse_action): this.
17502
84614e13
AD
175032002-05-02 Akim Demaille <akim@epita.fr>
17504
17505 * configure.in (ALL_LINGUAS): Remove.
17506 * po/LINGUAS, hr.po: New.
17507
fdbcd8e2
AD
175082002-05-02 Akim Demaille <akim@epita.fr>
17509
17510 Remove the so called hairy (semantic) parsers.
17511
17512 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17513 * src/gram.h, src/gram.c (semantic_parser): Remove.
17514 (rule_t): Remove the guard and guard_line members.
17515 * src/lex.h (token_t): remove tok_guard.
17516 * src/options.c (option_table): Remove %guard and %semantic_parser
17517 support.
17518 * src/output.c, src/output.h (guards_output): Remove.
17519 (prepare): Adjust.
17520 (token_definitions_output): Don't output the `T'
17521 tokens (???).
17522 (output_skeleton): Don't output the guards.
17523 * src/files.c, src/files.c (attrsfile): Remove.
17524 * src/reader.c (symbol_list): Remove the guard and guard_line
17525 members.
17526 Adjust dependencies.
17527 (parse_guard): Remove.
17528 * data/bison.hairy: Remove.
17529 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17530 BISON_HAIRY.
17531
82b6cb3f
AD
175322002-05-02 Akim Demaille <akim@epita.fr>
17533
17534 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17535 (parse_guard): Rename the formal argument `stack_offset' as
17536 `rule_length', which is more readable.
17537 Adjust callers.
17538 (copy_at, copy_dollar): Instead of outputting the hard coded
17539 values of $$, $n and so forth, output invocation to b4_lhs_value,
17540 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
17541 Note: this patch partially drops `semantic-parser' support: it
17542 always does `rule_length - n', where semantic parsers ought to
17543 always use `-n'.
82b6cb3f
AD
17544 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17545 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17546
6cbfbcc5
AD
175472002-05-02 Akim Demaille <akim@epita.fr>
17548
17549 * configure.in (AC_INIT): Bump to 1.49b.
17550 (AM_INIT_AUTOMAKE): Short invocation.
17551
b8548114
AD
175522002-05-02 Akim Demaille <akim@epita.fr>
17553
17554 Version 1.49a.
17555
c20cd1fa
AD
175562002-05-01 Akim Demaille <akim@epita.fr>
17557
17558 * src/skeleton.h: Remove.
17559
8a9566d4
AD
175602002-05-01 Akim Demaille <akim@epita.fr>
17561
17562 * src/skeleton.h: Fix the #endif.
17563 Reported by Magnus Fromreide.
17564
8c6d399a
PE
175652002-04-26 Paul Eggert <eggert@twinsun.com>
17566
17567 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17568 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 17569 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 17570
2b7ed18a
RA
175712002-04-25 Robert Anisko <robert@lrde.epita.fr>
17572
17573 * src/scan-skel.l: Postprocess quadrigraphs.
17574
17575 * src/reader.c (copy_character): New function, used to output
17576 single characters while replacing `[' and `]' with quadrigraphs, to
17577 avoid troubles with M4 quotes.
17578 (copy_comment): Output characters with copy_character.
17579 (read_additionnal_code): Likewise.
17580 (copy_string2): Likewise.
17581 (copy_definition): Likewise.
17582
17583 * tests/calc.at: Exercise M4 quoting.
17584
34a89c50
AD
175852002-04-25 Akim Demaille <akim@epita.fr>
17586
17587 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17588 between `!' and the command.
17589 Reported by Paul Eggert.
17590
0dd1580a
RA
175912002-04-24 Robert Anisko <robert@lrde.epita.fr>
17592
17593 * tests/calc.at: Exercise prologue splitting.
17594
17595 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17596 `b4_post_prologue' instead of `b4_prologue'.
17597
17598 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17599 muscles.
17600 (output): Free pre_prologue_obstack and post_prologue_obstack.
17601 * src/files.h, src/files.c (attrs_obstack): Remove.
17602 (pre_prologue_obstack, post_prologue_obstack): New.
17603 * src/reader.c (copy_definition): Add a parameter to specify the
17604 obstack to fill, instead of using attrs_obstack unconditionally.
17605 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17606 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17607
83c1796f
PE
176082002-04-23 Paul Eggert <eggert@twinsun.com>
17609
17610 * data/bison.simple: Remove unnecessary commentary and white
17611 space differences from 1_29-branch.
17612 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17613
17614 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17615 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17616 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17617 constructors or destructors.
17618
17619 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17620
1207eeac
AD
176212002-04-23 Akim Demaille <akim@epita.fr>
17622
17623 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17624 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17625 location with columns.
17626 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17627 All reported by Paul Eggert.
17628
78ab8f67
AD
176292002-04-22 Akim Demaille <akim@epita.fr>
17630
17631 * src/reduce.c (dump_grammar): Move to...
17632 * src/gram.h, src/gram.c (grammar_dump): here.
17633 Be sure to separate long item numbers.
17634 Don't read the members of a rule's prec if its nil.
17635
133c20e2
AD
176362002-04-22 Akim Demaille <akim@epita.fr>
17637
17638 * src/output.c (table_size, table_grow): New.
17639 (MAXTABLE): Remove, replace uses with table_size.
17640 (pack_vector): Instead of dying when the table is too big, grow it.
17641
9515e8a7
AD
176422002-04-22 Akim Demaille <akim@epita.fr>
17643
17644 * data/bison.simple (yyr1): Its type is that of a token number.
17645 * data/bison.c++ (r1_): Likewise.
17646 * tests/regression.at (Web2c Actions): Adjust.
17647
23c5a174
AD
176482002-04-22 Akim Demaille <akim@epita.fr>
17649
17650 * src/reader.c (token_translations_init): 256 is now the default
17651 value for the error token, i.e., it will be assigned another
17652 number if the user assigned 256 to one of her tokens.
17653 (reader): Don't force 256 to error.
17654 * doc/bison.texinfo (Symbols): Adjust.
17655 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17656 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17657 etc. instead of 10, 20, 30 (which was used to `jump' over error
17658 (256) and undefined (2)).
17659
5fbb0954
AD
176602002-04-22 Akim Demaille <akim@epita.fr>
17661
17662 Propagate more token_number_t.
17663
17664 * src/gram.h (token_number_as_item_number)
17665 (item_number_as_token_number): New.
17666 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17667 Use it to create output_item_number_table and
17668 output_token_number_table.
17669 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17670 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17671 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17672 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17673
4f940944
AD
176742002-04-22 Akim Demaille <akim@epita.fr>
17675
17676 * src/output.h, src/output.c (get_lines_number): Remove.
17677
3ded9a63
AD
176782002-04-19 Akim Demaille <akim@epita.fr>
17679
17680 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17681 as Lex/Flex'.
17682 (Debugging): More details about enabling the debugging features.
17683 (Table of Symbols): Describe $$, $n, @$, and @n.
17684 Suggested by Tim Josling.
17685
e0c471a9
AD
176862002-04-19 Akim Demaille <akim@epita.fr>
17687
17688 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17689
fecc10cd
AD
176902002-04-10 Akim Demaille <akim@epita.fr>
17691
17692 * src/system.h: Rely on HAVE_LIMITS_H.
17693 Suggested by Paul Eggert.
17694
51dec47b
AD
176952002-04-09 Akim Demaille <akim@epita.fr>
17696
17697 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17698 full stderr, and strip it according to the bison options, instead
17699 of composing the error message from different bits.
17700 This makes it easier to check for several error messages.
17701 Adjust all the invocations.
17702 Add an invocation exercising the error token.
17703 Add an invocation demonstrating a stupid error message.
17704 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17705 Adjust the tests.
17706 Error message are for stderr, not stdout.
17707
007a50a4
AD
177082002-04-09 Akim Demaille <akim@epita.fr>
17709
17710 * src/gram.h, src/gram.c (error_token_number): Remove, use
17711 errtoken->number.
17712 * src/reader.c (reader): Don't specify the user token number (2)
17713 for $undefined, as it uselessly prevents using it.
17714 * src/gram.h (token_number_t): Move to...
17715 * src/symtab.h: here.
17716 (state_t.number): Is a token_number_t.
17717 * src/print.c, src/reader.c: Use undeftoken->number instead of
17718 hard coded 2.
17719 (Even though this 2 is not the same as above: the number of the
17720 undeftoken remains being 2, it is its user token number which
17721 might not be 2).
17722 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17723 `user_token_number_max'.
17724 Output `undef_token_number'.
17725 * data/bison.simple, data/bison.c++: Use them.
17726 Be sure to map invalid yylex return values to
17727 `undef_token_number'. This saves us from gratuitous SEGV.
17728
17729 * tests/conflicts.at (Solved SR Conflicts)
17730 (Unresolved SR Conflicts): Adjust.
17731 * tests/regression.at (Web2c Actions): Adjust.
17732
06446ccf
AD
177332002-04-08 Akim Demaille <akim@epita.fr>
17734
17735 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17736 Adding #line.
17737 Remove the duplicate `typedefs'.
17738 (RhsNumberType): Fix the declaration and various other typos.
17739 Use __ofile__.
17740 * data/bison.simple: Use __ofile__.
17741 * src/scan-skel.l: Handle __ofile__.
17742
62a3e4f0
AD
177432002-04-08 Akim Demaille <akim@epita.fr>
17744
17745 * src/gram.h (item_number_t): New, the type of item numbers in
17746 RITEM. Note that it must be able to code symbol numbers as
17747 positive number, and the negation of rule numbers as negative
17748 numbers.
17749 Adjust all dependencies (pretty many).
17750 * src/reduce.c (rule): Remove this `short *' pointer: use
17751 item_number_t.
17752 * src/system.h (MINSHORT, MAXSHORT): Remove.
17753 Include `limits.h'.
17754 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17755 (shortcpy): Remove.
17756 (MAXTABLE): Move to...
17757 * src/output.c (MAXTABLE): here.
17758 (prepare_rules): Use output_int_table to output rhs.
17759 * data/bison.simple, data/bison.c++: Adjust.
17760 * tests/torture.at (Big triangle): Move the limit from 254 to
17761 500.
17762 * tests/regression.at (Web2c Actions): Ajust.
17763
17764 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17765 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17766 passes, but produces negative #line number, once fixed, GCC is
17767 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17768 C), it passes.
17769 * src/state.h (state_h): Code input lines on ints, not shorts.
17770
bb88b0fc
AD
177712002-04-08 Akim Demaille <akim@epita.fr>
17772
17773 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17774 and then the grammar.
17775
9a636f47
AD
177762002-04-08 Akim Demaille <akim@epita.fr>
17777
17778 * src/system.h: No longer using strndup.
17779
680e8701
AD
177802002-04-07 Akim Demaille <akim@epita.fr>
17781
17782 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17783 * src/output.c (output_table_data): Return the longest number.
17784 (prepare_tokens): Output `token_number_max').
17785 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17786 New.
17787 Use them to define yy_token_number_type/TokenNumberType.
17788 Use this type for yytranslate.
17789 * tests/torture.at (Big triangle): Push the limit from 124 to
17790 253.
17791 * tests/regression.at (Web2c Actions): Adjust.
17792
817e9f41
AD
177932002-04-07 Akim Demaille <akim@epita.fr>
17794
17795 * tests/torture.at (Big triangle): New.
17796 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17797 * tests/existing.at: here.
17798
5123689b
AD
177992002-04-07 Akim Demaille <akim@epita.fr>
17800
17801 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17802 nritems.
17803 Adjust dependencies.
17804
f3849179
AD
178052002-04-07 Akim Demaille <akim@epita.fr>
17806
17807 * src/reader.c: Normalize increments to prefix form.
17808
bd02036a
AD
178092002-04-07 Akim Demaille <akim@epita.fr>
17810
17811 * src/reader.c, symtab.c: Remove debugging code.
17812
db8837cb
AD
178132002-04-07 Akim Demaille <akim@epita.fr>
17814
17815 Rename all the `bucket's as `symbol_t'.
17816
17817 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17818 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17819 * src/symtab.c, src/symtab.h (bucket): Rename as...
17820 (symbol_t): this.
17821 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17822 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17823 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17824 (buckets_new, buckets_free, buckets_do): Rename as...
17825 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17826 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17827 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17828 (symbols_new, symbols_free, symbols_do): these.
17829
72a23c97
AD
178302002-04-07 Akim Demaille <akim@epita.fr>
17831
17832 Use lib/hash for the symbol table.
17833
17834 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17835 EOF.
17836 * src/lex.c (lex): Set the `number' member of new terminals.
17837 * src/reader.c (bucket_check_defined, bucket_make_alias)
17838 (bucket_check_alias_consistence, bucket_translation): New.
17839 (reader, grammar_free, readgram, token_translations_init)
17840 (packsymbols): Adjust.
17841 (reader): Number the predefined tokens.
17842 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17843 for predefined tokens.
17844 * src/symtab.h (bucket): Remove all the hash table related
17845 members.
17846 * src/symtab.c (symtab): Replace by...
17847 (bucket_table): this.
17848 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17849 (buckets_new, buckets_do): New.
17850
280a38c3
AD
178512002-04-07 Akim Demaille <akim@epita.fr>
17852
17853 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17854 (start_symbol, max_user_token_number, semantic_parser)
17855 (error_token_number): Initialize.
17856 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17857 Initialize.
17858 (reader): Don't.
17859 (errtoken, eoftoken, undeftoken, axiom): Extern.
17860
03b31c0c
AD
178612002-04-07 Akim Demaille <akim@epita.fr>
17862
17863 * src/gram.h (rule_s): prec and precsym are now pointers
17864 to the bucket giving the priority/associativity.
17865 Member `associativity' removed: useless.
17866 * src/reduce.c, src/conflicts.c: Adjust.
17867
8b3df748
AD
178682002-04-07 Akim Demaille <akim@epita.fr>
17869
17870 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17871 Properly escape the symbols' TAG when outputting them.
17872
e601aa1d
AD
178732002-04-07 Akim Demaille <akim@epita.fr>
17874
17875 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17876
b0299a2e
AD
178772002-04-07 Akim Demaille <akim@epita.fr>
17878
17879 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17880 (LArule): this, which is an array to rule_t*.
17881 * src/print.c, src/conflicts.c: Adjust.
17882
d7e1f00c
AD
178832002-04-07 Akim Demaille <akim@epita.fr>
17884
17885 * src/gram.h (rule_t): Rename `number' as `user_number'.
17886 `number' is a new member.
17887 Adjust dependencies.
17888 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17889
cc9305dd
AD
178902002-04-07 Akim Demaille <akim@epita.fr>
17891
17892 As a result of the previous patch, it is no longer needed
17893 to reorder ritem itself.
17894
17895 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17896
b0940840
AD
178972002-04-07 Akim Demaille <akim@epita.fr>
17898
17899 Be sure never to walk through RITEMS, but use only data related to
17900 the rules themselves. RITEMS should be banished.
17901
17902 * src/output.c (output_token_translations): Rename as...
17903 (prepare_tokens): this.
17904 In addition to `translate', prepare the muscles `tname' and
17905 `toknum', which were handled by...
17906 (output_rule_data): this.
17907 Remove, and move the remainder of its outputs into...
17908 (prepare_rules): this new routines, which also merges content from
17909 (output_gram): this.
17910 (prepare_rules): Be sure never to walk through RITEMS.
17911 (output_stos): Rename as...
17912 (prepare_stos): this.
17913 (output): Always invoke prepare_states, after all, just don't use it
17914 in the output if you don't need it.
17915
643a5994
AD
179162002-04-07 Akim Demaille <akim@epita.fr>
17917
17918 * src/LR0.c (new_state): Display `nstates' as the name of the
17919 newly created state.
17920 Adjust to initialize first_state and last_state if needed.
17921 Be sure to distinguish the initial from the final state.
17922 (new_states): Create the itemset of the initial state, and use
17923 new_state.
17924 * src/closure.c (closure): Now that the initial state has its
17925 items properly set, there is no need for a special case when
17926 creating `ruleset'.
17927
17928 As a result, now the rule 0, reducing to $axiom, is visible in the
17929 outputs. Adjust the test suite.
17930
17931 * tests/conflicts.at (Solved SR Conflicts)
17932 (Unresolved SR Conflicts): Adjust.
17933 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17934 * tests/conflicts.at (S/R in initial): New.
17935
b4c4ccc2
AD
179362002-04-07 Akim Demaille <akim@epita.fr>
17937
17938 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17939 the RHS of the rules.
17940 * src/output.c (output_gram): Likewise.
17941
bba97eb2
AD
179422002-04-07 Akim Demaille <akim@epita.fr>
17943
17944 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17945 bucket.
17946 Adjust all dependencies.
17947 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17948 `number' of the buckets too.
17949 * src/gram.h: Include `symtab.h'.
17950 (associativity): Move to...
17951 * src/symtab.h: here.
17952 No longer include `gram.h'.
17953
c3b407f4
AD
179542002-04-07 Akim Demaille <akim@epita.fr>
17955
17956 * src/gram.h, src/gram.c (rules_rhs_length): New.
17957 (ritem_longest_rhs): Use it.
17958 * src/gram.h (rule_t): `number' is a new member.
17959 * src/reader.c (packgram): Set it.
17960 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17961 the end of `rules', and count them out of `nrules'.
17962 (reduce_output, dump_grammar): Adjust.
17963 * src/print.c (print_grammar): It is no longer needed to check for
17964 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17965 * tests/reduce.at (Reduced Automaton): New test.
17966
11652ab3
AD
179672002-04-07 Akim Demaille <akim@epita.fr>
17968
17969 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17970 lacking `+ 1' to nrules, Bison reported as useless a token if it
17971 was used solely to set the precedence of the last rule...
17972
26b23c1a
AD
179732002-04-07 Akim Demaille <akim@epita.fr>
17974
17975 * data/bison.c++, data/bison.simple: Don't output the current file
17976 name in #line, to avoid useless diffs between two identical
17977 outputs under different names.
17978
18bcecb0
AD
179792002-04-07 Akim Demaille <akim@epita.fr>
17980
17981 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17982 Normalize loops to using `< nrules + 1', not `<= nrules'.
17983
fa770c86
AD
179842002-04-07 Akim Demaille <akim@epita.fr>
17985
17986 * TODO: Update.
17987
d9b739c3
AD
179882002-04-07 Akim Demaille <akim@epita.fr>
17989
17990 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17991 bucket.value as bucket.number.
17992
99013900
AD
179932002-04-07 Akim Demaille <akim@epita.fr>
17994
17995 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17996 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17997 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17998 RHS, instead of being an index in RITEMS.
17999
e966383b
PE
180002002-04-04 Paul Eggert <eggert@twinsun.com>
18001
18002 * doc/bison.texinfo: Update copyright date.
18003 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18004 (Symbols): Warn about running Bison in one character set,
18005 but compiling and/or running in an incompatible one.
18006 Warn about character code 256, too.
18007
180082002-04-03 Paul Eggert <eggert@twinsun.com>
18009
18010 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18011 YYERROR_VERBOSE is nonzero, not whether it is defined.
18012
18013 Merge changes from bison-1_29-branch.
c307773e 18014
8d6c48b9
PE
180152002-03-20 Paul Eggert <eggert@twinsun.com>
18016
18017 Merge fixes from Debian bison_1.34-1.diff.
18018
18019 * configure.in (AC_PREREQ): 2.53.
18020
e53c6322
AD
180212002-03-20 Akim Demaille <akim@epita.fr>
18022
18023 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18024
9ffbeca7
PE
180252002-03-19 Paul Eggert <eggert@twinsun.com>
18026
21db0b2a
PE
18027 * src/bison.simple (YYCOPY): New macro.
18028 (YYSTACK_RELOCATE): Use it.
18029 Remove Type arg; no longer needed. All callers changed.
18030 (yymemcpy): Remove; no longer needed.
18031
9ffbeca7
PE
18032 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18033 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18034
642cb8f8
AD
180352002-03-19 Akim Demaille <akim@epita.fr>
18036
18037 Test and fix the #line outputs.
18038
18039 * tests/atlocal.at (GCC): New.
18040 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 18041 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
18042 (Action synch line, Epilogue synch line): New tests.
18043 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18044 * data/bison.simple, data/bison.c++: Use it.
18045
3c31a486
AD
180462002-03-19 Akim Demaille <akim@epita.fr>
18047
18048 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18049 (Solved SR Conflicts, %expect not enough, %expect right)
18050 (%expect too much): Move to...
18051 * tests/conflicts.at: this new file.
18052
0d8bed56
AD
180532002-03-19 Akim Demaille <akim@epita.fr>
18054
18055 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18056 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18057 that we can move to enums for instance.
18058 * src/output.c (token_definitions_output): Output a list of
18059 `token-name, token-number' instead of the #define.
18060 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18061
9208d17f
AD
180622002-03-14 Akim Demaille <akim@epita.fr>
18063
18064 Use Gettext 0.11.1.
18065
af27eacb
RA
180662002-03-09 Robert Anisko <robert@lrde.epita.fr>
18067
18068 * data/bison.c++: Make the user able to add members to the generated
18069 parser by subclassing.
18070
9101a310
RA
180712002-03-05 Robert Anisko <robert@lrde.epita.fr>
18072
18073 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18074 a character.
18075 Reported by Nicolas Tisserand and Nicolas Burrus.
18076
fff9bf0b
RA
180772002-03-04 Robert Anisko <robert@lrde.epita.fr>
18078
18079 * src/reader.c: Warn about lacking semi-colons, do not complain.
18080
64dba31e
RA
180812002-03-04 Robert Anisko <robert@lrde.epita.fr>
18082
18083 * data/bison.c++: Remove a debug line.
18084
374f5a14
RA
180852002-03-04 Robert Anisko <robert@lrde.epita.fr>
18086
18087 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18088 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18089 provide a default implementation.
18090
bfcf1f3a
AD
180912002-03-04 Akim Demaille <akim@epita.fr>
18092
18093 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18094 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18095 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18096 * tests/semantic.at (Parsing Guards): Similarly.
18097 * src/reader.at (readgram): Complain if the last rule is not ended
18098 with a semi-colon.
18099
65ccf9fc
AD
181002002-03-04 Akim Demaille <akim@epita.fr>
18101
18102 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18103 * src/closure.c: here.
18104 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18105 RTC.
18106 * src/warshall.h, src/warshall.c: Remove.
18107 * tests/sets.at (Broken Closure): Adjust.
18108
d0039cbc
AD
181092002-03-04 Akim Demaille <akim@epita.fr>
18110
18111 * src/output.c (output_skeleton): tempdir is const.
18112 bytes_read is unused.
18113
345cea78
AD
181142002-03-04 Akim Demaille <akim@epita.fr>
18115
18116 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18117 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18118 Update.
18119 From Michael Hayes.
18120
564801f7
AD
181212002-03-04 Akim Demaille <akim@epita.fr>
18122
18123 * src/closure.c (closure): `r' is unused.
18124
e5352bc7
AD
181252002-03-04 Akim Demaille <akim@epita.fr>
18126
18127 * tests/sets.at (Broken Closure): Add the ending `;'.
18128 * src/reader.at (readgram): Complain if a rule is not ended with a
18129 semi-colon.
18130
914feea9
AD
181312002-03-04 Akim Demaille <akim@epita.fr>
18132
18133 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18134 (count_sr_conflicts): Use bitset_count.
18135 * src/reduce.c (inaccessable_symbols): Ditto.
18136 (bits_size): Remove.
18137 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18138
f0250de6
AD
181392002-03-04 Akim Demaille <akim@epita.fr>
18140
18141 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18142 * src/reduce.c: Remove the `bitset_zero's following the
18143 `bitset_create's, as now it is performed by the latter.
18144
ef017502
AD
181452002-03-04 Akim Demaille <akim@epita.fr>
18146
18147 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18148 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18149 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18150 latest sources from Michael.
18151
76514394
AD
181522002-03-04 Akim Demaille <akim@epita.fr>
18153
18154 * src/output.c (output): Don't free the grammar.
18155 * src/reader.c (grammar_free): New.
18156 * src/main.c (main): Call it and don't free symtab here.
18157
55024580
AD
181582002-03-04 Akim Demaille <akim@epita.fr>
18159
18160 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18161 before returning.
18162 Reported by Benoit Perrot.
18163
f9abaa2c
AD
181642002-03-04 Akim Demaille <akim@epita.fr>
18165
18166 Use bitset operations when possible, not loops over bits.
18167
18168 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18169 bitset_or.
18170 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18171 * src/reduce.c (useless_nonterminals): Formatting changes.
18172 * src/warshall.c (TC): Use bitset_or.
18173
0e721e75
AD
181742002-03-04 Akim Demaille <akim@epita.fr>
18175
18176 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18177 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18178 Ditto.
18179
0fb1ffb1
AD
181802002-03-04 Akim Demaille <akim@epita.fr>
18181
18182 * src/lalr.c (F): Now a bitset*.
18183 Adjust all dependencies.
18184
b86796bf
AD
181852002-03-04 Akim Demaille <akim@epita.fr>
18186
18187 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18188 Adjust all dependencies.
18189
602bbf31
AD
181902002-03-04 Akim Demaille <akim@epita.fr>
18191
18192 * src/L0.c, src/LR0.h (nstates): Be size_t.
18193 Adjust comparisons (signed vs unsigned).
18194 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18195 bitset*.
18196 Adjust all dependencies.
18197
d8a0245c
AD
181982002-03-04 Akim Demaille <akim@epita.fr>
18199
18200 * src/closure.c (firsts): Now, also a bitset.
18201 Adjust all dependencies.
18202 (varsetsize): Remove, now unused.
18203 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18204
34ba9743
AD
182052002-03-04 Akim Demaille <akim@epita.fr>
18206
18207 * src/print.c: Convert to use bitset.h, not hand coded iterations
18208 over ints.
18209
ed86e78c
AD
182102002-03-04 Akim Demaille <akim@epita.fr>
18211
18212 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18213
dfdb1797
AD
182142002-03-04 Akim Demaille <akim@epita.fr>
18215
18216 * src/closure.c (ruleset): Be a bitset.
18217 (rulesetsize): Remove.
18218
7086e707
AD
182192002-03-04 Akim Demaille <akim@epita.fr>
18220
18221 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18222 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18223 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18224 * src/closure.c (fderives): Be an array of bitsets.
18225
98254360
RA
182262002-02-28 Robert Anisko <robert@lrde.epita.fr>
18227
18228 * data/bison.c++: Merge the two generated headers. Insert a copyright
18229 notice in each output file.
18230
a75c057f
AD
182312002-02-28 Akim Demaille <akim@epita.fr>
18232
18233 * data/bison.c++: Copy the prologue of bison.simple to fetch
18234 useful M4 definitions, such as b4_header_guard.
18235
06b00abc
AD
182362002-02-25 Akim Demaille <akim@epita.fr>
18237
18238 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18239 translator friendly scheme for the bgr
18240 copyright notice.
06b00abc 18241
70e7d534
AD
182422002-02-25 Akim Demaille <akim@epita.fr>
18243
18244 * src/output.c (header_output): Remove, now handled completely via
18245 M4.
18246
abe017f6
AD
182472002-02-25 Akim Demaille <akim@epita.fr>
18248
18249 * m4/m4.m4: New, from CVS Autoconf.
18250 * configure.in: Invoke it.
18251 * src/output.c (output_skeleton): Use its result instead of the
18252 hard coded name.
18253
381fb12e
AD
182542002-02-25 Akim Demaille <akim@epita.fr>
18255
18256 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18257 Fileutils 4.1.5.
18258 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18259 * src/output.c (output_skeleton): Use mkstemp to create a real
18260 temporary file.
18261 Move the filling of `skeleton' and its muscle to...
18262 (prepare): here.
18263 (output): Move the definition of the prologue muscle to...
18264 (prepare): here.
18265 * src/system.h (DEFAULT_TMPDIR): New.
18266
6f38107f
PE
182672002-02-14 Paul Eggert <eggert@twinsun.com>
18268
18269 Remove the support for C++ namespace cleanliness; it was
18270 causing more problems than it was curing, since it didn't work
18271 properly on some nonstandard C++ compilers. This can wait
18272 for a proper C++ parser.
18273
18274 * NEWS: Document this.
18275 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18276 of C++, as it's treated like C now.
18277 * src/bison.simple (YYSTD): Remove.
18278 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18279 Treat C++ just like Standard C instead of trying to support
18280 namespace cleanliness.
18281
80cce3da
AD
182822002-02-14 Akim Demaille <akim@epita.fr>
18283
18284 * tests/regression.at (else): Adjust to Andreas' change.
18285
842e8679
AD
182862002-02-14 Akim Demaille <akim@epita.fr>
18287
18288 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18289
4bda3f10
AD
182902002-02-13 Andreas Schwab <schwab@suse.de>
18291
18292 * src/output.c (output_rule_data): Don't output NULL, it might
18293 not be defined yet.
18294
4162fa07 182952002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18296
4162fa07
RA
18297 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18298 (Copyright notice): Update.
b418ecd8 18299
bd16a5dc
AD
183002002-02-11 Akim Demaille <akim@epita.fr>
18301
18302 * tests/regression.at (%nonassoc and eof): Don't include
18303 nonportable headers.
18304
8d69a1a3
RA
183052002-02-08 Robert Anisko <robert@lrde.epita.fr>
18306
18307 * data/bison.c++: Correct error recovery. Make the user able to
18308 initialize the starting location.
18309
9b2d0677
AD
183102002-02-07 Akim Demaille <akim@epita.fr>
18311
18312 * tests/input.at: New.
18313
69e2658b
RA
183142002-02-07 Robert Anisko <robert@lrde.epita.fr>
18315
18316 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18317 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18318 directives around tables only needed for debugging.
18319
4aacc3a7
RA
183202002-02-07 Robert Anisko <robert@lrde.epita.fr>
18321
18322 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18323 C++ parsers.
18324 (yy::b4_name::parse): Use print_.
18325
762a801e
RA
183262002-02-07 Robert Anisko <robert@lrde.epita.fr>
18327
18328 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18329
4bb2bc3f
RA
183302002-02-07 Robert Anisko <robert@lrde.epita.fr>
18331
18332 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18333 C++ parsers.
18334 (yy::b4_name::parse): Build verbose error messages, and use error_.
18335
6b45a3ca
RA
183362002-02-06 Robert Anisko <robert@lrde.epita.fr>
18337
18338 * data/bison.c++: Fix m4 quoting in comments.
18339
50997c6e
RA
183402002-02-06 Robert Anisko <robert@lrde.epita.fr>
18341
18342 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18343 not expanded by m4.
18344
3f3eed27
AD
183452002-02-05 Akim Demaille <akim@epita.fr>
18346
18347 * data/bison.c++: Adjust to the M4 back end.
18348 More is certainly needed.
18349
be2a1a68
AD
183502002-02-05 Akim Demaille <akim@epita.fr>
18351
18352 Give a try to M4 as a back end.
18353
18354 * lib/readpipe.c: New, from wdiff.
18355 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18356 BISON_HAIRY.
18357 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18358 specific values. Now it is m4 that performs the lookup.
18359 * src/parse-skel.y: Remove.
18360 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18361 * src/output.c (actions_output, guards_output)
18362 (token_definitions_output): No longer keeps track of the output
18363 line number, hence remove the second argument.
18364 (guards_output): Check against the guard member of a rule, not the
18365 action member.
18366 Adjust callers.
18367 (output_skeleton): Don't look for the skeleton location, let m4 do
18368 that.
18369 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18370 file will be used.
18371 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18372 (prepare): Given that for the time being changesyntax is not
18373 usable in M4, rename the muscles using `-' to `_'.
18374 Define `defines_flag', `output_parser_name' and `output_header_name'.
18375 * src/output.h (actions_output, guards_output)
18376 (token_definitions_output): Adjust prototypes.
18377 * src/scan-skel.l: Instead of scanning the skeletons, it now
18378 processes the output of m4: `__oline__' and `#output'.
18379 * data/bison.simple: Adjust to be used by M4(sugar).
18380 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18381 to date.
18382 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18383 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18384 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18385 shamelessly stolen from CVS Autoconf.
18386
beda758b
AD
183872002-02-05 Akim Demaille <akim@epita.fr>
18388
18389 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18390 * configure.in: Check for the declarations of free and malloc.
18391 * src/muscle_tab.c: Adjust.
18392
5ece6d43
AD
183932002-02-05 Akim Demaille <akim@epita.fr>
18394
18395 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18396 which have no values.
18397
5bb18f9a
AD
183982002-02-05 Akim Demaille <akim@epita.fr>
18399
18400 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18401 * data/: here.
18402
894dd62e
PE
184032002-01-29 Paul Eggert <eggert@twinsun.com>
18404
18405 * src/bison.simple (YYSIZE_T): Do not define merely because
18406 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18407 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18408
82841af7
AD
184092002-01-27 Akim Demaille <akim@epita.fr>
18410
18411 Fix `%nonassoc and eof'.
18412
18413 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18414 which were not properly copied! Replace
18415 memcpy (res->errs, src->errs, src->nerrs);
18416 with
18417 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18418 !!!
18419 * tests/regression.at (%nonassoc and eof): Adjust to newest
18420 Autotest: `.' is not in the PATH.
18421
318b76e9
AD
184222002-01-27 Akim Demaille <akim@epita.fr>
18423
18424 * tests/sets.at (AT_EXTRACT_SETS): New.
18425 (Nullable): Use it.
18426 (Firsts): New.
18427
30d2f3d5
AD
184282002-01-26 Akim Demaille <akim@epita.fr>
18429
18430 * tests/actions.at, tests/calc.at, tests/headers.at,
18431 * tests/torture.at: Adjust to the newest Autotest which no longer
18432 forces `.' in the PATH.
18433
30f8c395
AD
184342002-01-25 Akim Demaille <akim@epita.fr>
18435
18436 * tests/regression.at (%nonassoc and eof): New.
18437 Suggested by Robert Anisko.
18438
29ae55f1
AD
184392002-01-24 Akim Demaille <akim@epita.fr>
18440
18441 Bison dumps core when trying to complain about broken input files.
18442 Reported by Cris van Pelt.
18443
18444 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18445 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18446 into...
18447 (Invalid inputs): Strengthen: exercise parse_percent_token.
18448
2b548aa6
RA
184492002-01-24 Robert Anisko <robert.anisko@epita.fr>
18450
18451 * src/Makefile.am: Add bison.c++.
18452 * src/bison.c++: New skeleton.
18453
bb0146c2
AD
184542002-01-21 Paolo Bonzini <bonzini@gnu.org>
18455
18456 * po/it.po: New.
18457
bec30531
AD
184582002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18459
18460 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18461
fc6edc45
MA
184622002-01-20 Marc Autret <marc@gnu.org>
18463
18464 * src/files.c (compute_output_file_names): Fix
18465
5e5d5415
MA
184662002-01-20 Marc Autret <marc@gnu.org>
18467
18468 * tests/output.at: New test.
18469 * src/files.c (compute_base_names): Don't map extensions when
18470 the YACC flag is set, use defaults.
18471 Reported by Evgeny Stambulchik.
18472
44ea3fbd
MA
184732002-01-20 Marc Autret <marc@gnu.org>
18474
ba0fe3c7
PE
18475 * src/system.h: Need to define __attribute__ away for non-GCC
18476 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
18477 Suggested by Albert Chin-A-Young.
18478
338963d1
TVH
184792002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18480
18481 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18482 canonical definition.
18483 * src/system.h: Use the canonical definition for PARAMS (avoids
18484 a conflict with the macro from lib/hash.h).
18485
c57b2479
AD
184862002-01-11 Akim Demaille <akim@epita.fr>
18487
18488 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 18489 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 18490
b85810ae
AD
184912002-01-09 Akim Demaille <akim@epita.fr>
18492
18493 * src/files.c, src/files.h (output_infix): New.
18494 (tab_extension): Remove.
18495 (compute_base_names): Compute the former, drop the latter.
18496 * src/output.c (prepare): Insert the muscles `output-infix', and
18497 `output-suffix'.
18498 * src/parse-skel.y (string, string.1): New.
18499 (section.header): Use it.
18500 (section.yacc): Remove.
18501 (prefix): Remove too.
18502 * src/scan-skel.l: Adjust.
18503 * src/bison.simple, src/bison.hairy: Adjust.
18504
cae60122
AD
185052002-01-09 Akim Demaille <akim@epita.fr>
18506
18507 * configure.in (WERROR_CFLAGS): Compute it.
18508 * src/Makefile.am (CFLAGS): Pass it.
18509 * tests/atlocal.in (CFLAGS): Idem.
18510 * src/files.c: Fix a few warnings.
18511 (get_extension_index): Remove, unused.
18512
ae404801
AD
185132002-01-08 Akim Demaille <akim@epita.fr>
18514
18515 * src/getargs.c (AS_FILE_NAME): New.
18516 (getargs): Use it to convert DOSish file names.
18517 * src/files.c (base_name): Rename as full_base_name to avoid
18518 clashes with `base_name ()'.
18519 (filename_split): New.
18520 (compute_base_names): N-th rewrite, using filename_split.
18521
22312b71
AD
185222002-01-08 Akim Demaille <akim@epita.fr>
18523
18524 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18525 New, stolen from the Fileutils 4.1.
18526 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18527 * configure.in: Check for the presence of memrchr, and of its
18528 prototype.
18529
a67cef01
TVH
185302002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18531
18532 * lib/hash.h (__P): Added definition for this macro.
18533 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18534 BUILT_SOURCES, to ensure they are generated first.
18535 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18536 %error-verbose to allow bootstrapping with bison 1.30x.
18537
2b25d624
AD
185382002-01-06 Akim Demaille <akim@epita.fr>
18539
18540 * src/reader.c (parse_braces): Don't fetch the next char, the
18541 convention is to fetch on entry.
18542 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18543 'switch' without a following semicolon.
18544 * tests/regression.at (braces parsing): New.
18545
3460813b
AD
185462002-01-06 Akim Demaille <akim@epita.fr>
18547
18548 Bison is dead wrong in its RR conflict reports.
18549
18550 * tests/torture.at (GNU Cim Grammar): New.
18551 * src/conflicts.c (count_rr_conflicts): Fix.
18552
73784c64
AD
185532002-01-06 Akim Demaille <akim@epita.fr>
18554
18555 Creating package.m4 from configure.ac causes too many problems.
18556
18557 * tests/Makefile.am (package.m4): Create it by hand,
18558 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18559
25d81090
AD
185602002-01-06 Akim Demaille <akim@epita.fr>
18561
18562 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18563 skeleton.h.
18564
a9b8959e
PE
185652002-01-04 Paul Eggert <eggert@twinsun.com>
18566
18567 * doc/bison.texinfo (Debugging):
18568 Remove YYSTDERR; it's no longer defined or used.
18569 Also, s/cstdio.h/cstdio/.
18570
25d81090
AD
185712002-01-03 Akim Demaille <akim@epita.fr>
18572
18573 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18574
1109455c
AD
185752002-01-03 Akim Demaille <akim@epita.fr>
18576
18577 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18578 tracing code to --trace, wait for a better --trace option, with
18579 args.
18580
7ea5e977
AD
185812002-01-03 Akim Demaille <akim@epita.fr>
18582
18583 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18584 The ISO C++ standard is extremely clear about it: stderr is
18585 considered a macro, not a regular symbol (see table 94 `Header
18586 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18587 Therefore std:: does not apply to it. It still does with fprintf.
18588 Also, s/cstdio.h/cstdio/.
18589
fab5b110
AD
185902002-01-03 Akim Demaille <akim@epita.fr>
18591
18592 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18593 for non system headers.
18594
aed7fd9b
AD
185952002-01-02 Akim Demaille <akim@epita.fr>
18596
18597 Equip the skeleton chain with location tracking, runtime trace,
18598 pure parser and scanner.
18599
18600 * src/parse-skel.y: Request a pure parser, locations, and prefix
18601 renaming.
18602 (%union): Having several members with the same type does not help
18603 type mismatches, simplify.
18604 (YYPRINT, yyprint): New.
18605 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18606 (skel_error): this.
18607 Handle locations.
18608 * src/scan-skel.l: Adjust to these changes.
18609 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18610 (LOCATION_PRINT, skel_control_t): New.
18611
24fad99e
AD
186122001-12-30 Akim Demaille <akim@epita.fr>
18613
18614 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18615 replace `gb' with BLANKS.
18616 * src/scan-skel.l: Adjust.
18617
a4b36db4
AD
186182001-12-30 Akim Demaille <akim@epita.fr>
18619
18620 * src/system.h: We don't need nor want bcopy.
18621 Throw away MS-DOS crap: we don't need getpid.
18622 * configure.in: We don't need strndup. It was even causing
18623 problems: because Flex includes the headers *before* us,
18624 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18625 not visible.
18626 * lib/xstrndup.c: New.
18627 * src/scan-skel.l: Use it.
18628 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18629 * src/parse-skel.y: Use %directives instead of #defines.
18630
1239777d
AD
186312001-12-30 Akim Demaille <akim@epita.fr>
18632
18633 * src/skeleton.h: New.
18634 * src/output.c (output_parser, output_master_parser): Remove, dead
18635 code.
18636 * src/output.h (get_lines_number, actions_output, guards_output)
18637 (token_definitions_output): Prototype them.
18638 * src/parse-skel.y: Add the license notice.
18639 Include output.h and skeleton.h.
18640 (process_skeleton): Returns void, and takes a single parameter.
18641 * src/scan-skel.l: Add the license notice.
18642 Include skeleton.h.
18643 Don't use %option yylineno: it seems that then Flex imagines
18644 REJECT has been used, and therefore it won't reallocate its
18645 buffers (which makes no other sense to me than a bug). It results
18646 in warnings for `unused: yy_flex_realloc'.
18647
9b3add5b
RA
186482001-12-30 Robert Anisko <robert.anisko@epita.fr>
18649
18650 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18651 (MUSCLE_INSERT_PREFIX): ...to there.
18652 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18653 (MUSCLE_INSERT_PREFIX): Move from here...
18654
18655 * src/bison.hairy: Add a section directive. Put braces around muscle
18656 names. This parser skeleton is still broken, but Bison should not
18657 choke on a bad muscle 'syntax'.
18658 * src/bison.simple: Add a section directive. Put braces around muscle
18659 names.
18660
18661 * src/files.h (strsuffix, stringappend): Add declarations.
18662 (tab_extension): Add declaration.
18663 (short_base_name): Add declaration.
18664
18665 * src/files.c (strsuffix, stringappend): No longer static. These
18666 functions are used in the skeleton parser.
18667 (tab_extension): New.
18668 (compute_base_names): Use the computations done in this function
fab5b110 18669 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
18670 names.
18671 (short_base_name): No longer static.
18672
18673 * src/output.c (output_skeleton): New.
18674 (output): Disable call to output_master_parser, and give a try to
18675 a new skeleton handling system.
18676 (guards_output, actions_output): No longer static.
18677 (token_definitions_output, get_lines_number): No longer static.
18678
18679 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18680
fab5b110 18681 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
18682 parse-skel.y.
18683
18684 * src/parse-skel.y: New file.
18685 * src/scan-skel.l: New file.
18686
b5b61c61
AD
186872001-12-29 Akim Demaille <akim@epita.fr>
18688
18689 %name-prefix is broken.
18690
18691 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18692 Adjust all dependencies.
18693 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18694 %name-prefix.
18695
18696 Renaming yylval but not yylloc is not consistent. Now we do.
18697
18698 * src/bison.simple: Prefix yylloc if used.
18699 * doc/bison.texinfo (Decl Summary): Document that.
18700
8c9a50be
AD
187012001-12-29 Akim Demaille <akim@epita.fr>
18702
18703 * doc/bison.texinfo: Promote `%long-directive' over
18704 `%long_directive'.
18705 Remove all references to fixed-output-files, yacc is enough.
18706
d99361e6
AD
187072001-12-29 Akim Demaille <akim@epita.fr>
18708
18709 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18710 user prologue. These are defaults.
18711 * tests/actions.at (Mid-rule actions): Make sure the user can
18712 define YYDEBUG and YYERROR_VERBOSE.
18713
b9cecb91
AD
187142001-12-29 Akim Demaille <akim@epita.fr>
18715
18716 * src/output.c (header_output): Don't forget to export YYLTYPE and
18717 yylloc.
18718 * tests/headers.at (export YYLTYPE): New, make sure it does.
18719 * tests/regression.at (%union and --defines, Invalid CPP headers):
18720 Move to...
18721 * tests/headers.at: here.
18722
aea13e97
AD
187232001-12-29 Akim Demaille <akim@epita.fr>
18724
18725 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18726
931394cb
AD
187272001-12-29 Akim Demaille <akim@epita.fr>
18728
18729 * tests/actions.at (Mid-rule actions): Output on a single line
18730 instead of several.
18731
704a47c4
AD
187322001-12-29 Akim Demaille <akim@epita.fr>
18733
18734 * doc/bison.texinfo: Formatting changes.
18735
091e20bb
AD
187362001-12-29 Akim Demaille <akim@epita.fr>
18737
18738 Don't store the token defs in a muscle, just be ready to output it
18739 on command. Now possible via `symbols'. Fixes a memory leak.
18740
18741 * src/output.c (token_definitions_output): New.
18742 (output_parser, header_output): Use it.
18743 * src/reader.c (symbols_save): Remove.
18744
cce71710
AD
187452001-12-29 Akim Demaille <akim@epita.fr>
18746
18747 * src/bison.simple: Do not provide a default for YYSTYPE and
18748 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18749 default.
18750
82c035a8
AD
187512001-12-29 Akim Demaille <akim@epita.fr>
18752
18753 Mid-rule actions are simply... ignored!
18754
18755 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18756 the empty-rule associated to the dummy symbol, not to the host
18757 rule.
18758 * tests/actions.at (Mid-rule actions): New.
18759
8419d367
AD
187602001-12-29 Akim Demaille <akim@epita.fr>
18761
18762 Memory leak.
18763
18764 * src/reader.c (reader): Free grammar.
18765
375d5806
AD
187662001-12-29 Akim Demaille <akim@epita.fr>
18767
18768 Memory leak.
18769
18770 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18771 since it allocates it for each state, although only one is needed.
18772 (allocate_storage): Do it here.
18773
f51cb8ff
AD
187742001-12-29 Akim Demaille <akim@epita.fr>
18775
18776 * src/options.h, src/options.c (create_long_option_table): Rename
18777 as...
18778 (long_option_table_new): this, with a clearer prototype.
18779 (percent_table): Remove, unused,
18780 * src/getargs.c (getargs): Adjust.
18781
29e88316
AD
187822001-12-29 Akim Demaille <akim@epita.fr>
18783
18784 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18785 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18786 as states.
18787
b9f71f19
AD
187882001-12-29 Akim Demaille <akim@epita.fr>
18789
18790 * src/lalr.c (build_relations): Rename `states' as `states1'.
18791 Sorry, I don't understand exactly what it is, no better name...
18792
1a2b5d37
AD
187932001-12-29 Akim Demaille <akim@epita.fr>
18794
18795 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18796 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18797 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18798 as rules.
18799
1cca533e
AD
188002001-12-29 Akim Demaille <akim@epita.fr>
18801
18802 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18803 ago.
18804
c03ae966
AD
188052001-12-29 Akim Demaille <akim@epita.fr>
18806
18807 * src/reader.c, src/reader.h (user_toknums): Remove.
18808 Adjust all users to use symbols[i]->user_token_number.
18809
5a670b1e
AD
188102001-12-29 Akim Demaille <akim@epita.fr>
18811
18812 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18813 Adjust all users to use symbols[i]->prec or ->assoc.
18814
ad949da9
AD
188152001-12-29 Akim Demaille <akim@epita.fr>
18816
18817 * src/reader.c, src/reader.h (tags): Remove.
18818 Adjust all users to use symbols[i]->tag.
18819
0e78e603
AD
188202001-12-29 Akim Demaille <akim@epita.fr>
18821
18822 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18823 and rule_table.
18824 * src/reader.c (packsymbols): Fill this table.
18825 Drop sprec.
18826 * src/conflicts.c (resolve_sr_conflict): Adjust.
18827 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18828 single table.
18829 Use symbols[i]->tag instead of tags[i].
18830
213e640e
AD
188312001-12-29 Akim Demaille <akim@epita.fr>
18832
18833 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18834 In addition, put a comment in there, to replace...
18835 * tests/regression.at (%union and C comments): Remove.
18836
e7b8bef1
AD
188372001-12-29 Akim Demaille <akim@epita.fr>
18838
18839 * tests/regression.at (Web2c Actions): Blindly move the actual
18840 output as expected output. The contents *seem* right to me, but I
18841 can't pretend reading perfectly parser tables... Nonetheless, all
18842 the other tests pass correctly, the table look OK, even though the
18843 presence of `$axiom' is to be noted: AFAICS it is useless (but
18844 harmless).
18845
b68e7744
AD
188462001-12-29 Akim Demaille <akim@epita.fr>
18847
18848 * src/reader.c (readgram): Don't add the rule 0 if there were no
18849 rules read. In other words, add it _after_ having performed
18850 grammar sanity checks.
18851 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18852
78d5bae9
AD
188532001-12-29 Akim Demaille <akim@epita.fr>
18854
18855 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18856 visible, and some states have now a different number.
18857
ff442794
AD
188582001-12-29 Akim Demaille <akim@epita.fr>
18859
18860 * src/reader.c (readgram): Bind the initial rule's lineno to that
18861 of the first rule.
18862 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18863 (Solved SR Conflicts): Adjust rule 0's line number.
18864
610ab194
AD
188652001-12-29 Akim Demaille <akim@epita.fr>
18866
18867 Fix the `GAWK Grammar' failure.
18868
18869 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18870 the reductions of the first state which was mistakenly confused
18871 with the final state because precisely final_state was initialized
18872 to 0.
18873 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18874 now noticed by Bison.
18875 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18876 have a reduction on $default.
18877
29d29c8f
AD
188782001-12-29 Akim Demaille <akim@epita.fr>
18879
18880 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18881 rule line numbers.
18882 * src/closure.c (print_closure): Likewise.
18883 * src/derives.c (print_derives): Likewise.
18884 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18885 now.
18886
7c6b64d0
AD
188872001-12-29 Akim Demaille <akim@epita.fr>
18888
18889 * src/lalr.c (lookaheads_print): New.
18890 (lalr): Call it when --trace-flag.
18891 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18892 are dumped.
18893
3d4daee3
AD
188942001-12-29 Akim Demaille <akim@epita.fr>
18895
18896 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18897 when walking through ritem, even via rule->rhs.
18898 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18899 (useful_production, useless_nonterminals): Likewise.
18900 (reduce_grammar_tables): Likewise, plus update nritems.
18901 * src/nullable.c (set_nullable): Likewise.
18902 * src/lalr.c (build_relations): Likewise.
18903 * tests/sets.at (Nullable): Adjust.
18904 Fortunately, now, the $axiom is no longer nullable.
18905
9e7f6bbd
AD
189062001-12-29 Akim Demaille <akim@epita.fr>
18907
18908 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18909 the 0-sentinel.
18910 * src/gram.c (ritem_longest_rhs): Likewise.
18911 * src/reduce.c (nonterminals_reduce): Likewise.
18912 * src/print_graph.c (print_graph): Likewise.
18913 * src/output.c (output_rule_data): Likewise.
18914 * src/nullable.c (set_nullable): Likewise.
18915
255ef638
AD
189162001-12-29 Akim Demaille <akim@epita.fr>
18917
18918 * src/output.c: Comment changes.
18919
0d8a7363
AD
189202001-12-27 Paul Eggert <eggert@twinsun.com>
18921
18922 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18923 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18924 Sparc, as they were causing more porting problems than the
18925 (minor) performance improvement was worth.
18926
18927 Also, catch up with 1.31's YYSTD.
18928
3db472b9
AD
189292001-12-27 Akim Demaille <akim@epita.fr>
18930
18931 * src/output.c (output_gram): Rely on nritems, not the
18932 0-sentinel. See below.
18933 Use -1 as separator, not 0.
18934 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18935 Rely on -1 as separator in yyrhs, instead of 0.
18936 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18937 twice `Now at end of input', therefore there are two lines less to
18938 expect.
18939
b365aa05
AD
189402001-12-27 Akim Demaille <akim@epita.fr>
18941
18942 * tests/regression.at (Unresolved SR Conflicts):
18943 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18944 below.
18945
30171f79
AD
189462001-12-27 Akim Demaille <akim@epita.fr>
18947
18948 * src/LR0.c (new_state): Recognize the final state by the fact it
18949 is reached by eoftoken.
18950 (insert_start_shifting_state, insert_eof_shifting_state)
18951 (insert_accepting_state, augment_automaton): Remove, since now
18952 these states are automatically computed from the initial state.
18953 (generate_states): Adjust.
18954 * src/print.c: When reporting a rule number to the user, substract
18955 1, so that the axiom rule is rule 0, and the first user rule is 1.
18956 * src/reduce.c: Likewise.
18957 * src/print_graph.c (print_core): For the time being, just as for
18958 the report, depend upon --trace-flags to dump the full set of
18959 items.
18960 * src/reader.c (readgram): Once the grammar read, insert the rule
18961 0: `$axiom: START-SYMBOL $'.
18962 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18963 number of the states has changed (the final state is no longer
18964 necessarily the last), catch up.
18965
75142d45
AD
189662001-12-27 Akim Demaille <akim@epita.fr>
18967
18968 Try to make the use of the eoftoken valid. Given that its value
18969 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18970 is used instead of > 0 where appropriate, (ii), depend upon nritems
18971 instead of the 0-sentinel.
18972
18973 * src/gram.h, src/gram.c (nritems): New.
18974 Expected to be duplication of nitems, but for the time being...
18975 * src/reader.c (packgram): Assert nritems and nitems are equal.
18976 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18977 * src/closure.c (print_closure, print_fderives): Likewise.
18978 * src/gram.c (ritem_print): Likewise.
18979 * src/print.c (print_core, print_grammar): Likewise.
18980 * src/print_graph.c: Likewise.
18981
b7c49edf
AD
189822001-12-27 Akim Demaille <akim@epita.fr>
18983
18984 * src/main.c (main): If there are complains after grammar
18985 reductions, then output the report anyway if requested, then die.
18986 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18987 * src/reader.c (eoftoken): New.
18988 (parse_token_decl): If the token being defined has value `0', it
18989 is the eoftoken.
18990 (packsymbols): No longer hack `tags' to insert `$' by hand.
18991 Be sure to preserve the value of the eoftoken.
18992 (reader): Make sure eoftoken is defined.
18993 Initialize nsyms to 0: now eoftoken is created just like the others.
18994 * src/print.c (print_grammar): Don't special case the eof token.
18995 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18996 lie anyway, albeit pleasant.
18997 * tests/calc.at: Exercise error messages with eoftoken.
18998 Change the grammar so that empty input is invalid.
18999 Adjust expectations.
19000 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19001
ec2da99f
AD
190022001-12-27 Akim Demaille <akim@epita.fr>
19003
19004 * configure.in: Check the protos of strchr ans strspn.
19005 Replace strchr if needed.
19006 * src/system.h: Provide the protos of strchr, strspn and memchr if
19007 missing.
19008 * lib/strchr.c: New.
19009 * src/reader.c (symbols_save): Use strchr.
19010
8adfa272
AD
190112001-12-27 Akim Demaille <akim@epita.fr>
19012
19013 * src/print.c, src/print_graph.c (escape): New.
19014 Use it to quote the TAGS outputs.
19015 * src/print_graph.c (print_state): Now errors are in red, and
19016 reductions in green.
19017 Prefer high to wide: output the state number on a line of its own.
19018
80dac38c
AD
190192001-12-27 Akim Demaille <akim@epita.fr>
19020
19021 * src/state.h, src/state.c (reductions_new): New.
19022 * src/LR0.c (set_state_table): Let all the states have a
19023 `reductions', even if reduced to 0.
19024 (save_reductions): Adjust.
19025 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19026 * src/print.c (print_reductions, print_actions): Adjust.
19027 * src/output.c (action_row): Adjust.
19028
2cec70b9
AD
190292001-12-27 Akim Demaille <akim@epita.fr>
19030
19031 * src/state.h, src/state.c (errs_new, errs_dup): New.
19032 * src/LR0.c (set_state_table): Let all the states have an errs,
19033 even if reduced to 0.
19034 * src/print.c (print_errs, print_reductions): Adjust.
19035 * src/output.c (output_actions, action_row): Adjust.
19036 * src/conflicts.c (resolve_sr_conflict): Adjust.
19037
13ca549a
AD
190382001-12-27 Akim Demaille <akim@epita.fr>
19039
19040 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19041
5092aba5
AD
190422001-12-27 Akim Demaille <akim@epita.fr>
19043
19044 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19045 * src/print.c: here.
19046 (lookaheadset, shiftset): New, used as additional storage by
19047 print_reductions.
19048 (print_results): Adjust.
19049 (print_shifts, print_gotos, print_errs): New, extracted from...
19050 (print_actions): here.
19051 * src/print_graph.c (print_actions): Remove dead code.
19052
11e2beca
AD
190532001-12-27 Akim Demaille <akim@epita.fr>
19054
19055 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19056 `$n' and `@n'.
19057
dac3c910
AD
190582001-12-27 Akim Demaille <akim@epita.fr>
19059
19060 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19061 (build_relations): Adjust.
19062
d0b0fefa
AD
190632001-12-27 Akim Demaille <akim@epita.fr>
19064
19065 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19066 duplication.
19067
adc8c848
AD
190682001-12-27 Akim Demaille <akim@epita.fr>
19069
19070 * src/reader.c (packgram): Catch nitems overflows.
19071
14d293ac
AD
190722001-12-27 Akim Demaille <akim@epita.fr>
19073
19074 * src/files.c, src/files.h (guard_obstack): Remove.
19075 * src/output.c (output): Adjust.
19076 * src/reader.c (parse_braces): New, factoring...
19077 (copy_action, copy_guard): these two which are renamed as...
19078 (parse_action, parse_guard): these.
19079 As a voluntary consequence, using braces around guards is now
19080 mandatory.
19081
f499b062
AD
190822001-12-27 Akim Demaille <akim@epita.fr>
19083
19084 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19085 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19086 members.
19087 (symbol_list_new): Adjust.
19088 (copy_action): action_line is the first line, not the last.
19089 (copy_guard): Just as for actions, store the `action' only, not
19090 the switch/case/break flesh.
19091 Don't parse the user action that might follow the guard, let...
19092 (readgram): do it, i.e., now, there can be an action after a
19093 guard.
19094 In other words the guard is just explicitly optional.
19095 (packgram): Adjust.
19096 * src/output.c (guards_output): New.
19097 (output_parser): Call it when needed.
19098 (output): Also free the guard and attrs obstacks.
19099 * src/files.c, src/files.h (obstack_save): Remove.
19100 (output_files): Remove.
19101 As a result, if one needs the former `.act' file, using an
19102 appropriate skeleton which requires actions and guards is now
19103 required.
19104 * src/main.c (main): Adjust.
19105 * tests/semantic.at: New.
19106 * tests/regression.at: Use `input.y' as input file name.
19107 Avoid 8+3 problems by requiring input.c when the test needs the
19108 parser.
19109
d945f5cd
AD
191102001-12-27 Akim Demaille <akim@epita.fr>
19111
19112 * src/reader.c (symbol_list_new): Be sure to initialize all the
19113 fields.
19114
d200e455
AD
191152001-12-27 Akim Demaille <akim@epita.fr>
19116
19117 All the hacks using a final pseudo state are now useless.
19118
19119 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19120 * src/lalr.c (nLA): New.
19121 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19122 instead of lookaheadsp from the pseudo state (nstate + 1).
19123
f9507c28
AD
191242001-12-27 Akim Demaille <akim@epita.fr>
19125
19126 * src/output.c (action_row, token_actions): Use a state_t instead
19127 of a integer, and nlookaheads instead of the following state's
19128 lookaheadsp.
19129
065fbd27
AD
191302001-12-27 Akim Demaille <akim@epita.fr>
19131
19132 * src/conflicts.c (log_resolution, flush_shift)
19133 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19134 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19135 (conflicts_print, print_reductions): Use a state_t instead of an
19136 integer when referring to a state.
19137 As much as possible, depend upon nlookaheads, instead of the
19138 `lookaheadsp' member of the following state (since lookaheads of
19139 successive states are successive, the difference between state n + 1
19140 and n served as the number of lookaheads for state n).
19141 * src/lalr.c (add_lookback_edge): Likewise.
19142 * src/print.c (print_core, print_actions, print_state)
19143 (print_results): Likewise.
19144 * src/print_graph.c (print_core, print_actions, print_state)
19145 (print_graph): Likewise.
19146 * src/conflicts.h: Adjust.
19147
1b177bd7
AD
191482001-12-27 Akim Demaille <akim@epita.fr>
19149
19150 * src/bison.hairy: Formatting/comment changes.
19151 ANSIfy.
19152 Remove `register' indications.
19153 Add plenty of `static'.
19154
7742ddeb
AD
191552001-12-27 Akim Demaille <akim@epita.fr>
19156
19157 * src/output.c (prepare): Drop the muscle `ntbase' which
19158 duplicates ntokens.
19159 * src/bison.simple: Formatting/comment changes.
19160 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19161 is an undocumented synonym.
19162
1fa14068
AD
191632001-12-22 Akim Demaille <akim@epita.fr>
19164
19165 * src/output.c (output_table_data): Change the prototype to use
19166 `int' for array ranges: some invocations do pass an int, not a
19167 short.
19168 Reported by Wayne Green.
19169
b9752825
AD
191702001-12-22 Akim Demaille <akim@epita.fr>
19171
19172 Some actions of web2c.y are improperly triggered.
19173 Reported by Mike Castle.
19174
19175 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19176 * tests/regression.at (Web2c): Rename as...
19177 (Web2c Report): this.
19178 (Web2c Actions): New.
19179
776209d6
AD
191802001-12-22 Akim Demaille <akim@epita.fr>
19181
19182 Reductions in web2c.y are improperly reported.
19183 Reported by Mike Castle.
19184
19185 * src/conflicts.c (print_reductions): Fix.
19186 * tests/regression.at (Web2c): New.
19187
275fc3ad
AD
191882001-12-18 Akim Demaille <akim@epita.fr>
19189
19190 Some host fail on `assert (!"foo")', which expands to
19191 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19192 Reported by Nelson Beebee.
19193
19194 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19195 `#define it_succeeded 0' and `assert (it_succeeded)'.
19196
897668ee
MA
191972001-12-17 Marc Autret <autret_m@epita.fr>
19198
19199 * src/bison.simple: Don't hard code the skeleton line and filename.
19200 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19201 New line counter 'skeleton_line' (skeleton-line muscle).
19202
ab3399e0
PE
192032001-12-17 Paul Eggert <eggert@twinsun.com>
19204
19205 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19206 YYDEBUG must be defined to a nonzero value.
19207
19208 * src/bison.simple (yytname): Do not assume that the user defines
19209 YYDEBUG to a properly parenthesized expression.
19210
3877f72b
AD
192112001-12-17 Akim Demaille <akim@epita.fr>
19212
19213 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19214 nlookaheads is a new member.
19215 Adjust all users.
19216 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19217 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19218 state.
776209d6 19219
331dbc1b
AD
192202001-12-17 Akim Demaille <akim@epita.fr>
19221
19222 * src/files.h, src/files.c (open_files, close_files): Remove.
19223 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19224 let...
19225 * src/reader.c (reader): Do it.
776209d6 19226
be750e4c
AD
192272001-12-17 Akim Demaille <akim@epita.fr>
19228
19229 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19230
709ae8c6
AD
192312001-12-17 Akim Demaille <akim@epita.fr>
19232
19233 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19234 (flush_reduce): New.
19235 (resolve_sr_conflict): Adjust.
776209d6 19236
f87685c3
AD
192372001-12-17 Akim Demaille <akim@epita.fr>
19238
19239 * src/output.c (output_obstack): Be static and rename as...
19240 (format_obstack): this, to avoid any confusion with files.c's
19241 output_obstack.
19242 * src/reader.h (muscle_obstack): Move to...
19243 * src/output.h: here, since it's defined in output.c.
19244
837491d8
AD
192452001-12-17 Akim Demaille <akim@epita.fr>
19246
19247 * src/output.c (action_row, save_column, default_goto)
19248 (sort_actions, matching_state, pack_vector): Better variable
19249 locality.
19250
796d61fb
AD
192512001-12-17 Akim Demaille <akim@epita.fr>
19252
19253 * src/output.c: Various formatting changes.
776209d6 19254
64d15509
AD
192552001-12-17 Akim Demaille <akim@epita.fr>
19256
19257 * src/files.c (output_files): Free the output_obstack.
19258 * src/main.c (main): Call print and print_graph conditionally.
19259 * src/print.c (print): Work unconditionally.
19260 * src/print_graph.c (print_graph): Work unconditionally.
19261 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19262
fbc8ecb7
MA
192632001-12-16 Marc Autret <autret_m@epita.fr>
19264
19265 * src/output.c (actions_output): Fix. When we use %no-lines,
19266 there is one less line per action.
19267
f0440388
MA
192682001-12-16 Marc Autret <autret_m@epita.fr>
19269
19270 * src/bison.simple: Remove a useless #line directive.
19271 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19272 * src/output.c (get_lines_number): New.
776209d6 19273 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19274 output muscles.
19275 Fix line numbering.
19276 (actions_output): Computes the number of lines taken by actions.
19277 (output_master_parser): Insert new skeleton which is the name of
19278 the output parser file name.
19279
a79986b8
MA
192802001-12-15 Marc Autret <autret_m@epita.fr>
19281
19282 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19283
4ec8e00f
MA
192842001-12-15 Marc Autret <autret_m@epita.fr>
19285
19286 * src/output.c (output_gram): Keep track of the hairy one.
19287
1a4648ff
AD
192882001-12-15 Akim Demaille <akim@epita.fr>
19289
19290 Make `make distcheck' work.
19291
19292 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19293 system.h which uses libgettext.h.
19294
9c2c67e6
AD
192952001-12-15 Akim Demaille <akim@epita.fr>
19296
19297 * src/nullable.c (set_nullable): Useless rules must be skipped,
19298 otherwise, since we range over their symbols, we might look at a
19299 nonterminal which no longer ``exists'', i.e., it is not counted in
19300 `nvars', hence we overflow our arrays.
19301
93ede233
AD
193022001-12-15 Akim Demaille <akim@epita.fr>
19303
19304 The header can also be produced directly, without any obstack!
19305 Yahoo!
19306
19307 * src/files.c, src/files.h (defines_obstack): Remove.
19308 (compute_header_macro): Global.
19309 (defines_obstack_save): Remove.
19310 * src/reader.c (parse_union_decl): No longer output to
19311 defines_obstack: its content can be found in the `stype' muscle
19312 anyway.
19313 (output_token_translations): Merge into...
19314 (symbols_output): this.
19315 Rename as...
19316 (symbols_save): this.
19317 (reader): Adjust.
19318 * src/output.c (header_output): New.
19319 (output): Call it.
19320
2666f928
AD
193212001-12-15 Akim Demaille <akim@epita.fr>
19322
19323 * src/reader.c (parse_union_decl): Instead of handling two obstack
19324 simultaneously, use one to define the `stype' muscle, and use the
19325 value of the latter to fill defines_obstack.
19326 (copy_comment): Remove.
19327 (copy_comment2): Work for a single obstack.
19328 Rename as...
19329 (copy_comment): this.
19330
428046f8
AD
193312001-12-15 Akim Demaille <akim@epita.fr>
19332
19333 * src/lex.c, src/lex.h (xgetc): No longer static.
19334 * src/reader.c (parse_union_decl): Revamp.
19335
ea52d706
AD
193362001-12-15 Akim Demaille <akim@epita.fr>
19337
19338 Still making progress in separating Bison into (i) input, (ii)
19339 process, (iii) output: now we can directly output the parser file
19340 without using table_obstack at all.
19341
19342 * src/files.c, src/files.h (table_obstack): Bye bye.
19343 (parser_file_name): New.
19344 * src/files.c (compute_output_file_names): Compute it.
19345 * src/output.c (actions_output, output_parser)
19346 (output_master_parser): To a file instead of an obstack.
19347
3f96f4dc
AD
193482001-12-15 Akim Demaille <akim@epita.fr>
19349
19350 Attach actions to rules, instead of pre-outputting them to
19351 actions_obstack.
19352
19353 * src/gram.h (rule_t): action and action_line are new members.
19354 * src/reader.c (symbol_list): Likewise.
19355 (copy_action): Save the actions within the rule.
19356 (packgram): Save them in rule_table.
19357 * src/output.c (actions_output): New.
19358 (output_parser): Use it on `%%actions'.
19359 (output_rule_data): Don't free rule_table.
19360 (output): Do it.
19361 (prepare): Don't save the `action' muscle.
19362 * src/bison.simple: s/%%action/%%actions/.
19363
51576fb3
AD
193642001-12-15 Akim Demaille <akim@epita.fr>
19365
19366 * src/reader.c (copy_action): When --yacc, don't append a `;'
19367 to the user action: let it fail if lacking.
dee049eb 19368 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 19369
2648a72d
AD
193702001-12-14 Akim Demaille <akim@epita.fr>
19371
19372 * src/lex.c (literalchar): Simply return the char you decoded, non
19373 longer mess around with obstacks and int pointers.
19374 Adjust all callers.
19375
92790e5b
AD
193762001-12-14 Akim Demaille <akim@epita.fr>
19377
19378 * src/lex.c (literalchar): Don't escape the special characters,
19379 just decode them, and keep them as char (before, eol was output as
19380 the 2 char string `\n' etc.).
19381 * src/output.c (output_rule_data): Use quotearg to output the
19382 token strings.
19383
927c1557
PE
193842001-12-13 Paul Eggert <eggert@twinsun.com>
19385
19386 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19387 Do not infringe on the global user namespace when using C++.
19388 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19389 All uses of `fprintf' and `stderr' changed.
19390
19391 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19392
ed8e1f68
AD
193932001-12-13 Akim Demaille <akim@epita.fr>
19394
19395 The computation of nullable is broken: it doesn't handle empty
19396 RHS's properly.
19397
19398 * tests/torture.at (GNU AWK Grammar): New.
19399 * tests/sets.at (Nullable): New.
19400 * src/nullable.c (set_nullable): Instead of blindly looping over
19401 `ritems', loop over the rules, and then over their rhs's.
19402
19403 Work around Autotest bugs.
19404
19405 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19406 frame, because Autotest understand lines starting with a `+' as
19407 traces from the shell. Then, they are not processed properly.
19408 Admittedly an Autotest bug, but we don't have time to wait for
19409 Autotest to catch up.
19410 * tests/regression.at (Broken Closure): Adjust to the new table
19411 frames.
19412 Move to...
19413 * tests/sets.at: here.
19414
cb581495
AD
194152001-12-13 Akim Demaille <akim@epita.fr>
19416
19417 * src/closure.c (closure): Use nrules instead of playing tricks
19418 with BITS_PER_WORD.
19419
2e729273
AD
194202001-12-13 Akim Demaille <akim@epita.fr>
19421
19422 * src/print.c (print_actions): Output the handling of `$' as the
19423 traces do: shifting the token EOF. Before EOF was treated as a
19424 nonterminal.
19425 * tests/regression.at: Adjust some tests.
19426 * src/print_graph.c (print_core): Complete the set of items via
19427 closure. The next-to-final and final states are still unsatisfying,
19428 but that's to be addressed elsewhere.
19429 No longer output the rule numbers, but do output the state number.
19430 A single loop for the shifts + gotos is enough, but picked a
19431 distinct color for each.
19432 (print_graph): Initialize and finalize closure.
19433
107f7dfb
AD
194342001-12-13 Akim Demaille <akim@epita.fr>
19435
19436 * src/reader.c (readgram): Remove dead code, an strip useless
19437 braces.
19438 (get_type): Remove, unused.
19439
9b53a24f
AD
194402001-12-12 Akim Demaille <akim@epita.fr>
19441
19442 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19443 on that of lib/error.c.
19444
dbfb6dcd
AD
194452001-12-12 Akim Demaille <akim@epita.fr>
19446
19447 Some hosts don't like `/' in includes.
19448
19449 * src/system.h: Include libgettext.h without qualifying the path.
19450 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19451 $(top_srcdir).
19452
c25fb648
MA
194532001-12-11 Marc Autret <autret_m@epita.fr>
19454
19455 * src/output.c (output_parser): Remove useless muscle.
19456
710ddc4f
MA
194572001-12-11 Marc Autret <autret_m@epita.fr>
19458
19459 * src/bison.simple: Remove #line just before %%epilogue. It
19460 is now handled in ...
19461 * src/reader.c (read_additionnal_code): Add the output of a
19462 #line for the epilogue.
19463
e83d80b8
MA
194642001-12-10 Marc Autret <autret_m@epita.fr>
19465
927c1557 19466 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
19467 replace precedent remove.
19468 * src/bison.simple: Remove #line before %%prologue because
19469 %%input-line is wrong at this time.
19470
971d5158
MA
194712001-12-10 Marc Autret <autret_m@epita.fr>
19472
19473 * src/reader.c (symbols_output): Clean up.
927c1557 19474 * src/output.c (output_gram, output): Clean up.
971d5158 19475
5edafffd
AD
194762001-12-10 Akim Demaille <akim@epita.fr>
19477
19478 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19479 * src/LR0.c (set_state_table): here.
19480 * src/lalr.c (lalr): Call it.
19481
0279f8e9
AD
194822001-12-10 Akim Demaille <akim@epita.fr>
19483
19484 * src/state.h (shifts): Remove the `number' member: shifts are
19485 attached to state, hence no longer need to be labelled with a
19486 state number.
19487
190c4f5f
AD
194882001-12-10 Akim Demaille <akim@epita.fr>
19489
19490 Now that states have a complete set of members, the linked list of
19491 shifts is useless: just fill directly the state's shifts member.
19492
19493 * src/state.h (shifts): Remove the `next' member.
19494 * src/LR0.c (first_state, last_state): Remove.
19495 Adjust the callers.
19496 (augment_automaton): Don't look for the shifts that must be added
19497 a shift on EOF: it is those of the state we looked for! But now,
19498 since shifts are attached, it is no longer needed to looking
19499 merely by its id: its number.
19500
2a73b93d
AD
195012001-12-10 Akim Demaille <akim@epita.fr>
19502
19503 * src/LR0.c (augment_automaton): Better variable locality.
19504 Remove an impossible branch: if there is a state corresponding to
19505 the start symbol being shifted, then there is shift for the start
19506 symbol from the initial state.
19507
74392f6a
AD
195082001-12-10 Akim Demaille <akim@epita.fr>
19509
19510 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19511 only when appropriate: when insert_start_shifting_state' is not
19512 invoked.
19513 * tests/regression.at (Rule Line Numbers): Adjust.
19514
37c82725
AD
195152001-12-10 Akim Demaille <akim@epita.fr>
19516
19517 * src/LR0.c (augment_automaton): Now that all states have shifts,
19518 merge the two cases addition shifts to the initial state.
19519
6a164e0c
AD
195202001-12-10 Akim Demaille <akim@epita.fr>
19521
19522 * src/lalr.c (set_state_table): Move to...
19523 * src/LR0.c: here.
19524 * src/lalr.c (lalr): Don't call it...
19525 * src/LR0.c (generate_states): do it.
19526 * src/LR0.h (first_state): Remove, only the table is used.
19527
7215de24
AD
195282001-12-10 Akim Demaille <akim@epita.fr>
19529
19530 * src/LR0.h (first_shift, first_reduction): Remove.
19531 * src/lalr.c: Don't use first_shift: find shifts through the
19532 states.
19533
80e25d4d
AD
195342001-12-10 Akim Demaille <akim@epita.fr>
19535
19536 * src/LR0.c: Attach shifts to states as soon as they are
19537 computed.
19538 * src/lalr.c (set_state_table): Instead of assigning shifts to
19539 state, just assert that the mapping was properly done.
19540
0ab3728b
AD
195412001-12-10 Akim Demaille <akim@epita.fr>
19542
19543 * src/LR0.c (insert_start_shift): Rename as...
19544 (insert_start_shifting_state): this.
19545 (insert_eof_shifting_state, insert_accepting_state): New.
19546 (augment_automaton): Adjust.
19547 Better locality of the variables.
19548 When looking if the start_symbol is shifted from the initial
19549 state, using `while (... symbol != start_symbol ...)' sounds
19550 better than `while (... symbol < start_symbol ...)': If fail
19551 to see how the order between symbols could be relevant!
19552
78af9bbc
AD
195532001-12-10 Akim Demaille <akim@epita.fr>
19554
19555 * src/getargs.h: Don't declare `spec_name_prefix' and
19556 `spec_file_prefix', declared by src/files.h.
19557 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19558 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19559 * src/output.c (prepare): Adjust.
19560 * src/reader.c (symbols_output): Likewise.
19561 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19562
bdef2a41
AD
195632001-12-10 Akim Demaille <akim@epita.fr>
19564
19565 * src/muscle_tab.c (muscle_init): NULL is a better default than
19566 `"0"'.
19567
3735969c
AD
195682001-12-10 Akim Demaille <akim@epita.fr>
19569
19570 * src/reader.c (reader): Calling symbols_output once is enough.
19571
49701457
AD
195722001-12-10 Akim Demaille <akim@epita.fr>
19573
19574 Now that states have a complete set of members, the linked list of
19575 reductions is useless: just fill directly the state's reductions
19576 member.
19577
19578 * src/state.h (struct reductions): Remove member `number' and
19579 `next'.
19580 * src/LR0.c (first_reduction, last_reduction): Remove.
19581 (save_reductions): Don't link the new reductions, store them in
19582 this_state.
19583 * src/lalr.c (set_state_table): No need to attach reductions to
19584 states, it's already done.
19585 * src/output.c (output_actions): No longer free the shifts, then
19586 the reductions, then the states: free all the states and their
19587 members.
19588
0edad749
AD
195892001-12-10 Akim Demaille <akim@epita.fr>
19590
19591 * src/options.c (OPTN, DRTV, BOTH): New.
19592 (option_table): Use them.
19593
0edad749
AD
19594 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19595 the job of system.h.
19596 * src/options.c: Don't include stdio.h and xalloc.h for the same
19597 reasons.
19598
5449dd0f
AD
195992001-12-10 Akim Demaille <akim@epita.fr>
19600
19601 * src/output.c (output, prepare): Make sure the values of the
19602 muscles `action' and `prologue' are 0-terminated.
19603
a870c567
AD
196042001-12-10 Akim Demaille <akim@epita.fr>
19605
19606 Clean up GCC warnings.
19607
19608 * src/reader.c (copy_action): `buf' is not used.
19609 (parse_skel_decl): Be static.
19610 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19611 * src/options.h (create_long_option_table): Have a real prototype.
19612 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19613 (hash_delete_at): Return const void *.
19614 Adjust casts to preserve the const.
19615
80df8768
AD
196162001-12-10 Akim Demaille <akim@epita.fr>
19617
19618 * configure.in: Require 2.52g.
19619 M4 is not needed, but AUTOM4TE is.
19620 * m4/m4.m4: Remove.
19621 * tests/Makefile.am: Adjust.
19622
f693ad14
AD
196232001-12-10 Akim Demaille <akim@epita.fr>
19624
19625 One structure for states is enough, even though theoretically
19626 there are LR(0) states and LALR(1) states.
19627
19628 * src/lalr.h (state_t): Remove.
19629 (state_table): Be state_t **, not state_t *.
19630 * src/state.h (core, CORE_ALLOC): Rename as...
19631 (state_t, STATE_ALLOC): this.
19632 Add the LALR(1) members: shifts, reductions, errs.
19633 * src/LR0.c (state_table): Rename as...
19634 (state_hash): this, to avoid name clashes with the global
19635 `state_table'.
19636 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19637 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19638
74ffbcb6
AD
196392001-12-10 Akim Demaille <akim@epita.fr>
19640
19641 Bison dumps core on bash.y.
19642 Reported by Pascal Bart.
19643
19644 * src/warshall.c (bitmatrix_print): New.
19645 (TC): Use it.
ba0fe3c7 19646 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
19647 j must be the outer loop.
19648 * tests/regression.at (Broken Closure): New.
19649
07708e19
AD
196502001-12-05 Akim Demaille <akim@epita.fr>
19651
19652 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19653 its argument.
ba1ecc07 19654 Reported by Peter Hamorsky.
07708e19 19655
92b16366
AD
196562001-12-05 Akim Demaille <akim@epita.fr>
19657
19658 * src/conflicts.c (err_table): Remove.
19659 (resolve_sr_conflict): Adjust.
19660 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19661 Rename as...
19662 (state_t.reductions, state_t.shifts): this.
19663
076ab033
AD
196642001-12-05 Akim Demaille <akim@epita.fr>
19665
19666 * src/reduce.c (reduce_grammar_tables): No longer disable the
19667 removal of useless rules via CPP but via `if (0)', so that the
19668 compiler still check the code is valid.
19669 For instance, it should have noticed `rline' no longer exists: use
19670 the `line' member of rule_t.
19671 * src/gram.c (dummy, rline): Remove, unused.
19672
3843c413
AD
196732001-12-05 Akim Demaille <akim@epita.fr>
19674
19675 * src/output.c (pack_vector): Use assert, not berror.
19676 * src/main.c (berror): Remove, unused.
19677
43168960
AD
196782001-12-05 Akim Demaille <akim@epita.fr>
19679
19680 New experimental feature: if --verbose --trace output all the
19681 items of a state, not only its kernel.
19682
19683 * src/print.c (print_core): If `trace_flag', then invoke closure
19684 before outputting the items of the state (print_core is no longer
19685 a correct name them).
19686 (print_results): Invoke new_closure/free_closure if needed.
19687
b2872512
AD
196882001-12-05 Akim Demaille <akim@epita.fr>
19689
19690 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19691 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19692 (nitemset): for consistency with the rest of the project.
19693
23cbcc6c
AD
196942001-12-05 Akim Demaille <akim@epita.fr>
19695
19696 * src/closure.c (print_closure): Improve.
19697 (closure): Use it for printing input and output.
19698
03ec521c
AD
196992001-12-05 Akim Demaille <akim@epita.fr>
19700
19701 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19702 indexed by nonterminals.
19703
3a7456dd
AD
197042001-12-05 Akim Demaille <akim@epita.fr>
19705
19706 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19707 what it was!).
19708 * src/warshall.h: Remove accidental duplication of the content.
19709
1cbcf2e7
AD
197102001-12-05 Akim Demaille <akim@epita.fr>
19711
19712 * src/closure.c (set_fderives): De-obfuscate.
19713
84182270
AD
197142001-12-05 Akim Demaille <akim@epita.fr>
19715
19716 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19717
3f6f053c
AD
197182001-12-05 Akim Demaille <akim@epita.fr>
19719
19720 * src/closure.c (set_firsts): De-obfuscate.
19721
7a5350ba
AD
197222001-12-05 Akim Demaille <akim@epita.fr>
19723
19724 * src/output.c (action_row): De-obfuscate
19725 using the good o' techniques: arrays not pointers, variable
19726 locality, BITISSET, RESETBIT etc.
19727
d954473d
AD
197282001-12-05 Akim Demaille <akim@epita.fr>
19729
19730 Pessimize the code to simplify it: from now on, all the states
19731 have a valid SHIFTS, which NSHIFTS is possibly 0.
19732
19733 * src/LR0.c (shifts_new): Be global and move to..
19734 * src/state.c, src/state.h: here.
19735 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19736 * src/print_graph: Adjust.
19737
9839bbe5
AD
197382001-12-05 Akim Demaille <akim@epita.fr>
19739
19740 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19741 * src/conflicts.c: Use it.
19742 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19743 incorrectly ``simplified''.
19744
9f136c07
AD
197452001-12-05 Akim Demaille <akim@epita.fr>
19746
19747 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19748 using the good o' techniques: arrays not pointers, variable
19749 locality, BITISSET, RESETBIT etc.
19750
b608206e
AD
197512001-12-05 Akim Demaille <akim@epita.fr>
19752
19753 * src/state.h (SHIFT_SYMBOL): New.
19754 * src/conflicts.c: Use it to deobfuscate.
19755
52afa962
AD
197562001-12-05 Akim Demaille <akim@epita.fr>
19757
19758 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19759 (print_reductions): De-obfuscate using the good o' techniques:
19760 arrays not pointers, variable locality, BITISSET.
19761
e74dc321
AD
197622001-12-05 Akim Demaille <akim@epita.fr>
19763
19764 * src/conflicts.c (print_reductions): Arrays, not pointers.
19765 Use BITISSET.
19766
768fca83
AD
197672001-12-05 Akim Demaille <akim@epita.fr>
19768
19769 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19770
a17e599f
AD
197712001-12-05 Akim Demaille <akim@epita.fr>
19772
19773 * src/conflicts.c (print_reductions): Improve variable locality.
19774
a04bc341
AD
197752001-12-05 Akim Demaille <akim@epita.fr>
19776
19777 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19778
c8ea038e
AD
197792001-12-05 Akim Demaille <akim@epita.fr>
19780
19781 * src/conflicts.c (print_reductions): Improve variable locality.
19782
aa2aab3c
AD
197832001-12-05 Akim Demaille <akim@epita.fr>
19784
19785 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19786 * src/lalr.c: Use them.
19787
b178c8cc
AD
197882001-12-05 Akim Demaille <akim@epita.fr>
19789
19790 * src/LR0.c (augment_automaton): Formatting changes.
19791 Better variable locality.
19792
f67d13aa
AD
197932001-12-05 Akim Demaille <akim@epita.fr>
19794
19795 * src/lalr.c (matrix_print): New.
19796 (transpose): Use it.
19797 Use arrays instead of pointers.
19798
c2713865
AD
197992001-12-05 Akim Demaille <akim@epita.fr>
19800
19801 * src/lalr.c (maxrhs): Move to...
19802 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19803 * src/lalr.c (build_relations): Adjust.
19804
9887c18a
AD
198052001-12-05 Akim Demaille <akim@epita.fr>
19806
19807 * src/lalr.c (transpose): Free the memory allocated to the
19808 argument, as it is replaced by the results by the unique caller.
19809 (build_relations): Merely invoke transpose: it handles the memory
19810 deallocation.
19811 Improve variable locality.
19812 Avoid variables used as mere abbreviations.
19813 (compute_lookaheads): Use arrays instead of pointers.
19814
4d4f699c
AD
198152001-12-05 Akim Demaille <akim@epita.fr>
19816
19817 * src/lalr.c (initialize_F): Improve variable locality.
19818 Avoid variables used as mere abbreviations.
19819
80a69750
AD
198202001-12-05 Akim Demaille <akim@epita.fr>
19821
19822 * src/derives.c (print_derives): Display the ruleno.
19823 * src/lalr.c (initialize_F, transpose): Better variable locality
19824 to improve readability.
19825 Avoid variables used as mere abbreviations.
19826
fe961097
AD
198272001-12-05 Akim Demaille <akim@epita.fr>
19828
19829 * src/lalr.c (traverse): Use arrays instead of pointers.
19830
e3e4e814
AD
198312001-12-05 Akim Demaille <akim@epita.fr>
19832
19833 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19834 the handling of squeue.
19835 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19836
630e182b
AD
198372001-12-05 Akim Demaille <akim@epita.fr>
19838
19839 Because useless nonterminals are now kept alive (instead of being
19840 `destroyed'), we now sometimes examine them, and store information
19841 related to them. Hence we need to know their number, and adjust
19842 memory allocations.
19843
19844 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19845 static.
19846 * src/LR0.c (allocate_itemsets): The memory allocated to
19847 `symbol_count' was used for two different purpose: once to count
19848 the number of occurrences of each symbol, and later reassigned to
19849 `shift_symbol', containing the symbol that can be shifted from a
19850 given state.
19851 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19852 only, and...
19853 (new_itemsets): Allocate `shift_symbol' here.
19854 (allocate_itemsets): symbol_count includes useless nonterminals.
19855 Make room for them.
19856 (free_storage): Use `free', not `XFREE', for pointers that cannot
19857 be null.
19858
81b51460
AD
198592001-12-05 Akim Demaille <akim@epita.fr>
19860
19861 * src/nullable.c (set_nullable): Deobfuscate the handling of
19862 ritem.
19863 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19864
3067fbef
AD
198652001-12-05 Akim Demaille <akim@epita.fr>
19866
19867 * src/gram.c, src/gram.h (ritem_print): New.
19868 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19869 (This useless function was defined only to work around VMS linkers
19870 that can't handle compilation units with variables only).
19871 * src/reduce.c (dump_grammar): Use it to trace the construction of
19872 ritem.
19873
c2bea5f9
PE
198742001-12-04 Paul Eggert <eggert@twinsun.com>
19875
7d27c823
PE
19876 * src/bison.simple (union yyalloc): Change member names
19877 to be the same as the stack names.
19878 (yyparse): yyptr is now union yyalloc *, not char *.
19879 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19880 and may generate better code on some machines.
c2bea5f9
PE
19881 (yystpcpy): Use prototype if __STDC__ is defined, not just
19882 if __cplusplus is defined.
35687a9d 19883
2c8a9dfa
AD
198842001-11-30 Akim Demaille <akim@epita.fr>
19885
19886 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19887 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19888 Gettext doesn't compile cleanly, and dies with -Werror.
19889 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19890 Include WARNING_CFLAGS here.
19891 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19892 before being defined.
19893
f4e421e6
AD
198942001-11-27 Paul Eggert <eggert@twinsun.com>
19895
19896 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19897 First arg is int, not unsigned.
19898 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19899 (SIZE_MAX, UINT_MAX): New macros.
19900 (quotearg_n_options): Abort if N is negative.
19901 Avoid overflow check on hosts where size_t is 64 bits and int
19902 is 32 bits, as overflow is impossible there.
19903 Fix off-by-one typo that caused unnecessary reallocation.
19904
7093d0f5
AD
199052001-11-29 Paul Eggert <eggert@twinsun.com>
19906
19907 Name space cleanup in generated parser.
19908
19909 * doc/bison.texinfo (Bison Parser): Discuss system headers
19910 and their effect on the user name space.
19911
19912 * src/bison.simple:
19913 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19914 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19915 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19916
19917 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19918 on user names when possible.
19919
19920 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19921 Simplify test for whather <alloca.h> exists.
19922
19923 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19924
19925 (<stdio.h>): Include if YYDEBUG.
19926
19927 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19928 ! defined (yyoverflow) && ! defined (yymemcpy).
19929
19930 (yymemcpy, yyparse): Rename local variables as needed so that
19931 they all begin with 'yy'.
19932
19933 (yystrlen, yystpcpy): New functions.
19934
19935 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19936 All uses changed.
19937
19938 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19939 instead of relying on string.h functions. Use YYSTACK_ALLOC
19940 and YYSTACK_FREE instead of malloc and free.
19941
fd51e5ff
AD
199422001-11-30 Akim Demaille <akim@epita.fr>
19943
19944 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19945 before their first uses.
19946 (YYBISON, YYPURE): Move to the top of the output.
19947
7d13ff5f
AD
199482001-11-30 Akim Demaille <akim@epita.fr>
19949
19950 * tests/reduce.at (Useless Nonterminals): Fix.
19951
892a3995
AD
199522001-11-30 Akim Demaille <akim@epita.fr>
19953
19954 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19955 if body instead of `;' to pacify GCC's warnings.
19956
68f1e3ed
AD
199572001-11-30 Akim Demaille <akim@epita.fr>
19958
19959 Instead of mapping the LHS of unused rules to -1, keep the LHS
19960 valid, but flag the rules as invalid.
19961
19962 * src/gram.h (rule_t): `useful' is a new member.
19963 * src/print.c (print_grammar): Adjust.
19964 * src/derives.c (set_derives): Likewise.
19965 * src/reader.c (packgram, reduce_output): Likewise.
19966 * src/reduce.c (reduce_grammar_tables): Likewise.
19967 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19968
d2d1b42b
AD
199692001-11-30 Akim Demaille <akim@epita.fr>
19970
19971 * src/reduce.c (reduce_output): Formatting changes.
19972 * src/print.c (print_results, print_grammar): Likewise.
19973 * tests/regression.at (Rule Line Numbers)
19974 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19975
760b53a8
AD
199762001-11-30 Akim Demaille <akim@epita.fr>
19977
19978 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19979 useless nonterminals, move them at the end of the symbol arrays.
19980 (reduce_output): Adjust.
19981 * tests/reduce.at (Useless Nonterminals): Adjust.
19982
00238958
AD
199832001-11-30 Akim Demaille <akim@epita.fr>
19984
19985 * src/reduce.c: Various comment/formatting changes.
19986 (nonterminals_reduce): New, extracted from...
19987 (reduce_grammar_tables): here.
19988 (reduce_grammar): Call nonterminals_reduce.
19989
396452de
PE
199902001-11-29 Paul Eggert <eggert@twinsun.com>
19991
19992 * src/bison.simple (YYSTACK_REALLOC): Remove.
19993 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19994 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19995 New macros.
19996 (union yyalloc): New type.
19997 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19998 an arbitrary restriction on hosts where size_t is wider than int.
19999
20000 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20001 a parser stack overflow. Allocate just one block of memory for all
20002 three stacks, instead of allocating three blocks; this typically is
20003 faster and reduces fragmentation.
20004
20005 Do not limit the number of items in the stack to a value that fits
20006 in 'int', as this is an arbitrary limit on hosts with 64-bit
20007 size_t and 32-bit int.
20008
147e184c
MA
200092001-11-29 Marc Autret <autret_m@epita.fr>
20010
20011 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20012 of defining YYERROR_VERBOSE.
20013 [AT_DATA]: $4 is now out of C declarations in the prologue.
20014
426cf563
MA
200152001-11-28 Marc Autret <autret_m@epita.fr>
20016
20017 * src/reader.c (parse_dquoted_param): New.
20018 (parse_skel_decl): Use it.
20019 * src/lex.h: Add its prototype.
20020 * src/lex.c (literalchar): Become not static.
20021
c7925b99
MA
200222001-11-28 Marc Autret <autret_m@epita.fr>
20023
20024 * src/output.h: And put its extern declaration here.
20025 * src/output.c (error_verbose): Define here.
20026 (prepare): Echo name modification.
20027 * src/getargs.h: Clean its extern declaration.
20028 * src/getargs.c (error_verbose_flag): Remove.
20029 (getargs): Remove case 'e'.
20030 * src/options.c (option_table): 'error-verbose' is now seen as simple
20031 percent option.
20032 Include output.h.
20033
20034 * src/reader.c (read_declarations): Remove case tok_include.
20035 (parse_include_decl): Remove.
20036 * src/lex.h (token_t): Remove tok_include.
20037 * src/options.c (option_table): 'include' is now a simple command line
20038 option.
20039
5b5d1929
MA
200402001-11-28 Marc Autret <autret_m@epita.fr>
20041
20042 * src/bison.simple: Adjust muscle names.
20043 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20044 * src/output.c (prepare): s/_/-/ for the muscles names.
20045 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20046
8850be4b
MA
200472001-11-28 Marc Autret <autret_m@epita.fr>
20048
20049 * src/bison.simple: Fix debug.
20050 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20051
4a38e613
AD
200522001-11-28 Akim Demaille <akim@epita.fr>
20053
20054 * src/LR0.c (shifts_new): New.
20055 (save_shifts, insert_start_shift, augment_automaton): Use it.
20056
4b35e1c1
AD
200572001-11-28 Akim Demaille <akim@epita.fr>
20058
20059 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20060 keep ruleno only.
20061
d2b04478
AD
200622001-11-28 Akim Demaille <akim@epita.fr>
20063
20064 * src/closure.c (closure): Instead of looping over word in array
20065 then bits in words, loop over bits in array.
20066
2c4c30aa
AD
200672001-11-28 Akim Demaille <akim@epita.fr>
20068
20069 * src/closure.c (closure): No longer optimize the special case
20070 where all the bits of `ruleset[r]' are set to 0, to make the code
20071 clearer.
20072
576890b7
AD
200732001-11-28 Akim Demaille <akim@epita.fr>
20074
20075 * src/closure.c (closure): `r' and `c' are new variables, used to
20076 de-obfuscate accesses to RULESET and CORE.
20077
cb487d7d
AD
200782001-11-28 Akim Demaille <akim@epita.fr>
20079
20080 * src/reduce.c (reduce_print): Use ngettext.
20081 (dump_grammar): Improve the trace accuracy.
20082
6013d43f
AD
200832001-11-28 Akim Demaille <akim@epita.fr>
20084
20085 * src/reduce.c (dump_grammar): Don't translate trace messages.
20086
cb4956ee
AD
200872001-11-28 Akim Demaille <akim@epita.fr>
20088
20089 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20090 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20091 as all tags are free'ed afterwards.
20092 From Enrico Scholz.
20093
648185ab
PE
200942001-11-27 Paul Eggert <eggert@twinsun.com>
20095
20096 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20097 use alloca when we didn't want to, and vice versa.
20098
68254a03
MA
200992001-11-27 Marc Autret <autret_m@epita.fr>
20100
9113b58f
AD
20101 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20102 initialization.
68254a03
MA
20103 * src/output.c (prepare): Remove its update.
20104
04d843a2
MA
201052001-11-27 Marc Autret <autret_m@epita.fr>
20106
20107 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20108 Use %error-verbose.
20109
d2079671 201102001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
20111
20112 * src/bison.simple: Remove YYERROR_VERBOSE using.
20113 Use %%error_verbose.
20114 (yyparse): Likewise.
20115 * src/output.c (prepare): Give its final value.
20116 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20117 * src/getargs.h: Add its extern declaration.
20118 * src/getargs.c (error_verbose_flag): New int.
20119 (getargs): Update to catch new case.
20120 * src/options.c (option_table): 'error-verbose' is a new option.
20121 (shortopts): Update.
20122
e0327bc8
AD
201232001-11-27 Akim Demaille <akim@epita.fr>
20124
20125 * src/system.h: Use intl/libgettext.h.
20126 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20127
000f1a3c
AD
201282001-11-27 Akim Demaille <akim@epita.fr>
20129
20130 * tests/torture.at (Exploding the Stack Size with Malloc):
20131 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20132
26cfe0be
AD
201332001-11-27 Akim Demaille <akim@epita.fr>
20134
20135 * src/files.c: Include error.h.
20136 Reported by Hans Aberg.
20137
f6bd5427
MA
201382001-11-26 Marc Autret <autret_m@epita.fr>
20139
d2079671 20140 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
20141 (read_declarations): Add case tok_include.
20142 * src/getargs.h (include): Add its extern definition.
20143 * src/getargs.c (include): New const char *.
20144 (getargs): Add case '-I'.
20145 * src/options.c (option_table): Add include as command line and
20146 percent option.
20147 * src/lex.h (token_t): Add tok_include.
20148
2ca209c1
AD
201492001-11-26 Akim Demaille <akim@epita.fr>
20150
20151 * src/reader.c (readgram): Make sure rules for mid-rule actions
20152 have a lineno equal to that of their host rule.
20153 Reported by Hans Aberg.
20154 * tests/regression.at (Rule Line Numbers): New.
20155
0e41b407
AD
201562001-11-26 Akim Demaille <akim@epita.fr>
20157
20158 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20159 size_ts.
20160
201612001-11-26 Akim Demaille <akim@epita.fr>
20162
20163 * src/complain.c, src/complain.h (error): Remove, provided by
20164 lib/error.[ch].
20165
e0c40012
AD
201662001-11-26 Akim Demaille <akim@epita.fr>
20167
20168 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20169 issue an error message.
20170 * tests/regression.at (Invalid %directive): New.
20171 Reported by Hans Aberg.
20172
5e147124
AD
201732001-11-26 Akim Demaille <akim@epita.fr>
20174
20175 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20176 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20177
a034c8b8
AD
201782001-11-26 Akim Demaille <akim@epita.fr>
20179
20180 * src/conflicts.c (conflicts_print): Don't complain at all when
20181 there are no reduce/reduce conflicts, and as many shift/reduce
20182 conflicts as expected.
20183 * tests/regression.at (%expect right): Adjust.
20184
c64a20f3
AD
201852001-11-23 Akim Demaille <akim@epita.fr>
20186
20187 * lib/alloca.c: Update, from fileutils.
20188
5b0d29bb
AD
201892001-11-23 Akim Demaille <akim@epita.fr>
20190
20191 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20192
722c4bfe
AD
201932001-11-23 Akim Demaille <akim@epita.fr>
20194
20195 * src/system.h: Include alloca.h.
20196 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20197
6255b435
AD
201982001-11-23 Akim Demaille <akim@epita.fr>
20199
20200 * src/print_graph.c (print_actions): Remove `rule', unused.
20201 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20202 pacify GCC's signed < unsigned warnings.
20203 * src/closure.c (itemsetsize): Likewise.
20204 * src/reader.c (symbol_list_new): Static.
20205
b29b2ed5
AD
202062001-11-23 Akim Demaille <akim@epita.fr>
20207
20208 Attaching lineno to buckets is stupid, since only one copy of each
20209 symbol is kept, only the line of the first occurrence is kept too.
20210
20211 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20212 * src/reader.c (rline_allocated): Remove, unused.
20213 (symbol_list): Have a `line' member.
20214 (symbol_list_new): New.
20215 (readgram): Use it.
20216 * src/print.c (print_grammar): Output the rule line numbers.
20217 * tests/regression.at (Solved SR Conflicts)
20218 (Unresolved SR Conflicts): Adjust.
20219 Reported by Hans Aberg.
20220
a81b1d4a
MA
202212001-11-22 Marc Autret <autret_m@epita.fr>
20222
20223 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20224
c1ecb3c1
MA
202252001-11-22 Marc Autret <autret_m@epita.fr>
20226
20227 * src/muscle_tab.c (muscle_init): Remove initialization of
20228 skeleton muscle.
20229 * src/output.c (output_master_parser): Do it here.
20230
fbe01355
AD
202312001-11-20 Akim Demaille <akim@epita.fr>
20232
20233 * po/sv.po: New.
20234 * configure.in (ALL_LINGUAS): Adjust.
20235 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20236 longer contains strings to translate.
20237
81e895c0
AD
202382001-11-19 Akim Demaille <akim@epita.fr>
20239
20240 * src/conflicts.c (conflicts_print): Add a missing \n.
20241
6bb1878b
AD
202422001-11-19 Akim Demaille <akim@epita.fr>
20243
20244 * src/nullable.c (nullable_print): New.
20245 (set_nullable): Call it when tracing.
20246 Better locality of variables.
20247
d9ec2d07
AD
202482001-11-19 Akim Demaille <akim@epita.fr>
20249
20250 * src/print.c (print_actions): Better locality of variables.
20251
720e5c1b
AD
202522001-11-19 Akim Demaille <akim@epita.fr>
20253
20254 * src/derives.c (print_derives): Fix and enrich.
20255 * src/closure.c (print_fderives): Likewise.
20256
fb908786
AD
202572001-11-19 Akim Demaille <akim@epita.fr>
20258
20259 * src/closure.c (itemsetend): Remove, replaced with...
20260 (itemsetsize): new.
20261
125ecb56
AD
202622001-11-19 Akim Demaille <akim@epita.fr>
20263
20264 * src/LR0.c (kernel_end): Remove, replaced with...
20265 (kernel_size): new.
20266
d8cf039f
AD
202672001-11-19 Akim Demaille <akim@epita.fr>
20268
20269 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20270 to clarify.
20271
7bec0760
AD
202722001-11-19 Akim Demaille <akim@epita.fr>
20273
20274 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20275
c87d4863
AD
202762001-11-19 Akim Demaille <akim@epita.fr>
20277
20278 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20279 trace messages.
20280 * src/LR0.c: Likewise.
20281 (allocate_itemsets): Use arrays instead of pointers to clarify.
20282
9bfe901c
AD
202832001-11-19 Akim Demaille <akim@epita.fr>
20284
20285 * src/getargs.c (statistics_flag): Replace with...
20286 (trace_flag): New.
20287 (longopts): Accept --trace instead of --statistics.
20288 * src/getargs.h, src/options.c: Adjust.
20289 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20290 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20291
97db7bd4
AD
202922001-11-19 Akim Demaille <akim@epita.fr>
20293
cc72668c 20294 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20295 pointers to clarify the code.
20296 (save_reductions, save_shifts): Factor common parts of alternatives.
20297
2c5f66ed
AD
202982001-11-19 Akim Demaille <akim@epita.fr>
20299
20300 * src/LR0.c (new_state, get_state): Complete TRACE code.
20301 * src/closure.c: Include `reader.h' to get `tags', needed by the
20302 trace code.
20303 Rename the conditional DEBUG as TRACE.
20304 Output consistently TRACEs to stderr, not stdout.
20305 * src/derives.c: Likewise.
20306 * src/reduce.c: (inaccessable_symbols): Using if is better style
20307 than goto.
20308 Use `#if TRACE' instead of `#if 0' for tracing code.
20309
300f275f
AD
203102001-11-19 Akim Demaille <akim@epita.fr>
20311
20312 * src/system.h (LIST_FREE, shortcpy): New.
20313 * src/LR0.c: Use them.
20314 * src/output.c (free_itemsets, free_reductions, free_shifts):
20315 Remove, replaced by LIST_FREE.
20316
f59c437a
AD
203172001-11-19 Akim Demaille <akim@epita.fr>
20318
20319 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20320 (REDUCTIONS_ALLOC): New.
20321 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20322 allocation.
20323
6986fd9e
AD
203242001-11-19 Akim Demaille <akim@epita.fr>
20325
20326 * src/LR0.c (new_state): Complete trace code.
20327 * src/nullable.c (set_nullable): Don't translate traces.
20328
4bc30f78
AD
203292001-11-19 Akim Demaille <akim@epita.fr>
20330
20331 * src/print_graph.c (print_core): Better locality of variables.
20332 * src/print.c (print_core): Likewise.
20333
08a946e0
AD
203342001-11-19 Akim Demaille <akim@epita.fr>
20335
20336 * src/vcg.c: You do the output, so you are responsible of the
20337 handling of VCG syntax, in particular: use quotearg.
20338 * src/print_graph.c: Don't.
20339 (print_actions): Don't output the actions as part of the nodes,
20340 since that's the job of the edges.
20341 (print_state): Don't output by hand: fill the node description,
9bfe901c 20342 and ask for its output.
08a946e0 20343
f0473484
AD
203442001-11-19 Akim Demaille <akim@epita.fr>
20345
cc72668c
AD
20346 * src/bison.simple (yyparse): When verbosely reporting an error,
20347 no longer put additional quotes around token names.
f0473484
AD
20348 * tests/calc.at: Adjust.
20349
e41dc700
AD
203502001-11-19 Akim Demaille <akim@epita.fr>
20351
20352 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20353 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20354 * src/output.c: Adjust.
20355
652a871c
AD
203562001-11-19 Akim Demaille <akim@epita.fr>
20357
20358 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20359 (rule_t): this.
20360 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20361
b2ed6e58
AD
203622001-11-19 Akim Demaille <akim@epita.fr>
20363
20364 * src/gram.h (rule_t): New.
20365 (rule_table): New.
20366 (rrhs, rlhs): Remove, part of state_t.
20367 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20368 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20369 * src/reader.c, src/reduce.c: Adjust.
20370
edad7067
AD
203712001-11-19 Akim Demaille <akim@epita.fr>
20372
20373 * src/reader.c (symbols_output): New, extracted from...
20374 (packsymbols): Here.
20375 (reader): Call it.
20376
3feec034
AD
203772001-11-19 Akim Demaille <akim@epita.fr>
20378
20379 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20380 (maxrhs): this new function.
20381
ddcd5fdf
AD
203822001-11-19 Akim Demaille <akim@epita.fr>
20383
cc72668c 20384 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
20385 Adjust.
20386
bb527fc2
AD
203872001-11-19 Akim Demaille <akim@epita.fr>
20388
cc72668c 20389 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
20390 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20391 * src/lalr.c: Adjust.
20392
a845a697
AD
203932001-11-19 Akim Demaille <akim@epita.fr>
20394
20395 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20396 (set_state_table): handle the `lookaheads' members.
20397
f004bf6a
AD
203982001-11-19 Akim Demaille <akim@epita.fr>
20399
cc72668c
AD
20400 * src/lalr.h (lookaheads): Removed array, whose contents is now
20401 a member of...
f004bf6a
AD
20402 (state_t): this structure.
20403 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20404 Adjust.
20405
de326cc0
AD
204062001-11-19 Akim Demaille <akim@epita.fr>
20407
cc72668c
AD
20408 * src/lalr.h (consistent): Removed array, whose contents is now
20409 a member of...
de326cc0
AD
20410 (state_t): this structure.
20411 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20412 Adjust.
20413
90b4416b
AD
204142001-11-19 Akim Demaille <akim@epita.fr>
20415
cc72668c
AD
20416 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20417 contents are now members of...
90b4416b
AD
20418 (state_t): this structure.
20419 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20420 Adjust.
20421
9703cc49
AD
204222001-11-19 Akim Demaille <akim@epita.fr>
20423
20424 * src/lalr.h (state_t): New.
20425 (state_table): Be a state_t * instead of a core **.
20426 (accessing_symbol): Remove, part of state_t.
20427 * src/lalr.c: Adjust.
20428 (set_accessing_symbol): Merge into...
20429 (set_state_table): this.
20430 * src/print_graph.c, src/conflicts.c: Adjust.
20431
d803322e
AD
204322001-11-14 Akim Demaille <akim@epita.fr>
20433
20434 * tests/calc.at, tests/output.at, tests/regression.at,
20435 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20436 now the tests are run in private dirs, therefore AC_CLEANUP and
20437 family can be simplified to 0-ary.
20438 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20439 use abs. path to find config.h.
20440 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20441 stderr, there can be way too much random noise.
20442 Instead pass -Werror to GCC and rely on the exit status.
20443 Reported by Wolfram Wagner.
20444
3d76b07d
AD
204452001-11-14 Akim Demaille <akim@epita.fr>
20446
20447 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20448 defined only if yyoverflow is defined, to avoid `warning: unused
20449 variable `yyvs1''.
20450 Reported by The Test Suite.
20451
09b503c8
AD
204522001-11-14 Akim Demaille <akim@epita.fr>
20453
20454 * src/print.c: Include reduce.h.
20455 Reported by Hans Aberg.
20456
204572001-11-14 Akim Demaille <akim@epita.fr>
20458
20459 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20460 Revert a previous patch: these are really const.
20461 * src/conflicts.c (conflict_report): Additional useless pair of
20462 braces to pacify GCC's warnings for `if () if () {} else {}'.
20463 * src/lex.c (parse_percent_token): Replace equal_offset with
20464 arg_offset.
20465 arg is const.
20466 Be sure to strdup `arg' when used, since there is no reason for
20467 token_buffer not to change.
20468
0f37a994
AD
204692001-11-14 Akim Demaille <akim@epita.fr>
20470
20471 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20472 definition.
20473 * src/main.c (main): Use them.
20474 Suggested by Hans Aberg.
20475
d39d93b8
AD
204762001-11-12 Akim Demaille <akim@epita.fr>
20477
20478 * src/system.h (ngettext): Now that we use ngettext, be sure to
20479 provide a default definition when NLS are not used.
20480
9edcd895
AD
204812001-11-12 Akim Demaille <akim@epita.fr>
20482
20483 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20484 Use @kbd to denote user input.
20485 (Language and Grammar): ANSIfy the example.
20486 Adjust its layout for info/notinfo.
20487 (Location Tracking Calc): Output error messages to stderr.
20488 Output locations in a more GNUtically correct way.
20489 Fix a couple of Englishos.
20490 Adjust @group/@end group pairs.
20491
7da99ede
AD
204922001-11-12 Akim Demaille <akim@epita.fr>
20493
e3aa65c5 20494 %expect was not functioning at all.
7da99ede
AD
20495
20496 * src/conflicts.c (expected_conflicts): Set to -1.
20497 (conflict_report): Use ngettext.
20498 (conflicts_print): Check %expect and make its violation an error.
20499 * doc/bison.texinfo (Expect Decl): Adjust.
20500 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20501 * tests/regression.at (%expect not enough, %expect right)
20502 (%expect too much): New.
20503
ba9dda1a
AD
205042001-11-12 Akim Demaille <akim@epita.fr>
20505
20506 * tests/regression.at (Conflicts): Rename as...
20507 (Unresolved SR Conflicts): this.
20508 (Solved SR Conflicts): New.
20509
337c5bd1
AD
205102001-11-12 Akim Demaille <akim@epita.fr>
20511
20512 * src/reduce.c (print_results): Rename as...
20513 (reduce_output): This.
20514 Output to OUT, passed as argument, instead of output_obstack.
20515 (dump_grammar): Likewise.
20516 (reduce_free): New.
20517 Also free V1.
20518 (reduce_grammar): No longer call reduce_output, since...
20519 * src/print.c (print_results): do it.
20520 * src/main.c (main): Call reduce_free;
20521
c73a41af
AD
205222001-11-12 Akim Demaille <akim@epita.fr>
20523
20524 * src/conflicts.c (print_reductions): Accept OUT as argument.
20525 Output to it, not to output_obstack.
20526 * src/print.c (print_actions): Adjust.
20527
0df87bb6
AD
205282001-11-12 Akim Demaille <akim@epita.fr>
20529
20530 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20531 the result instead of using...
20532 (src_total, rrc_total, src_count, rrc_count): Remove.
20533 (any_conflicts): Remove.
20534 (print_conflicts): Split into...
20535 (conflicts_print, conflicts_output): New.
20536 * src/conflicts.h: Adjust.
20537 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 20538 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
20539 * tests/regression.at (Conflicts): New.
20540 Reported by Tom Lane.
20541
e4d3d4de
AD
205422001-11-12 Akim Demaille <akim@epita.fr>
20543
20544 * tests/regression.at (Invalid input): Remove, duplicate with
20545 ``Invalid input: 1''.
20546
6d7d248e
AD
205472001-11-12 Akim Demaille <akim@epita.fr>
20548
20549 * tests/torture.at (AT_DATA_STACK_TORTURE)
20550 (Exploding the Stack Size with Alloca)
20551 (Exploding the Stack Size with Malloc): New.
20552
e9e4c321
AD
205532001-11-12 Akim Demaille <akim@epita.fr>
20554
20555 * src/bison.simple (YYSTACK_REALLOC): New.
20556 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 20557 Reported by Per Allansson.
e9e4c321 20558
5f7e0832
AD
205592001-11-12 Pascal Bart <pascal.bart@epita.fr>
20560
20561 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20562 define CPP macro, which substitute YYSTYPE by yystype.
20563 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20564 with yyltype/YYLTYPE. This allows inclusion of the generated
20565 header within the parser if the compiler, such as GGC, accepts
20566 multiple equivalent #defines.
20567 From Akim.
20568
e3f1699f
AD
205692001-11-05 Akim Demaille <akim@epita.fr>
20570
20571 * src/reader.c (symbols_output): New, extracted from...
20572 (packsymbols): here.
20573 (reader): Adjust.
20574
65be0866
AD
205752001-11-05 Akim Demaille <akim@epita.fr>
20576
20577 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20578
e4d910bf
AD
205792001-11-05 Akim Demaille <akim@epita.fr>
20580
20581 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20582 pattern.
20583
951366c1
AD
205842001-11-05 Akim Demaille <akim@epita.fr>
20585
20586 * src/options.h (struct option_table_struct): set_flags is void*.
20587 * src/options.c (longopts): Support `--output' and `%output'.
20588 (usage): Adjust.
20589 * src/lex.h (tok_setopt): Remove, replaced with...
20590 (tok_intopt, tok_stropt): these new guys.
20591 * src/lex.c (getopt.h): Not needed.
20592 (token_buffer, unlexed_token_buffer): Not const.
20593 (percent_table): Promote `-' over `_' in directive names.
20594 Active `%name-prefix', `file-prefix', and `output'.
20595 (parse_percent_token): Accept possible arguments to directives.
20596 Promote `-' over `_' in directive names.
20597
d8988b2f
AD
205982001-11-04 Akim Demaille <akim@epita.fr>
20599
20600 * doc/bison.texinfo (Decl Summary): Split the list into
20601 `directives for grammars' and `directives for bison'.
20602 Sort'em.
20603 Add description of `%name-prefix', `file-prefix', and `output'.
20604 Promote `-' over `_' in directive names.
20605 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20606 Simplify the description of `--name-prefix'.
20607 Promote `-' over `_' in directive names.
20608 Promote `--output' over `--output-file'.
20609 Fix the description of `--defines'.
20610 * tests/output.at: Exercise %file-prefix and %output.
20611
6468d18e
AD
206122001-11-02 Akim Demaille <akim@epita.fr>
20613
20614 * doc/refcard.tex: Update.
20615
6b7e85b9
AD
206162001-11-02 Akim Demaille <akim@epita.fr>
20617
20618 * src/symtab.h (SUNDEF): New.
20619 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20620 stand for `uninitialized', instead of 0.
20621 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20622 * src/lex.c (lex): Adjust.
20623
20624 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20625 Number it 0.
20626 Let yylex return it instead of a plain 0.
20627 Reported by Dick Streefland.
20628
cd5aafcf
AD
206292001-11-02 Akim Demaille <akim@epita.fr>
20630
20631 * tests/regression.at (Mixing %token styles): New test.
20632
037ca2f1
AD
206332001-11-02 Akim Demaille <akim@epita.fr>
20634
20635 * src/reader.c (parse_thong_decl): Formatting changes.
20636 (token_translations_init): New, extracted from...
20637 (packsymbols): Here.
20638 Adjust.
20639
270a173c
AD
206402001-11-01 Akim Demaille <akim@epita.fr>
20641
20642 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20643 Check that `9foo.y' produces correct cpp guards.
20644 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20645 guards.
20646 Reported by Wwp.
20647
561f9a30
AD
206482001-11-01 Akim Demaille <akim@epita.fr>
20649
20650 * tests/regression.at (Invalid input: 2): New.
20651 * src/lex.c (unlexed_token_buffer): New.
20652 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20653 too.
20654 Reported by Wwp.
20655
f987e9d2
AD
206562001-11-01 Akim Demaille <akim@epita.fr>
20657
20658 * tests/calc.at: Catch up with 1.30.
20659 * configure.in: Bump to 1.49a.
20660 Adjust to newer Autotest.
20661
0846f581
PB
206622001-10-19 Pascal Bart <pascal.bart@epita.fr>
20663
20664 * src/conflicts.c: Move global variables rrc_total and src_total ...
20665 (print_conflicts): here.
20666 * src/output.c (output): Free global variable user_toknums.
20667 * src/lex.c (token_obstack): Become static.
20668
3c1a79b3
AD
206692001-10-18 Akim Demaille <akim@epita.fr>
20670
20671 * tests/atlocal.in (GCC): Add.
20672 * tests/calc.at: s/m4_match/m4_bmatch/.
20673 s/m4_patsubst/m4_bpatsubst/.
20674 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20675 * configure.in: AC_SUBST(GCC).
20676
5d52e7d0
MA
206772001-10-14 Marc Autret <autret_m@epita.fr>
20678
20679 * src/options.c (create_long_option_table): Fix.
20680
631aa1d3
AD
206812001-10-10 Akim Demaille <akim@epita.fr>
20682
20683 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20684
f6ec6d13
AD
206852001-10-04 Akim Demaille <akim@epita.fr>
20686
20687 * src/reader.c (parse_union_decl): Push the caracters in
20688 union_obstack, not attrs_obstack.
20689
342b8b6e
AD
206902001-10-04 Akim Demaille <akim@epita.fr>
20691
20692 Merge in the branch 1.29.
20693
20694 * src/reader.c (packsymbols): Use a temporary obstack for
20695 `%%tokendef', since output_stack is already used elsewhere.
20696
20697 2001-10-02 Akim Demaille <akim@epita.fr>
20698
20699 Bump 1.29d.
20700
20701 2001-10-02 Akim Demaille <akim@epita.fr>
20702
20703 Version 1.29c.
20704
20705 2001-10-02 Akim Demaille <akim@epita.fr>
20706
20707 * tests/regression.at (Invalid CPP headers): New.
20708 From Alexander Belopolsky.
20709 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20710
20711 2001-10-02 Akim Demaille <akim@epita.fr>
20712
20713 * tests/regression.at (Invalid input): New.
20714 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20715 Reported by Shura.
20716
20717 2001-10-02 Akim Demaille <akim@epita.fr>
20718
20719 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20720
20721 2001-10-02 Akim Demaille <akim@epita.fr>
20722
20723 * src/output.c (output_parser): Assert `skeleton'.
20724 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20725 systems.
20726 From Shura.
20727
20728 2001-10-01 Marc Autret <autret_m@epita.fr>
20729
20730 * src/lex.h: Echo modifications.
20731 * src/lex.c (unlex): Parameter is now token_t.
20732 From Hans Aberg.
20733
20734 2001-10-01 Marc Autret <autret_m@epita.fr>
20735
20736 * src/main.c: Include lex.h.
20737 From Hans Aberg.
20738
20739 2001-09-29 Akim Demaille <akim@epita.fr>
20740
20741 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20742
20743 2001-09-28 Akim Demaille <akim@epita.fr>
20744
20745 * tests/testsuite.at: Update to newer Autotest.
20746 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20747
20748 2001-09-27 Akim Demaille <akim@epita.fr>
20749
20750 Position independent wrapper.
20751
20752 * tests/bison: Remove.
20753 * tests/bison.in: New.
20754 * configure.in: Adjust.
20755
20756 2001-09-27 Paul Eggert <eggert@twinsun.com>
20757
20758 Port quotearg fixes from tar 1.13.24.
20759
20760 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20761 tm to be declared.
20762 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20763 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20764
20765 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20766 * m4/mbrtowc.m4: New file.
20767 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20768 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20769
20770 2001-09-27 Akim Demaille <akim@epita.fr>
20771
20772 Bump to 1.29c.
20773
20774 2001-09-27 Akim Demaille <akim@epita.fr>
20775
20776 Version 1.29b.
20777
20778 2001-09-25 Akim Demaille <akim@epita.fr>
20779
20780 * src/system.h: Include `xalloc.h'.
20781 Remove it from the C files.
20782 * src/files.c (output_files): Free the obstacks.
20783 * src/lex.c (init_lex): Rename as...
20784 (lex_init): this.
20785 (lex_free): New.
20786 * src/main.c (main): Use it.
20787
20788 2001-09-24 Marc Autret <autret_m@epita.fr>
20789
20790 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20791 to output informations in fout (FILE*).
20792 (open_graph, close_graph): Likewise.
20793 (output_graph, output_edge, output_node): Likewise.
20794 * src/vcg.h: Update function prototypes.
20795 * src/print_graph.c (print_graph): Open output graph file.
20796 (print_actions): Adjust.
20797 * src/files.h: Remove extern declaration.
20798 * src/files.c: Remove graph_obstack declaration.
20799 (open_files): Remove graph_obstack initialization.
20800 (output_files): Remove graph_obstack saving.
20801
20802 2001-09-24 Marc Autret <autret_m@epita.fr>
20803
20804 * src/files.c (compute_output_file_names): Fix.
20805
20806 2001-09-24 Marc Autret <autret_m@epita.fr>,
20807 Akim Demaille <akim@epita.fr>
20808
20809 * src/reader.c (reader): Remove call to free_symtab ().
20810 * src/main.c (main): Call it here.
20811 Include symtab.h.
20812 * src/conflicts.c (initialize_conflicts): Rename as...
20813 (solve_conflicts): this.
20814 * src/print.c (print_core, print_actions, print_state)
20815 (print_grammar): Dump to a file instead a `output_obstack'.
20816 (print_results): Dump `output_obstack', and then proceed with the
20817 FILE *.
20818 * src/files.c (compute_output_file_names, close_files): New.
20819 (output_files): Adjust.
20820 * src/main.c (main): Adjust.
20821
20822 2001-09-23 Marc Autret <autret_m@epita.fr>
20823
20824 * src/files.c (compute_header_macro): Computes header macro name
20825 from spec_defines_file when given.
20826
20827 2001-09-23 Marc Autret <autret_m@epita.fr>
20828
20829 * src/files.c (output_files): Add default extensions.
20830
20831 2001-09-22 Akim Demaille <akim@epita.fr>
20832
20833 * src/conflicts.c (finalize_conflicts): Rename as...
20834 (free_conflicts): this.
20835
20836 2001-09-22 Akim Demaille <akim@epita.fr>
20837
20838 * src/gram.c (gram_free): Rename back as...
20839 (dummy): this.
20840 (output_token_translations): Free `token_translations'.
20841 * src/symtab.c (free_symtab): Free the tag field.
20842
20843 2001-09-22 Akim Demaille <akim@epita.fr>
20844
20845 Remove `translations' as it is always set to true.
20846
20847 * src/gram.h: Adjust.
20848 * src/reader.c (packsymbols, parse_token_decl): Adjust
20849 * src/print.c (print_grammar): Adjust.
20850 * src/output.c (output_token_translations): Adjust.
20851 * src/lex.c (lex): Adjust.
20852 * src/gram.c: Be sure the set pointers to NULL.
20853 (dummy): Rename as...
20854 (gram_free): this.
20855
20856 2001-09-22 Akim Demaille <akim@epita.fr>
20857
20858 * configure.in: Invoke AM_LIB_DMALLOC.
20859 * src/system.h: Use dmalloc.
20860 * src/LR0.c: Be sure to have pointers initialized to NULL.
20861 (allocate_itemsets): Allocate kernel_items only if needed.
20862
20863 2001-09-22 Akim Demaille <akim@epita.fr>
20864
20865 * configure.in: Bump to 1.29b.
20866 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20867 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20868 need xmalloc.c in calc.y.
20869 From Pascal Bart.
20870
20871 2001-09-21 Akim Demaille <akim@epita.fr>
20872
20873 Version 1.29a.
20874 * Makefile.maint, config/config.guess, config/config.sub,
20875 * config/missing: Update from masters.
20876 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20877 upon package.m4.
20878 * configure.in (ALL_LINGUAS): Add `tr'.
20879
20880 2001-09-21 Akim Demaille <akim@epita.fr>
20881
20882 * tests/Makefile.am (package.m4): Move to...
20883 ($(srcdir)/$(TESTSUITE)): here.
20884
20885 2001-09-20 Akim Demaille <akim@epita.fr>
20886
20887 * src/complain.c: No longer try to be standalone: use system.h.
20888 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20889 * src/complain.h: Likewise.
20890 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20891 Remove the unused variable `n'.
20892 From Albert Chin-A-Young.
20893
20894 2001-09-18 Marc Autret <autret_m@epita.fr>
20895
20896 * doc/bison.1: Update.
20897 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20898 descriptions.
20899 (Option Cross Key): Update.
20900 Add --graph.
20901
20902 2001-09-18 Marc Autret <autret_m@epita.fr>
20903
20904 * tests/regression.at: New test (comment in %union).
20905
20906 2001-09-18 Marc Autret <autret_m@epita.fr>
20907
20908 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20909 do that.
20910 Reported by Keith Browne.
20911
20912 2001-09-18 Marc Autret <autret_m@epita.fr>
20913
20914 * tests/output.at: Add tests for --defines and --graph.
20915
20916 2001-09-18 Marc Autret <autret_m@epita.fr>
20917
20918 * tests/output.at: Removes tests of %{header,src}_extension features.
20919
20920 2001-09-18 Akim Demaille <akim@epita.fr>
20921
20922 * tests/Makefile.am (package.m4): New.
20923 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20924 (_AT_CHECK_CALC_ERROR): Likewise.
20925 Factor the `, ' part of verbose error messages.
20926
20927 2001-09-18 Marc Autret <autret_m@epita.fr>
20928
20929 * src/getargs.c (longopts): Declare --defines and --graph as options
20930 with optional arguments.
20931 * src/files.h: Add extern declarations.
20932 * src/files.c (spec_graph_file, spec_defines_file): New.
20933 (output_files): Update.
20934 Remove CPP-outed code.
20935
20936 2001-09-18 Marc Autret <autret_m@epita.fr>
20937
20938 Turn off %{source,header}_extension feature.
20939
20940 * src/files.c (compute_exts_from_gf): Update.
20941 (compute_exts_from_src): Update.
20942 (output_files): CPP-out useless code.
20943 * src/files.h: Remove {header,source}_extension extern declarations.
20944 * src/reader.c (parse_dquoted_param): CPP-out.
20945 (parse_header_extension_decl): Remove.
20946 (parse_source_extension_decl): Remove.
20947 (read_declarations): Remove cases tok_{hdrext,srcext}.
20948 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20949 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20950
20951 2001-09-10 Akim Demaille <akim@epita.fr>
20952
20953 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20954 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20955 (AT_CHECK_OUTPUT): this.
20956 Merely check ls' exit status, its output is useless.
20957
20958 2001-09-10 Akim Demaille <akim@epita.fr>
20959
20960 * tests/calc.at: Use m4_match.
20961 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20962
20963 2001-09-10 Marc Autret <autret_m@epita.fr>,
20964 Akim Demaille <akim@epita.fr>
20965
20966 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20967 enum color_e.
20968 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20969 to `normal'.
20970 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20971 * src/lex.h: Adjust prototype.
20972 (token_t): Add `tok_undef'.
20973 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20974 (parse_percent_token): Now returns token_t.
20975 Add default statement in switch.
20976 (lex): Separate `c' as an input variable, from the token_t result
20977 part.
20978 (unlexed): Is a token_t.
20979
20980 2001-09-10 Akim Demaille <akim@epita.fr>
20981
20982 * configure.in: Bump to 1.29a.
20983
20984 2001-09-07 Akim Demaille <akim@epita.fr>
20985
20986 Version 1.29.
20987
20988 2001-08-30 Akim Demaille <akim@epita.fr>
20989
20990 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20991 * m4/atconfig.m4: Remove.
20992 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20993 * tests/bison: New.
20994 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20995 m4_if, m4_patsubst, and m4_regexp.
20996 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20997 `input' file instead of echo.
20998
20999 2001-08-29 Akim Demaille <akim@epita.fr>
21000
21001 Bump to 1.28e.
21002
21003 2001-08-29 Akim Demaille <akim@epita.fr>
21004
21005 Version 1.28d.
21006
21007 2001-08-29 Paul Eggert <eggert@twinsun.com>
21008
21009 * src/bison.simple (yyparse): Don't take the address of an
21010 item before the start of an array, as that doesn't conform to
21011 the C Standard.
21012
21013 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21014
21015 * doc/bison.texinfo (Location Tracking Calc): New node.
21016
21017 2001-08-29 Paul Eggert <eggert@twinsun.com>
21018
21019 * src/output.c (output): Do not define const, as this now
21020 causes more problems than it cures.
21021
21022 2001-08-29 Akim Demaille <akim@epita.fr>
21023
21024 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21025 the nodes.
21026 Be sure to tag the `detailmenu'.
21027
21028 2001-08-29 Akim Demaille <akim@epita.fr>
21029
21030 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21031 download in a tmp dir.
21032
21033 2001-08-28 Marc Autret <autret_m@epita.fr>
21034
21035 * config/depcomp: New file.
21036
21037 2001-08-28 Marc Autret <autret_m@epita.fr>
21038
21039 * doc/bison.1 (mandoc): Adjust.
21040 From Juan Manuel Guerrero.
21041
21042 2001-08-28 Marc Autret <autret_m@epita.fr>
21043
21044 * src/print_graph.c (print_state): Fix.
21045
21046 2001-08-27 Marc Autret <autret_m@epita.fr>
21047
21048 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21049 char * members.
21050 Echo modifications to the functions prototypes.
21051 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21052
21053 2001-08-27 Marc Autret <autret_m@epita.fr>
21054
21055 * src/vcg.c: Include `xalloc.h'.
21056 (add_colorentry): New.
21057 (add_classname): New.
21058 (add_infoname): New.
21059 * src/vcg.h: Add new prototypes.
21060
21061 2001-08-27 Akim Demaille <akim@epita.fr>
21062
21063 * Makefile.maint: Sync. again with CVS Autoconf.
21064
21065 2001-08-27 Akim Demaille <akim@epita.fr>
21066
21067 * Makefile.maint: Formatting changes.
21068 (po-update, cvs-update, update): New targets.
21069 (AMTAR): Remove.
21070
21071 2001-08-27 Akim Demaille <akim@epita.fr>
21072
21073 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21074 * Makefile.maint: Sync. with CVS Autoconf.
21075
21076 2001-08-27 Marc Autret <autret_m@epita.fr>
21077
21078 * src/vcg.h (struct infoname_s): New.
21079 (struct colorentry_s): New.
21080 (graph_s): New fields {vertical,horizontal}_order in structure.
21081 Add `infoname' field.
21082 Add `colorentry' field;
21083 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21084 (G_HORIZONTAL_ORDER): New.
21085 (G_INFONAME): New.
21086 (G_COLORENTRY): New.
21087 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21088 Add output of `infoname'.
21089 Add output of `colorentry'.
21090
21091 2001-08-27 Marc Autret <autret_m@epita.fr>
21092
21093 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21094 This one shadowed a global parameter.
21095
21096 2001-08-24 Marc Autret <autret_m@epita.fr>
21097
21098 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21099 instead of `unsigned'.
21100 (print_state): Do not call obstack_object_size () in obstack_grow ()
21101 to avoid macro variables shadowing.
21102
21103 2001-08-23 Marc Autret <autret_m@epita.fr>
21104
21105 * src/lex.c (percent_table): Typo: s/naem/name/.
21106 Add graph option.
21107 Normalize new options declarations.
21108
21109 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21110
21111 * tests/suite.at: Exercise %header_extension and %source_extension.
21112
21113 2001-08-16 Marc Autret <autret_m@epita.fr>
21114
21115 * src/reader.c (parse_dquoted_param): New.
21116 (parse_header_extension_decl): Use it.
21117 (parse_source_extension_decl): Likewise.
21118
21119 2001-08-16 Marc Autret <autret_m@epita.fr>
21120
21121 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21122 (get_xxxx_str): Use assert () instead of complain ().
21123 Remove return invokations in default cases.
21124 (get_decision_str): Modify default behaviour. Remove second argument.
21125 Echo modifications on calls.
21126 (output_graph): Fix.
21127
21128 2001-08-16 Marc Autret <autret_m@epita.fr>
21129
21130 * src/getargs.c (usage): Update with ``-g, --graph''.
21131
21132 2001-08-16 Marc Autret <autret_m@epita.fr>
21133
21134 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21135 (Option Cross Key): Likewise.
21136 * doc/bison.1: Update.
21137
1c8c2190
PB
211382001-09-25 Pascal Bart <pascal.bart@epita.fr>
21139
21140 * src/output.c (output_master_parser): Don't finish action_obstack.
21141 (output_parser): Don't care about the muscle action, here.
21142 (prepare): Copy the action_obstack in the action muscle.
21143 (output): Free action_obstack.
21144
180d45ba
PB
211452001-09-23 Pascal Bart <pascal.bart@epita.fr>
21146
21147 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21148 will contain `%union' declaration.
21149 (parse_union_decl): Delete #line directive output.
21150 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21151 informations about %union.
21152 (parse_union_decl): Copy the union_obstack in the muscle stype.
21153 * src/bison.simple: Add new #line directive.
21154 Add typdef %%stype YYSTYPE.
21155
c51d1a19
PB
211562001-09-23 Pascal Bart <pascal.bart@epita.fr>
21157
21158 * src/bison.simple: Add new `#line' directive.
21159
6f9344da
PB
211602001-09-22 Pascal Bart <pascal.bart@epita.fr>
21161
21162 * src/bison.simple: New `#line' directive.
21163 * src/output.c (output_parser): Support new dynamic muscle input_line.
21164
652def80
MA
211652001-09-22 Marc Autret <autret_m@epita.fr>
21166
21167 * src/output.c (output_master_parser): New.
21168 (output_parser): Be more re-entrant.
21169
25b222fa
MA
211702001-09-21 Marc Autret <autret_m@epita.fr>
21171
21172 * src/reader.c (copy_definition, parse_union_decl): Update and use
21173 `linef' muscle.
21174 (copy_action): Likewise.
21175 Use obstack_1grow ().
21176 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21177
6bc35ae5
MA
211782001-09-21 Marc Autret <autret_m@epita.fr>
21179
21180 * src/options.c (option_table): Adjust.
21181 * src/lex.c (parse_percent_token): Fix.
21182
c0629aa1
PB
211832001-09-20 Pascal Bart <pascal.bart@epita.fr>
21184
21185 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21186
82b6d266
PB
211872001-09-20 Pascal Bart <pascal.bart@epita.fr>
21188
21189 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21190 is now an option_table_struct*.
21191 (option_strcmp): New function option_strcmp.
21192 (parse_percent_token): Call option_strcmp.
21193 * src/getargs.c (xalloc.h, options.h): Include it.
21194 (getargs): Call create_long_option_table.
21195 (getargs): Free longopts at the end of the function.
21196 (shortopts): Move in options.c.
21197 * src/options.c (create_long_option_table): New function. Convert
21198 information from option_table to option structure.
21199 * src/reader.c (options.h): Include it.
21200
21201 * src/Makefile.am: Adjust.
21202 * src/options.c (option_table): Create from longopts and percent_table.
21203 * src/getargs.c (longopts): Delete.
21204 * src/lex.c (struct percent_table_struct): Delete.
21205 (percent_table): Delete.
21206 (options.h): Include it.
21207 * src/options.c: Create.
21208 * src/options.h: Create.
21209 Declare enum opt_access_e.
21210 Define struct option_table_struct.
21211
75f5aaea
MA
212122001-09-20 Marc Autret <autret_m@epita.fr>
21213
21214 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21215 sections of Bison.
21216
f508cb0a
PB
212172001-09-19 Pascal Bart <pascal.bart@epita.fr>
21218
21219 * src/bison.simple: s/%%filename/%%skeleton.
21220 * src/muscle_tab.c (getargs.h): Include it.
21221 (muscle_init): Insert new muscle skeleton.
21222
13105fc1
PB
212232001-09-18 Pascal Bart <pascal.bart@epita.fr>
21224
21225 * src/output.c (output_parser): Delete unused variable actions_dumped.
21226
b0c4483e
PB
212272001-09-07 Pascal Bart <pascal.bart@epita.fr>
21228
21229 * src/output.c (output): Delete call to reader_output_yylsp.
21230 * src/reader.c (reader): Likewise.
ba0fe3c7 21231 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21232
11d82f03
MA
212332001-09-02 Marc Autret <autret_m@epita.fr>
21234
21235 * src/reader.c: Include muscle_tab.h.
21236 (parse_union_decl): Update.
21237 (parse_macro_decl): Rename parse_muscle_decl.
21238 Update to use renamed functions and variable.
21239 (read_declarations, copy_action, read_additionnal_code, : Updated
21240 with correct variables and functions names.
21241 (packsymbols, reader): Likewise.
342b8b6e 21242
11d82f03 21243 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21244
11d82f03
MA
21245 * src/output.c: Include muscle_tab.h
21246 In all functions using macro_insert, change by using muscle_insert ().
21247 (macro_obstack): Rename muscle_obstack.
21248 Echo modifications in the whole file.
21249 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21250 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21251 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21252
21253 * src/muscle_tab.h: Update double inclusion macros.
21254 (macro_entry_s): Rename muscle_entry_s.
21255 Update prototypes.
342b8b6e 21256
11d82f03
MA
21257 * src/muscle_tab.c: Include muscle_tab.h.
21258 Rename macro_tabble to muscle_table.
21259 (mhash1, mhash2, mcmp): Use muscle_entry.
21260 (macro_init): Rename muscle_init. Update.
21261 (macro_insert): Rename muscle_insert. Update.
21262 (macro_find): Rename muscle_find. Update.
21263
21264 * src/main.c: Include muscle_tab.h.
21265 (main): Call muscle_init ().
21266 * src/Makefile.am (bison_SOURCES): Echo modifications.
21267
93a37297
MA
212682001-09-02 Marc Autret <autret_m@epita.fr>
21269
f753cd62 21270 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21271
f753cd62
MA
21272 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21273
212742001-09-02 Marc Autret <autret_m@epita.fr>
21275
21276 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21277
682d48cd
PB
212782001-09-01 Pascal Bart <pascal.bart@epita.fr>
21279
342b8b6e 21280 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21281 filename.
21282
087c8fda
MA
212832001-09-01 Marc Autret <autret_m@epita.fr>
21284
21285 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21286 to an explicit value to activate the feature. We do it here.
21287
dda680cb
PB
212882001-08-31 Pascal Bart <pascal.bart@epita.fr>
21289
21290 * src/output.c (prepare): Delete the `filename' muscule insertion.
21291 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21292 (parse_union_decl): Likewise.
21293 * src/macrotab.c (macro_init): Initialize filename by infile.
21294
9e644e64
MA
212952001-08-31 Marc Autret <autret_m@epita.fr>
21296
21297 * src/bison.simple (YYLSP_NEEDED): New definition.
21298 * src/output.c (prepare): Add macro insertion of `locations_flag'
21299
17da6427
PB
213002001-08-31 Pascal Bart <pascal.bart@epita.fr>
21301
21302 * src/output.c (prepare): Delete insertion of previous muscles,
21303 and insert the `prefix' muscles.
21304 * src/macrotab.c (macro_init): Likewise.
21305 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21306 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21307 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21308 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21309 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21310 name_prefix.
21311
e8cb70b9
PB
213122001-08-31 Pascal Bart <pascal.bart@epita.fr>
21313
21314 * src/main.c (main): Standardize.
21315 * src/output.c (output_table_data, output_parser): Likewise.
21316 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21317
63c2d5de
MA
213182001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21319
342b8b6e 21320 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21321 %%epilogue.
21322 * src/output.c (output): Rename %%declarations to %%prologue.
21323 * src/bison.simple: Echo modifications.
342b8b6e 21324
d8cb5183
MA
213252001-08-31 Marc Autret <autret_m@epita.fr>
21326
21327 * src/reader.c (readgram): CleanUp.
21328 (output_token_defines): Likewise.
21329 (packsymbols): Likewise.
21330 (reader): Likewise.
21331 * src/output.c (output): CPP-out useless code.
21332
6c686258
PB
213332001-08-31 Pascal Bart <pascal.bart@epita.fr>
21334
342b8b6e 21335 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21336 output_trailers and output_headers.
21337 * src/output.h: Remove obsolete functions prototypes of output_headers
21338 and output_trailers.
21339
8f451ef7
PB
213402001-08-30 Pascal Bart <pascal.bart@epita.fr>
21341
21342 * src/main.c: Include macrotab.h.
342b8b6e 21343 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
21344 Adjust functions prototypes.
21345 * src/macrotab.c (macro_insert): Constify key and value.
21346 (macro_find): Constify key.
21347 (macro_insert): Include 'xalloc.h'
21348 (macro_insert): Use XMALLOC.
21349 (macro_find): Constify return value.
21350 * src/output.c (output_table_data): Rename table to table_data.
21351 (output_parser): Constify macro_key, macro_value.
21352
997b6fd0 213532001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
21354
21355 * src/reader.c (parse_skel_decl): New.
342b8b6e 21356 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
21357 * src/lex.h (token_t): New token `tok_skel'.
21358 * src/lex.c (percent_table): Add skeleton option entry.
21359 Standardize.
21360
ff48177d
MA
213612001-08-29 Marc Autret <autret_m@epita.fr>
21362
21363 * src/bison.simple: Add %%user_code directive at the end.
21364 * src/reader.c (read_additionnal_code): New.
21365 (reader): Use it.
21366 * src/output.c (output_program): Remove.
21367 (output): Update.
21368
b33160bf
MA
213692001-08-28 Marc Autret <autret_m@epita.fr>
21370
21371 * src/output.c (output_actions): Clean up.
4e5caae2 21372 (output_gram): CPP-out useless code.
b33160bf
MA
21373 * src/reader.c (reader): Clean up, CPP-out useless code.
21374
d1a2daf7
PB
213752001-08-28 Pascal Bart <pascal.bart@epita.fr>
21376
342b8b6e 21377 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 21378 directive.
d1a2daf7
PB
21379 * src/bison.simple: Add `%%definitions'.
21380
2b763dfe
MA
213812001-08-28 Marc Autret <autret_m@epita.fr>
21382
21383 * config/depcomp: New file.
21384
f1a87ef6
PE
213852001-08-27 Paul Eggert <eggert@twinsun.com>
21386
21387 * src/bison.simple (yyparse): Don't take the address of an
21388 item before the start of an array, as that doesn't conform to
21389 the C Standard.
21390
82e236e2
RA
213912001-08-27 Robert Anisko <robert.anisko@epita.fr>
21392
f1a87ef6 21393 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
21394 obstack. It was done too late here.
21395
21396 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21397 completely wrong.
21398 (reader): Initialize the macro obstack here, since we need it to grow
21399 '%define' directives.
21400
21401 * src/reader.h: Declare the macro obstack as extern.
21402
b0cfa28a
RA
214032001-08-27 Robert Anisko <robert.anisko@epita.fr>
21404
21405 * src/output.c (output_parser): Fix. Store single '%' characters in
21406 the output obstack instead of throwing them away.
21407
6fc74234
AD
214082001-08-27 Akim Demaille <akim@epita.fr>
21409
21410 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21411
9c76d118
RA
214122001-08-25 Robert Anisko <robert.anisko@epita.fr>
21413
21414 * lib/Makefile.am: Adjust.
21415
a8289c62
RA
214162001-08-25 Robert Anisko <robert.anisko@epita.fr>
21417
21418 * src/bison.simple: Update and add '%%' directives.
21419
b6610515
RA
214202001-08-25 Robert Anisko <robert.anisko@epita.fr>
21421
21422 * src/reader.c (reader): Remove calls to 'output_headers' and
21423 'output_trailers'. Remove some C output.
21424 (readgram): Disable a piece of code that was writing a default
21425 definition for 'YYSTYPE'.
21426 (reader_output_yylsp): Remove.
21427 (packsymbols): Output token defintions to a macro.
21428 (copy_definition): Disable C output.
6fc74234 21429
b6610515
RA
21430 * src/reader.c (parse_macro_decl): New function used to parse macro
21431 declarations.
21432 (copy_string2): Put the body of copy_string into this new function.
21433 Add a parameter to let the caller choose whether he wants to copy the
21434 string delimiters or not.
21435 (copy_string): Be a simple call to copy_string2 with the last argument
21436 bound to true.
21437 (read_declarations): Add case for macro definition.
21438 (copy_identifier): New.
6fc74234 21439 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
21440 rather than lex.
21441
26f609ff
RA
214422001-08-25 Robert Anisko <robert.anisko@epita.fr>
21443
21444 * src/output.c (prepare): Add prefixed names.
21445 (output_parser): Output semantic actions.
21446 (output_parser): Fix bug on '%%line' directives.
6fc74234 21447
26f609ff
RA
21448 * src/output.c (output_headers): Remove. The C code printed by this
21449 function should now be in the skeletons.
21450 (output_trailers): Remove.
21451 (output): Disable call to 'reader_output_yylsp'.
21452 (output_rule_data): Do not output tables to the table obstack.
21453
21454 * src/output.c: Remove some C dedicated output.
21455 Improve the use of macro and output obstacks.
21456 (output_defines): Remove.
6fc74234 21457
26f609ff
RA
21458 * src/output.c (output_token_translations): Associate 'translate'
21459 table with a macro. No output to the table obstack.
21460 (output_gram): Same for 'rhs' and 'prhs'.
21461 (output_stos): Same for 'stos'.
21462 (output_rule_data): Same for 'r1' and 'r2'.
21463 (token_actions): Same for 'defact'.
21464 (goto_actions): Same for 'defgoto'.
21465 (output_base): Same for 'pact' and 'pgoto'.
21466 (output_table): Same for 'table'.
21467 (output_check): Same for 'check'.
6fc74234 21468
26f609ff
RA
21469 * src/output.c (output_table_data): New function.
21470 (output_short_table): Remove.
21471 (output_short_or_char_table): Remove.
6fc74234 21472
26f609ff
RA
21473 * src/output.c (output_parser): Replace most of the skeleton copy code
21474 with something new. Skeletons are now processed character by character
21475 rather than line by line, and Bison looks for '%%' macros. This is the
21476 first step in making Bison's output process (a lot) more flexible.
21477 (output_parser): Use the macro table.
21478
6f43b113
RA
214792001-08-25 Robert Anisko <robert.anisko@epita.fr>
21480
21481 * src/main.c (main): Initialize the macro table.
21482
dd3127cf
RA
214832001-08-25 Robert Anisko <robert.anisko@epita.fr>
21484
21485 * src/lex.c (percent_table): Add tok_define.
21486 * src/lex.h: Add tok_define.
21487
aa321494
RA
214882001-08-25 Robert Anisko <robert.anisko@epita.fr>
21489
21490 * src/macrotab.c: New file.
21491 * src/macrotab.h: New file.
21492 * src/Makefile.am: Update.
21493
68bd3b6b
RA
214942001-08-25 Robert Anisko <robert.anisko@epita.fr>
21495
21496 * lib/hash.c: New file.
21497 * lib/hash.h: New file.
21498 * lib/Makefile.am: Update.
21499
45f8dd1e
AD
215002001-08-15 Akim Demaille <akim@epita.fr>
21501
21502 Version 1.28c.
21503
40a64a7a 215042001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
21505
21506 * src/reader.c (readgram): Indent output macro YYSTYPE.
21507 (packsymbols): Likewise.
21508 (output_token_defines): Likewise.
21509 * src/files.c: Standardize.
21510 (compute_header_macro): New.
21511 (defines_obstack_save): New. Use compute_header_macro.
21512 (output_files): Update. Use defines_obstack_save.
21513
f9a8293a
AD
215142001-08-15 Akim Demaille <akim@epita.fr>
21515
21516 * doc/bison.texinfo (Table of Symbols): Document
21517 YYSTACK_USE_ALLOCA.
21518
150ca7a7
AD
215192001-08-15 Akim Demaille <akim@epita.fr>
21520
21521 * missing: Update from CVS Automake.
21522 * config/config.guess, config/config.sub, config/texinfo.tex:
21523 Update from gnu.org.
21524
69b5cec4
AD
215252001-08-15 Akim Demaille <akim@epita.fr>
21526
21527 * Makefile.maint: Sync with CVS Autoconf.
21528
f2b5126e
PB
215292001-08-14 Pascal Bart <pascal.bart@epita.fr>
21530
69b5cec4 21531 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
21532 `fdl.texi'.
21533 * doc/fdl.texi: Add to package.
21534
4ecbf796
MA
215352001-08-14 Marc Autret <autret_m@epita.fr>
21536
21537 Turn on %{source,header}_extension features.
21538
69b5cec4 21539 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
21540 source_extension.
21541 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 21542 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
21543 between options.
21544
95fb5662
MA
215452001-08-14 Marc Autret <autret_m@epita.fr>
21546
21547 * src/files.c (compute_base_names): Add extensions computing when
21548 `--file-prefix' used.
21549 Standardize function calls.
21550
78d09da9
MA
215512001-08-13 Marc Autret <autret_m@epita.fr>
21552
69b5cec4 21553 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
21554 defining it (defined but null disables alloca).
21555
5a009f2c
MA
215562001-08-13 Marc Autret <autret_m@epita.fr>
21557
21558 * src/bison.simple (_yy_memcpy): CPP reformat.
21559
1e41465a
PB
215602001-08-13 Pascal Bart <pascal.bart@epita.fr>
21561
21562 * tests/atconfig.in (CPPFLAGS): Fix.
21563
c67a198d
PB
215642001-08-10 Pascal Bart <pascal.bart@epita.fr>
21565
79282c6c 21566 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
21567 `gpl.texi'.
21568 * doc/gpl.texi: Add to package.
21569
09a6de7e
MA
215702001-08-10 Marc Autret <autret_m@epita.fr>
21571
21572 * src/print_graph.h: Fix.
21573 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21574
b77b9ee0
AD
215752001-08-10 Akim Demaille <akim@epita.fr>
21576
21577 * src/system.h: Provide default declarations for stpcpy, strndup,
21578 and strnlen.
21579
3e259915
MA
215802001-08-10 Robert Anisko <anisko_r@epita.fr>
21581
21582 * doc/bison.texinfo (Locations): Update @$ stuff.
21583
ca96bc2d
MA
215842001-08-09 Robert Anisko <anisko_r@epita.fr>
21585
21586 * src/bison.simple (YYLLOC_DEFAULT): Update.
21587 (yyparse): Adjust.
21588
fdc6758b
MA
215892001-08-08 Marc Autret <autret_m@epita.fr>
21590
b77b9ee0 21591 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
21592 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21593 Reported by Fabrice Bauzac.
957d4dbf 21594
600cad3b
MA
215952001-08-08 Marc Autret <autret_m@epita.fr>
21596
21597 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21598 * src/vcg.c (output_node): Fix.
21599 * src/vcg.h: Cleanup.
21600 * src/print_graph.c: Add comments.
b77b9ee0 21601 (node_output_size): New global variable. Simplify the formatting of
600cad3b 21602 the VCG graph output.
b77b9ee0 21603 (print_actions): Unused code is now used. It notifies the final state
600cad3b 21604 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 21605 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
21606 blue.
21607 Get the current node name and node_obstack by argument.
21608 (node_obstack): New variable.
21609 (print_state): Manage node_obstack.
21610 (print_core): Use node_obstack given by argument.
21611 A node is not only computed here but in print_actions also.
21612 (print_graph): CPP out useless code instead of commenting it.
21613
976e528f
AD
216142001-08-07 Pascal Bart <pascal.bart@epita.fr>
21615
21616 * tests/atconfig.in (CPPFLAGS): Fix.
21617
20e8e5ca
AD
216182001-08-07 Akim Demaille <akim@epita.fr>
21619
21620 * src/print_graph.c (quote): New.
21621 (print_core): Use it.
21622
957d4dbf 216232001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 21624
3e3da797
AD
21625 * src/vcg.c (complain.h): Include it.
21626 Unepitaize `return' invocations.
c4b66126 21627 [NDEBUG] (main): Remove.
79282c6c 21628 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
21629 * src/files.c (open_files): Initialize graph_obstack.
21630 * src/print_graph.c (print_actions): CPP out useless code.
21631 (print_core): Don't output the last `\n' in labels.
21632 Use `quote'.
21633 * src/files.c (output_files): Output the VCG file.
21634 * src/main.c (main): Invoke print_graph ();
3e3da797 21635
957d4dbf 216362001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
21637
21638 Automaton VCG graph output.
21639 Using option ``-g'' or long option ``--graph'', you can generate
21640 a gram_filename.vcg file containing a VCG description of the LALR (1)
21641 automaton of your grammar.
21642
21643 * src/main.c: Call to print_graph() function.
21644 * src/getargs.h: Update.
21645 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21646 (graph_flag): New flag.
21647 (longopts): Update.
21648 (getargs): Add case `g'.
21649 * src/files.c (graph_obstack): New obstack struct.
21650 (open_files): Initialize new obstack.
21651 (output_files): Saves graph_obstack if required.
21652 * src/files.h (graph_obstack): New extern declaration.
21653 * src/Makefile.am: Add new source files.
21654
927c1557 216552001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
21656
21657 * src/print_graph.c, src/print_graph.h (graph): New.
21658 * src/vcg.h: New file.
21659 * src/vcg.c: New file, VCG graph handling.
21660
7333d403
AD
216612001-08-06 Marc Autret <autret_m@epita.fr>
21662
21663 Add of %source_extension and %header_extension which specify
21664 the source or/and the header output file extension.
21665
21666 * src/files.c (compute_base_names): Remove initialisation of
21667 src_extension and header_extension.
21668 (compute_exts_from_gf): Update.
21669 (compute_exts_from_src): Update.
21670 (output_files): Update.
21671 * src/reader.c (parse_header_extension_decl): New.
21672 (parse_source_extension_decl): New.
21673 (read_declarations): New case statements for the new tokens.
21674 * src/lex.c (percent_table): Add entries for %source_extension
21675 and %header_extension.
21676 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21677
84163231
AD
216782001-08-06 Marc Autret <autret_m@epita.fr>
21679
21680 * configure.in: Bump to 1.28c.
21681 * doc/bison.texinfo: Texinfo thingies.
21682
8303fc42
AD
216832001-08-04 Pascal Bart <pascal.bart@epita.fr>
21684
21685 * tests/atconfig.in (CPPFLAGS): Add.
21686 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21687
70a84437
AD
216882001-08-03 Akim Demaille <akim@epita.fr>
21689
21690 Version 1.28b.
21691
2ce10144
AD
216922001-08-03 Akim Demaille <akim@epita.fr>
21693
21694 * tests/Makefile.am (check-local): Ship testsuite.
21695 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21696 Include `string.h'.
21697
1e3e4bc1
AD
216982001-08-03 Akim Demaille <akim@epita.fr>
21699
21700 * configure.in: Try using -Wformat when compiling.
21701
42b45b7f
AD
217022001-08-03 Akim Demaille <akim@epita.fr>
21703
21704 * configure.in: Bump to 1.28b.
21705
8f13fe33
AD
217062001-08-03 Akim Demaille <akim@epita.fr>
21707
21708 * src/complain.c: Adjust strerror_r portability issues.
21709
b37ba92c
AD
217102001-08-03 Akim Demaille <akim@epita.fr>
21711
21712 Version 1.28a.
21713
b0ce6046
AD
217142001-08-03 Akim Demaille <akim@epita.fr>
21715
21716 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21717 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21718 * src/getargs.c: Include complain.h.
21719 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21720 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21721
d01c415b
AD
217222001-08-03 Akim Demaille <akim@epita.fr>
21723
21724 * src/reader.c (readgram): Display hidden chars in error messages.
21725
459dd1a6
AD
217262001-08-03 Akim Demaille <akim@epita.fr>
21727
21728 Update to gettext 0.10.39.
21729
53b74c0c
AD
217302001-08-03 Akim Demaille <akim@epita.fr>
21731
21732 * lib/strspn.c: New.
21733
234a3be3
AD
217342001-08-01 Marc Autret <autret_m@epita.fr>
21735
21736 * doc/bison.texinfo: Update.
21737 * doc/bison.1 (mandoc): Update.
21738 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21739 * src/files.c: Support output files extensions computing.
21740 (src_extension): New static variable.
21741 (header_extension): New static variable.
21742 (tr): New function.
21743 (get_extension_index): New function, gets the index of an extension
21744 filename in a string.
21745 (compute_exts_from_gf): New function, computes extensions from the
21746 grammar file extension.
21747 (compute_exts_from_src): New functions, computes extensions from the
21748 C source file extension, file given by ``-o'' option.
21749 (compute_base_names): Update.
21750 (output_files): Update.
21751
847bf1f5
AD
217522001-08-01 Robert Anisko <anisko_r@epita.fr>
21753
d995fee7 21754 * doc/bison.texi: Document @$.
847bf1f5
AD
21755 (Locations): New section.
21756
d074a105
AD
217572001-07-18 Akim Demaille <akim@epita.fr>
21758
21759 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21760 * config/prev-version.txt, config/move-if-change: New.
21761 * Makefile.am: Adjust.
21762
3419715d
AD
217632001-07-08 Pascal Bart <pascal.bart@epita.fr>
21764
21765 * src/bison.simple (yyparse): Suppress warning `comparaison
21766 between signed and unsigned'.
21767
62ab6972
AD
217682001-07-05 Pascal Bart <pascal.bart@epita.fr>
21769
21770 * src/getargs.h (raw_flag): Remove.
21771 * src/getargs.c: Die on `-r'/`--raw'.
21772 * src/lex.c (parse_percent_token): Die on `%raw'.
21773 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21774 * tests/calc.at: Suppress test with option `--raw'.
21775
1e24cc5b
AD
217762001-07-14 Akim Demaille <akim@epita.fr>
21777
21778 * config/: New.
21779 * configure.in: Require Autoconf 2.50.
21780 Update to gettext 0.10.38.
21781
32dfccf8
AD
217822001-03-16 Akim Demaille <akim@epita.fr>
21783
21784 * doc/bison.texinfo: ANSIfy the examples.
21785
cd5bd6ac
AD
217862001-03-16 Akim Demaille <akim@epita.fr>
21787
21788 * getargs.c (skeleton): New variable.
21789 (longopts): --skeleton is a new option.
21790 (shortopts, getargs): -S is a new option.
21791 * getargs.h: Declare skeleton.
21792 * output.c (output_parser): Use it.
21793
5141b016
AD
217942001-03-16 Akim Demaille <akim@epita.fr>
21795
21796 * m4/strerror_r.m4: New.
21797 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21798 * lib/error.h, lib/error.c: Update.
21799
447992b9
AD
218002001-03-16 Akim Demaille <akim@epita.fr>
21801
21802 * src/getargs.c (longopts): Clean up.
21803
274d42ce
AD
218042001-02-21 Akim Demaille <akim@epita.fr>
21805
21806 * src/reader.c (gensym): `gensym_count' is your own.
21807 Use a static buf to create the symbol name, as token_buffer is no
21808 longer a buffer.
21809
22c821f3
AD
218102001-02-08 Akim Demaille <akim@epita.fr>
21811
21812 * src/conflicts.c (conflict_report): Be sure not to append to res
21813 between two calls, which could happen if both first sprintf were
21814 skipped, but not the first cp += strlen.
21815
18569462
AD
218162001-02-08 Akim Demaille <akim@epita.fr>
21817
21818 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21819 New, from fileutils 4.0.37.
21820 * configure.in: Require Autoconf 2.49c. I took some time before
21821 making this decision. This is the only way out for portability
21822 issues in Bison, it would mean way too much duplicate effort to
21823 import in Bison features implemented in 2.49c since 2.13.
21824 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21825
0d8f3c8a
AD
218262001-02-02 Akim Demaille <akim@epita.fr>
21827
21828 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 21829 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 21830
f17bcd1f
AD
218312001-01-19 Akim Demaille <akim@epita.fr>
21832
21833 Get rid of the ad hoc handling of token_buffer in the scanner: use
21834 the obstacks.
21835
21836 * src/lex.c (token_obstack): New.
21837 (init_lex): Initialize it. No longer call...
21838 (grow_token_buffer): this. Remove it.
21839 Adjust all the places which used it to use the obstack.
21840
511e79b3
AD
218412001-01-19 Akim Demaille <akim@epita.fr>
21842
21843 * src/lex.h: Rename all the tokens:
21844 s/\bENDFILE\b/tok_eof/g;
21845 s/\bIDENTIFIER\b/tok_identifier/g;
21846 etc.
21847 Let them be enums, not #define, to ease debugging.
21848 Adjust all the code.
21849
0d6508ef
AD
218502001-01-18 Akim Demaille <akim@epita.fr>
21851
21852 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21853 * src/lex.c (maxtoken, grow_token_buffer): Static.
21854
6deb4447
AD
218552001-01-18 Akim Demaille <akim@epita.fr>
21856
21857 Since we now use obstacks, more % directives can be enabled.
21858
21859 * src/lex.c (percent_table): Also accept `%yacc',
21860 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21861 `%debug'.
21862 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21863 instead of returning a token.
21864 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21865 * src/reader.c (read_declarations): Adjust.
21866 * src/files.c (open_files): Don't call `compute_base_names', don't
21867 compute `attrsfile' since they depend upon data which might be
21868 *in* the input file now.
21869 (output_files): Do it here.
21870 * src/output.c (output_headers): Document the fact that this patch
21871 introduces a guaranteed SEGV for semantic parsers.
21872 * doc/bison.texinfo: Document them.
21873 * tests/suite.at: Exercise these %options.
21874
ff4423cc
AD
218752000-12-20 Akim Demaille <akim@epita.fr>
21876
21877 Also handle the output file (--verbose) with obstacks.
21878
21879 * files.c (foutput): Remove.
21880 (output_obstack): New.
21881 Adjust all dependencies.
21882 * src/conflicts.c: Return a string.
21883 * src/system.h (obstack_grow_string): Rename as...
21884 (obstack_sgrow): this. Be ready to work with non literals.
21885 (obstack_fgrow4): New.
21886
956dba3a
AD
218872000-12-20 Akim Demaille <akim@epita.fr>
21888
21889 * src/files.c (open_files): Fix the computation of short_base_name
21890 in the case of `-o foo.tab.c'.
21891
337bab46
AD
218922000-12-20 Akim Demaille <akim@epita.fr>
21893
21894 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21895 (copy_dollar): Now that everything uses obstacks, get rid of the
21896 FILE * parameters.
21897
5d3214b8
AD
218982000-12-20 Akim Demaille <akim@epita.fr>
21899
21900 * src/files.c (open_files): Actually the `.output' file is based
21901 on the short_base_name, not base_name.
21902 * tests/suite.at (Checking output file names): Adjust.
21903
29092a57
AD
219042000-12-20 Akim Demaille <akim@epita.fr>
21905
21906 * src/bison.s1: Remove, we now use directly...
21907 * src/bison.simple: this.
21908 * src/Makefile.am: Use pkgdata instead of data.
21909
ea5607fd
AD
219102000-12-20 Akim Demaille <akim@epita.fr>
21911
21912 * src/files.c (guard_obstack): New.
21913 (open_files): Initialize it.
21914 (output_files): Dump it...
21915 * src/files.h: Export it.
21916 * src/reader.c (copy_guard): Use it.
21917
27110317
AD
219182000-12-19 Akim Demaille <akim@epita.fr>
21919
21920 * src/files.c (outfile, defsfile, actfile): Removed as global
21921 vars.
21922 (open_files): Don't compute them.
21923 (output_files): Adjust.
21924 (base_name, short_base_name): Be global.
21925 Adjust dependencies.
21926
19c50364
AD
219272000-12-19 Akim Demaille <akim@epita.fr>
21928
21929 * src/files.c (strsuffix): New.
21930 (stringappend): Be just like strcat but allocate.
21931 (base_names): Eve out from open_files.
21932 Try to simplify the rather hairy computation of base_name and
21933 short_base_name.
21934 (open_files): Use it.
21935 * tests/suite.at (Checking output file names): New test.
21936
573c1d9f
AD
219372000-12-19 Akim Demaille <akim@epita.fr>
21938
21939 * src/system.h (obstack_grow_literal_string): Rename as...
21940 (obstack_grow_string): this.
21941 * src/output.c (output_parser): Recognize `%% actions' instead of
21942 `$'.
21943 * src/bison.s1: s/$/%% actions/.
21944 * src/bison.hairy: Likewise.
21945
ef7ddedd
AD
219462000-12-19 Akim Demaille <akim@epita.fr>
21947
21948 * src/output.c (output_parser): Compute the `#line' lines when
21949 there are.
21950 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21951 Suggested by Hans Aberg.
21952
ff61dabd
AD
219532000-12-19 Akim Demaille <akim@epita.fr>
21954
21955 Let the handling of the skeleton files be local to the procedures
21956 that use it.
21957
21958 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21959 longer static.
21960 (fparser, open_extra_files): Remove.
21961 (open_files, output_files): Don't take care of fparser.
21962 * src/files.h: Adjust.
21963 * src/output.c (output_parser): Open and close the file to the
21964 skeleton.
21965 * src/reader.c (read_declarations): When %semantic_parser, open
21966 fguard.
21967
55b96341
AD
219682000-12-19 Akim Demaille <akim@epita.fr>
21969
21970 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21971 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21972
358c15b7
AD
219732000-12-19 Akim Demaille <akim@epita.fr>
21974
21975 * src/files.c (open_files): Yipee! We no longer need all the code
21976 looking for `/tmp' since we have no tmp file.
21977
7de3329e
AD
219782000-12-19 Akim Demaille <akim@epita.fr>
21979
21980 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21981 New macros.
21982 * src/files.c (open_files): Less dependency on MSDOS etc.
21983
3abcd459
AD
219842000-12-14 Akim Demaille <akim@epita.fr>
21985
21986 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21987 Provide a default definition.
21988 Use it when executing the default @ action.
21989 * src/reader.c (reader_output_yylsp): No longer include
21990 `timestamp' and `text' in the default YYLTYPE.
21991
2a91a95e
AD
219922000-12-12 Akim Demaille <akim@epita.fr>
21993
21994 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21995 (copy_guard): Quote the file names.
21996 Reported by Laurent Mascherpa.
21997
14d3eb9b
AD
219982000-12-12 Akim Demaille <akim@epita.fr>
21999
22000 * src/output.c (output_headers, output_program, output): Be sure
22001 to escape special characters when outputting filenames.
22002 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22003 (output_headers): Don't depend on them, Use ACTSTR.
22004
d7045ec6
AD
220052000-11-17 Akim Demaille <akim@epita.fr>
22006
22007 * lib/obstack.h: Formatting changes.
22008 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22009 prevents type checking.
22010 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22011 cast the value to (void *): assigning a `foo *' to a `void *'
22012 variable is valid.
22013 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22014 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22015 append characters.
22016
6fd54b73
AD
220172000-11-17 Akim Demaille <akim@epita.fr>
22018
22019 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22020 as...
22021 (suite.m4, regression.m4, calc.m4): these.
22022 * tests/atgeneral.m4: Update from CVS Autoconf.
22023
4c50eae6
AD
220242000-11-17 Akim Demaille <akim@epita.fr>
22025
22026 * tests/regression.m4 (%union and --defines): New test,
22027 demonstrating a current bug in the obstack implementation.
22028
a35f64ea
AD
220292000-11-17 Akim Demaille <akim@epita.fr>
22030
22031 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22032 macros.
22033 Use them to declare the variables which are global or local to
22034 `yyparse'.
22035
7de23534
AD
220362000-11-17 Akim Demaille <akim@epita.fr>
22037
22038 * acconfig.h: Remove, no longer used.
22039
aa7815f5
AD
220402000-11-07 Akim Demaille <akim@epita.fr>
22041
22042 * src: s/Copyright (C)/Copyright/g.
22043
5af1f549
AD
220442000-11-07 Akim Demaille <akim@epita.fr>
22045
22046 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22047 defining.
22048 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22049
553e2b22
AD
220502000-11-07 Akim Demaille <akim@epita.fr>
22051
22052 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22053 Merge in a single CPP if/else.
22054
8a4f41d6
AD
220552000-11-07 Akim Demaille <akim@epita.fr>
22056
22057 * src/output.c (output): Remove useless variables.
22058 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22059 argument `data' for consistency with the prototypes.
22060 Qualify it `const'.
22061 (obstack_copy, obstack_copy0): Rename the second argument as
22062 `address' for consistency. Qualify it `const'.
22063 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22064 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22065 `const' their input argument (`data' or `address').
22066 Adjust the corresponding macros to include `const' in casts.
22067
095a3fb5
AD
220682000-11-03 Akim Demaille <akim@epita.fr>
22069
22070 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22071 s/PFILE1/BISON_HAIRY/.
22072 Adjust dependencies.
22073
d1cdce7c
AD
220742000-11-03 Akim Demaille <akim@epita.fr>
22075
090c5ebf 22076 For some reason, this was not applied.
d1cdce7c
AD
22077
22078 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22079 `unlink': it's no longer used.
22080
9311529b
AD
220812000-11-03 Akim Demaille <akim@epita.fr>
22082
22083 * src/files.c (skeleton_find): New function, eved out of...
22084 (open_files, open_extra_files): here.
22085
d8880f69
AD
220862000-11-03 Akim Demaille <akim@epita.fr>
22087
22088 Don't use `atexit'.
22089
22090 * src/files.c (obstack_save): New function.
22091 (done): Rename as...
22092 (output_files): this.
22093 Use `obstack_save'.
22094 * src/main.c (main): Don't use `atexit' to register `done', since
22095 it no longer has to remove tmp files, just call `output_files'
22096 when there are no errors.
22097
0dbb648e
AD
220982000-11-02 Akim Demaille <akim@epita.fr>
22099
22100 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22101 `unlink': it's no longer used.
22102 * src/files.h: Formatting changes.
22103
896fe5c1
AD
221042000-11-02 Akim Demaille <akim@epita.fr>
22105
22106 Remove the last uses of mktemp and unlink/delete.
22107
22108 * src/files.c (fdefines, ftable): Removed.
22109 (defines_ostack, table_obstack): New.
22110 Adjust dependencies of the former into uses of the latter.
22111 * src/output.c (output_short_or_char_table, output_short_table):
22112 Convert to using obstacks.
22113 * src/reader.c (copy_comment2): Accept one FILE * and two
22114 obstacks.
22115 (output_token_defines, reader_output_yylsp): Use obstacks.
22116 * src/system.h (obstack_fgrow3): New.
1f65350a 22117 * po/POTFILES.in: Adjust.
896fe5c1 22118
dd60faec
AD
221192000-11-01 Akim Demaille <akim@epita.fr>
22120
22121 Change each use of `fattrs' into a use of `attrs_obstack'.
22122
22123 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22124 * src/files.c (fattrs): Remove.
22125 (attrs_obstack): New.
22126 Adjust all dependencies.
22127 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22128
8c7ebe49
AD
221292000-11-01 Akim Demaille <akim@epita.fr>
22130
22131 Introduce obstacks.
22132 Change each use of `faction' into a use of `action_obstack'.
22133
22134 * lib/obstack.h, lib/obstack.c: New files.
22135 * src/files.c (faction): Remove.
22136 (action_obstack): New.
22137 Adjust all dependencies.
22138
77aee789
AD
221392000-10-20 Akim Demaille <akim@epita.fr>
22140
22141 * lib/quote.h (PARAMS): New macro. Use it.
22142
43591cec
AD
221432000-10-16 Akim Demaille <akim@epita.fr>
22144
22145 * src/output.c (output_short_or_char_table): New function.
22146 (output_short_table, output_token_translations): Use it.
22147 (goto_actions): Use output_short_table.
22148
1e9798d5
AD
221492000-10-16 Akim Demaille <akim@epita.fr>
22150
22151 * src/symtab.c (bucket_new): New function.
22152 (getsym): Use it.
22153
22154 * src/output.c (output_short_table): New argument to display the
22155 comment associated with the table.
22156 Adjust dependencies.
22157 (output_gram): Use it.
22158 (output_rule_data): Nicer output layout for YYTNAME.
22159
f282676b
AD
221602000-10-16 Akim Demaille <akim@epita.fr>
22161
22162 * src/lex.c (read_typename): New function.
22163 (lex): Use it.
22164 * src/reader.c (copy_dollar): Likewise.
22165
550a72a3
AD
221662000-10-16 Akim Demaille <akim@epita.fr>
22167
22168 * src/reader.c (copy_comment2): Expect the input stream to be on
22169 the `/' which is suspected to open a comment, instead of being
22170 called after `//' or `/*' was read.
22171 (copy_comment, copy_definition, parse_union_decl, copy_action)
22172 (copy_guard): Adjust.
22173
131e2fef
AD
221742000-10-16 Akim Demaille <akim@epita.fr>
22175
22176 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22177 `read_signed_integer'.
22178
79282c5a
AD
221792000-10-16 Akim Demaille <akim@epita.fr>
22180
22181 * src/reader.c (copy_dollar): New function.
22182 (copy_guard, copy_action): Use it.
22183
ff4a34be
AD
221842000-10-16 Akim Demaille <akim@epita.fr>
22185
22186 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22187 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22188 New files, from Fileutils 4.0.27.
22189 * src/main.c (printable_version): Remove.
22190 * src/lex.c, src/reader.c: Use `quote'.
22191
221922000-10-04 Akim Demaille <akim@epita.fr>
22193
22194 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22195
14ded682
AD
221962000-10-04 Akim Demaille <akim@epita.fr>
22197
22198 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22199
8e03724b
AD
222002000-10-04 Akim Demaille <akim@epita.fr>
22201
22202 When a literal string is used to define two different tokens,
22203 `bison -v' segfaults.
22204 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22205
22206 * tests/regression.m4: New file.
22207 Include the core of the sample provided by Piotr Gackiewicz.
22208 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22209 properly.
22210
a9e64249
AD
222112000-10-04 Akim Demaille <akim@epita.fr>
22212
22213 * src/reader.c (parse_expect_decl): Keep `count' within the size
22214 of `buffer'.
22215 From Neil Booth.
22216
da9abf43
AD
222172000-10-02 Paul Eggert <eggert@twinsun.com>
22218
22219 * bison.s1 (yyparse): Assign the default value
22220 unconditionally, to avoid a GCC warning and make the parser a
22221 tad smaller.
22222
c33638bb
AD
222232000-10-02 Akim Demaille <akim@epita.fr>
22224
22225 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22226 options.
22227
444c570a
AD
222282000-10-02 Akim Demaille <akim@epita.fr>
22229
22230 * src/derives.c, src/print.c, src/reduce.c: To ease the
22231 translation, move some `\n' out of the translated strings.
22232
89cab50d
AD
222332000-10-02 Akim Demaille <akim@epita.fr>
22234
22235 The location tracking mechanism is precious for parse error
22236 messages. Nevertheless, it is enabled only when `@n' is used in
22237 the grammar, which is a different issue (you can use it in error
22238 message, but not in the grammar per se). Therefore, there should
22239 be another means to enable it.
22240
22241 * src/getargs.c (getargs): Support `--locations'.
22242 (usage): Report it.
22243 * src/getargs.h (locationsflag): Export it.
22244 * src/lex.c (percent_table): Support `%locations'.
22245 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22246 with `locationsflag'.
22247 * doc/bison.texinfo: Document `--locations' and `%locations'.
22248 Sort the options.
22249 * tests/calc.m4: Test it.
22250
22251 For regularity of the names, replace each
22252 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22253 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22254 In addition replace each `flag' with `_flag'.
22255
d6c2cba0
AD
222562000-10-02 Akim Demaille <akim@epita.fr>
22257
22258 Also test parse error messages, including with YYERROR_VERBOSE.
22259
22260 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22261 associative).
22262 Use it to check the computations.
22263 Use it to check `nonassoc' is honored.
22264 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22265 `--yyerror-verbose'.
22266 (_AT_CHECK_CALC): Adjust to this option.
22267 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22268
5a35a6cb
AD
222692000-10-02 Akim Demaille <akim@epita.fr>
22270
22271 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22272 the latter demonstrates a flaw in the handling of non debugging
22273 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22274 was used in order to simplify:
22275
22276 #if YYDEBUG
22277 if (yydebug)
22278 {
22279 ...
22280 }
22281 #endif
22282
22283 into
22284
22285 if (yydebug)
22286 {
22287 ...
22288 }
22289
22290 unfortunately this leads to a CPP conflict when
22291 `--name-prefix=foo' is used since it produces `#define yydebug
22292 foodebug'.
22293
22294 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22295 (YYDPRINTF): New macro.
22296 Spread its use.
22297 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22298 the bison options.
22299 Also test `--verbose', `--defines' and `--name-prefix'.
22300
71da9eea
AD
223012000-10-02 Akim Demaille <akim@epita.fr>
22302
22303 Improve the readability of the produced parsers.
22304
22305 * src/bison.s1: Formatting changes.
22306 Improve the comment related to the `$' mark.
22307 (yydefault): Don't fall through to `yyresume': `goto' there.
22308 * src/output.c (output_parser): When the `$' is met, skip the end
22309 of its line.
22310 New variable, `number_of_dollar_signs', to check there's exactly
22311 one `$' in the parser skeleton.
22312
95e36146
AD
223132000-10-02 Akim Demaille <akim@epita.fr>
22314
22315 * lib/xstrdup.c: New file, from the fileutils.
22316 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22317 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22318 instead of strlen + xmalloc + strcpy.
22319 * src/symtab.c (copys): Remove, use xstrdup instead.
22320
d7020c20
AD
223212000-10-02 Akim Demaille <akim@epita.fr>
22322
22323 * src/gram.h (associativity): New enum type which replaces the
22324 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22325 `right_assoc', `left_assoc' and `non_assoc'.
22326 Adjust all dependencies.
22327 * src/reader.c: Formatting changes.
22328 (LTYPESTR): Don't define it, use it as a literal in
22329 `reader_output_yylsp'.
22330 * src/symtab.h (symbol_class): New enum type which replaces the
22331 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22332 `sunknown', `stoken and `snterm'.
22333
1916f98e
AD
223342000-10-02 Akim Demaille <akim@epita.fr>
22335
22336 * src/getargs.c (fixed_outfiles): Rename as...
22337 (yaccflag): for consistency and accuracy.
22338 Adjust dependencies.
22339
d7913476
AD
223402000-10-02 Akim Demaille <akim@epita.fr>
22341
22342 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22343 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22344 difficult and introduced a lot of core dump. It turns out that
22345 Bison used an implementation of `xmalloc' based on `calloc', and
22346 at various places it does depend upon the initialization to 0. I
22347 have not tried to isolate the pertinent places, and all the former
22348 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22349 someone should address this issue.
22350
22351 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22352 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22353 files.
22354 Adjust dependencies.
22355 * src/warshall.h: New file.
22356 Propagate.
22357
340ef489
AD
223582000-10-02 Akim Demaille <akim@epita.fr>
22359
22360 Various anti-`extern in *.c' changes.
22361
22362 * src/system.h: Include `assert.h'.
22363
b2ca4022
AD
223642000-10-02 Akim Demaille <akim@epita.fr>
22365
22366 * src/state.h (nstates, final_state, first_state, first_shift)
22367 (first_reduction): Move their exportation from here...
22368 * src/LR0.h: to here.
22369 Adjust dependencies.
22370 * src/getargs.c (statisticsflag): New variable.
22371 Add support for `--statistics'.
22372 Adjust dependencies.
22373
22374 Remove a lot of now useless `extern' statements in most files.
22375
403b315b
AD
223762000-10-02 Akim Demaille <akim@epita.fr>
22377
22378 * src/LR0.h: New file.
22379 Propagate its use.
22380
07a58c13
AD
223812000-10-02 Akim Demaille <akim@epita.fr>
22382
22383 * src/print.h: New file.
22384 Propagate its use.
22385 * src/print.c: Formatting and ordering changes.
22386 (verbose, terse): Replace with...
22387 (print_results): this new function.
22388 Adjust dependencies.
22389
0619caf0
AD
223902000-10-02 Akim Demaille <akim@epita.fr>
22391
22392 * src/conflicts.c (conflict_report): New function.
22393 (conflict_log, verbose_conflict_log): Replace with...
22394 (print_conflicts): this function.
22395 Adjust dependencies.
22396 * src/conflicts.h: New file.
22397 Propagate its inclusion.
22398
3519ec76
AD
223992000-10-02 Akim Demaille <akim@epita.fr>
22400
22401 * src/nullable.h: New file.
22402 Propagate its inclusion.
22403 * src/nullable.c: Formatting changes.
22404
015acc48
AD
224052000-10-02 Akim Demaille <akim@epita.fr>
22406
22407 * src/reduce.h: New file.
22408 Propagate its inclusion.
22409 * src/reduce.c: Topological sort and other formatting changes.
22410 (bool, TRUE, FALSE): Move their definition to...
22411 * src/system.h: here.
22412
8963a27b
AD
224132000-10-02 Akim Demaille <akim@epita.fr>
22414
22415 * src/files.c: Formatting changes.
22416 (tryopen, tryclose, openfiles): Rename as...
22417 (xfopen, xfclose, open_files): this.
22418 (stringappend): static.
22419 * src/files.h: Complete the list of exported symbols.
22420 Propagate its use.
22421
a70083a3
AD
224222000-10-02 Akim Demaille <akim@epita.fr>
22423
22424 * src/reader.h: New file.
22425 Propagate its use instead of tedious list of `extern' and
22426 prototypes.
22427 * src/reader.c: Formatting changes, topological sort,
22428 s/register//.
22429
abadc117
AD
224302000-10-02 Akim Demaille <akim@epita.fr>
22431
22432 * src/lex.h: Prototype `lex.c' exported functions.
22433 * src/reader.c: Adjust.
22434 * src/lex.c: Formatting changes.
22435 (safegetc): Rename as...
22436 (xgetc): this.
22437
720d742f
AD
224382000-10-02 Akim Demaille <akim@epita.fr>
22439
22440 * src/lalr.h: New file.
22441 Propagate its inclusion instead of prototypes and `extern'.
22442 * src/lalr.c: Formatting changes, topological sorting etc.
22443
f2acea59
AD
224442000-10-02 Akim Demaille <akim@epita.fr>
22445
22446 * src/output.c (token_actions): Introduce a temporary array,
22447 YYDEFACT, that makes it possible for this function to use
22448 output_short_table.
22449
d019d655
AD
224502000-10-02 Akim Demaille <akim@epita.fr>
22451
22452 `user_toknums' is output as a `short[]' in `output.c', while it is
22453 defined as a `int[]' in `reader.c'. For consistency with the
22454 other output tables, `user_toknums' is now defined as a table of
22455 shorts.
22456
22457 * src/reader.c (user_toknums): Be a short table instead of an int
22458 table.
22459 Adjust dependencies.
22460
22461 Factor the short table outputs.
22462
22463 * src/output.c (output_short_table): New function.
22464 * src/output.c (output_gram, output_stos, output_rule_data)
22465 (output_base, output_table, output_check): Use it.
22466
6c89f1c1
AD
224672000-10-02 Akim Demaille <akim@epita.fr>
22468
22469 * src/output.c (output): Topological sort of the functions, in
22470 order to get rid of the `static' prototypes.
22471 No longer use `register'.
22472 * src/output.h: New file.
22473 Propagate its inclusion in files explicitly prototyping functions
22474 from output.c.
22475
d9efd181
AD
224762000-09-21 Akim Demaille <akim@epita.fr>
22477
22478 * src/atgeneral.m4: Update from Autoconf.
22479
c29240e7 224802000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
22481
22482 * src/closure.h: New file.
22483 * src/closure.c: Formatting changes, topological sort over the
22484 functions, use of closure.h.
22485 (initialize_closure, finalize_closure): Rename as...
22486 (new_closure, free_closure): these. Adjust dependencies.
22487 * src/LR0.c: Formatting changes, topological sort, use of
22488 cloture.h.
22489 (initialize_states): Rename as...
22490 (new_states): this.
22491 * src/Makefile.am (noinst_HEADERS): Adjust.
22492
499daa50
AD
224932000-09-20 Akim Demaille <akim@epita.fr>
22494
22495 * src/acconfig.h: Don't protect config.h against multiple
22496 inclusion.
22497 Don't define PARAMS.
22498 * src/system.h: Define PARAMS.
22499 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22500 purpose of config.h. system.h must not try to fix wrong
22501 definitions in config.h.
22502
cc84fd5d
AD
225032000-09-20 Akim Demaille <akim@epita.fr>
22504
22505 * src/derives.h: New file.
22506 * src/main.c, src/derives.h: Use it.
22507 Formatting changes.
22508 * src/Makefile.am (noinst_HEADERS): Adjust.
22509
db5b3a89
AD
225102000-09-20 Akim Demaille <akim@epita.fr>
22511
22512 * tests/atgeneral.m4: Update from Autoconf.
22513 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22514 (AT_CHECK_CALC): New macros.
22515 Use these macros to test bison with options `', `--raw',
22516 `--debug', `--yacc', `--yacc --debug'.
22517
ceed8467
AD
225182000-09-19 Akim Demaille <akim@epita.fr>
22519
22520 * src/output.c: Formatting changes.
22521 * src/machine.h: Remove, leaving its contents in...
22522 * src/system.h: here.
22523 Include stdio.h.
22524 Adjust all dependencies on stdio.h and machine.h.
22525 * src/getargs.h: New file.
22526 Let all `extern' declarations about getargs.c be replaced with
22527 inclusion of `getargs.h'.
22528 * src/Makefile.am (noinst_HEADERS): Adjust.
22529
22530 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22531 scope.
22532 (yyerror): Returns void, not int.
22533 * doc/bison.texinfo: Formatting changes.
22534
05a1d24b
AD
225352000-09-19 Akim Demaille <akim@epita.fr>
22536
22537 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22538 portable.
22539
cbd25751
AD
225402000-09-18 Akim Demaille <akim@epita.fr>
22541
22542 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22543 * src/Makefile.am (INCLUDES): Don't.
22544 Be ready to fetch headers in lib/.
22545
13863333
AD
225462000-09-18 Akim Demaille <akim@epita.fr>
22547
22548 * doc/bison.texinfo: Update the copyright.
22549 ANSIfy and GNUify the examples.
22550 Remove the old menu.
22551
0d533154
AD
225522000-09-18 Akim Demaille <akim@epita.fr>
22553
22554 First set of tests: use the `calc' example from the documentation.
22555
22556 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22557 is defined only when YYDEBUG is.
22558 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22559 * src/files.c (tryopen, tryclose): Formatting changes.
22560 Move to the top and be static.
22561 * src/reader.c (read_signed_integer): Likewise.
22562 * tests/calc.m4: New file.
22563 * Makefile.am, suite.m4: Adjust.
22564 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22565
e79137ac
AD
225662000-09-18 Akim Demaille <akim@epita.fr>
22567
22568 Add support for an Autotest test suite for Bison.
22569
22570 * m4/m4.m4, m4/atconfig.m4: New files.
22571 * m4/Makefile.am (EXTRA_DIST): Adjust.
22572 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22573 files.
22574 * src/getargs.c: Display a more standard --version message.
22575 * src/reader.c (reader): Formatting changes.
22576 No longer depend upon VERSION_STRING.
22577 * configure.in: No longer use `dnl'.
22578 Set up the test suite and the new directory `tests/.
22579 (VERSION_STRING): Remove.
22580
27821bff
AD
225812000-04-14 Akim Demaille <akim@epita.fr>
22582
22583 * src/reader.c (copy_comment2): New function, same as former
22584 `copy_comment', but outputs into two FILE *.
22585 (copy_comment): Use it.
22586 (parse_union_decl): Use it.
22587 (get_type, parse_start_decl): Use the same `invalid' message.
22588 (parse_start_decl, parse_union_decl): Use the same `multiple'
22589 message.
22590 (parse_union_decl, copy_guard, copy_action): Use the same
22591 `unmatched' message.
22592 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22593
cfe5fbc0
AD
225942000-03-31 Akim Demaille <akim@epita.fr>
22595
22596 * src/files.c (tryopen, tryclose): Move to the top.
22597 Be static.
22598
cb7db13e
AD
225992000-03-31 Akim Demaille <akim@epita.fr>
22600
22601 * src/main.c (main): Don't call `done', exit does it.
22602
a0f6b076
AD
226032000-03-31 Akim Demaille <akim@epita.fr>
22604
36281465
AD
22605 * allocate.c: s/return (foo)/return foo/.
22606 * lalr.c: Likewise.
22607 * LR0.c: Likewise.
22608 * output.c: Likewise.
22609 * reader.c: Likewise.
22610 * symtab.c: Likewise.
22611 * vmsgetargs.c: Likewise.
22612
226132000-03-31 Akim Demaille <akim@epita.fr>
22614
22615 Clean up the error reporting functions.
a0f6b076
AD
22616
22617 * src/report.c: New file.
22618 * src/report.h: Likewise.
22619 * src/Makefile.am: Adjust.
22620 * m4/error.m4: New file.
22621 * m4/Makefile.am: Adjust.
22622 * configure.in (jm_PREREQ_ERROR): Call it.
22623 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22624 Remove.
22625 (fatal, fatals): Remove. All callers use complain.c::fatal.
22626 (warn, warni, warns, warnss, warnss): Remove. All callers use
22627 complain.c::complain.
22628 (toomany): Remove, use fatal instead.
22629 * src/files.c (done): No argument, use complain_message_count.
22630 * src/main.c (main): Register `done' to `atexit'.
22631
22632 * src/getargs.c (usage): More `fputs', less `fprintf'.
22633
18539825
AD
226342000-03-28 Akim Demaille <akim@epita.fr>
22635
22636 * lib/: New directory.
22637 * Makefile.am (SUBDIRS): Adjust.
22638 * configure.in: Adjust.
22639 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22640 useless.
22641 * src/alloca.c: Moved to lib/.
22642 * src/getopt.c: Likewise.
22643 * src/getopt1.c: Likewise.
22644 * src/getopt.h: Likewise.
22645 * src/ansi2knr.c: Likewise.
22646 * src/ansi2knr.1: Likewise.
22647 * src/Makefile.am: Adjust.
22648 * lib/Makefile.am: New file.
22649
9f306f2a
AD
226502000-03-28 Akim Demaille <akim@epita.fr>
22651
22652 * src/getargs.c (usage): Refresh the help message.
22653
0ba347b6
AD
226542000-03-17 Akim Demaille <akim@epita.fr>
22655
22656 * src/getopt1.c: Updated from textutils 2.0e
22657 * src/getopt.c: Likewise.
22658 * src/getopt.h: Likewise.
22659
dbe7f271
AD
226602000-03-17 Akim Demaille <akim@epita.fr>
22661
22662 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22663 the file name, not the whole `#line LINE FILE'.
22664
75bbe78d
AD
226652000-03-17 Akim Demaille <akim@epita.fr>
22666
22667 On syntax errors, report the token on which we choked.
22668
aa5fd0ee
AD
22669 * src/bison.s1 (yyparse): In the label yyerrlab, when
22670 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 22671
7b306f52
AD
226722000-03-17 Akim Demaille <akim@epita.fr>
22673
aa5fd0ee 22674 * src/reader.c (copy_at): New function.
7b306f52
AD
22675 (copy_guard): Use it.
22676 (copy_action): Use it.
22677
e87b5700
AD
226782000-03-17 Akim Demaille <akim@epita.fr>
22679
22680 Be kind to translators, save some useless translations.
22681
aa5fd0ee 22682 * src/main.c (banner): New function.
e87b5700
AD
22683 (fatal_banner): Use it.
22684 (warn_banner): Use it.
22685
ae3c3164
AD
226862000-03-17 Akim Demaille <akim@epita.fr>
22687
aa5fd0ee
AD
22688 * src/reader.c (copy_definition): Use copy_string and
22689 copy_comment. Removed now unused `match', `ended',
22690 `cplus_comment'.
ae3c3164
AD
22691 (copy_comment, copy_string): Moved, to be visible from
22692 copy_definition.
22693
4dc58e7c
AD
226942000-03-17 Akim Demaille <akim@epita.fr>
22695
aa5fd0ee
AD
22696 * src/reader.c (copy_string): Declare `static inline'. No
22697 problems with inline, since it is checked by configure.
4dc58e7c
AD
22698 (copy_comment): Likewise.
22699
0a6384c4
AD
227002000-03-17 Akim Demaille <akim@epita.fr>
22701
aa5fd0ee 22702 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 22703
3cef001a
AD
227042000-03-17 Akim Demaille <akim@epita.fr>
22705
aa5fd0ee 22706 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
22707 (copy_action): Use it. Removed now unused `match', `ended',
22708 `cplus_comment'.
22709 (copy_guard): Likewise.
22710
ca36d2ef
AD
227112000-03-17 Akim Demaille <akim@epita.fr>
22712
aa5fd0ee 22713 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
22714 (copy_action): Use it.
22715 (copy_guard): Likewise.
22716
6666f98f
AD
227172000-03-17 Akim Demaille <akim@epita.fr>
22718
22719 Change the handling of @s so that they behave exactly like $s.
22720 There is now a pseudo variable @$ (readble and writable), location
22721 of the lhs of the rule (by default ranging from the location of
22722 the first symbol of the rhs, to the location of the last symbol,
22723 or, if the rhs is empty, YYLLOC).
22724
22725 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22726 yyval.
22727 (yyparse): When providing a default semantic action, provide a
22728 default location action.
22729 (after the $): No longer change `*YYLSP', just stack YYLOC the
22730 same way you stack YYVAL.
22731 * src/reader.c (read_declarations): Use warns.
22732 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22733 (copy_action, case '@'): Likewise.
22734 Use a standard error message, to save useless work from
22735 translators.
22736
41aca2e0
AD
227372000-03-17 Akim Demaille <akim@epita.fr>
22738
aa5fd0ee
AD
22739 * src/bison.s1: Formatting and cosmetics changes.
22740 * src/reader.c: Likewise.
41aca2e0
AD
22741 Update the Copyright notice.
22742
dc08c1d5
AD
227432000-03-17 Akim Demaille <akim@epita.fr>
22744
aa5fd0ee
AD
22745 * src/bison.s1 (#line): All set to `#line' only, since the
22746 Makefile now handles them.
dc08c1d5 22747
9ee3c97b
AD
227482000-03-16 Akim Demaille <akim@epita.fr>
22749
22750 * src/output.c (output_rule_data): Output the documentation of
22751 some of the tables.
22752 (Copyright notice): Update.
22753 Formatting changes.
22754
0de741ca
AD
227552000-03-16 Akim Demaille <akim@epita.fr>
22756
22757 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22758 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22759 One `#if YYDEBUG' remains, since it uses variables which are
22760 defined only if `YYDEBUG != 0'.
22761
bb10be54
AD
227622000-03-16 Akim Demaille <akim@epita.fr>
22763
22764 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22765 and related variables so that the similarities are highlighted.
22766
b07b484a
AD
227672000-03-16 Akim Demaille <akim@epita.fr>
22768
22769 * src/bison.s1: Properly indent CPP directives.
22770
361f60b3
AD
227712000-03-16 Akim Demaille <akim@epita.fr>
22772
22773 * src/bison.s1: Properly indent the `alloca' CPP section.
22774
8c44d3ec
AD
227752000-03-16 Akim Demaille <akim@epita.fr>
22776
22777 Do not hard code values of directories in `configure.in'.
22778 Update the `configure' tool chain.
22779
22780 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22781 src/makefile.am.
22782 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22783 (AC_OUTPUT): Add m4/Makefile.
22784 Bump to bison 1.28a, 1.29 has never been released.
22785 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22786 handled via src/Makefile.am.
22787 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22788 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22789 autoheader.
22790 * Makefile.am (SUBDIRS): Add m4.
22791 (ACLOCAL_AM_FLAGS): New variable.
22792 (AUTOMAKE_OPTIONS): Add check-news.
22793 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22794 the proper line number and file name.
22795 (DEFS): Propagate the location of bison library files and of the
22796 locale files.
22797 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22798 builddir.
22799 * acinclude.m4: Remove, replaced by the directory m4.
22800 * m4/Makefile.am (EXTRA_DIST): New variable.
22801 * m4/gettext.m4: New file, from the fileutils.
22802 * m4/lcmessage.m4: Likewise
22803 * m4/progtest.m4: Likewise.
22804 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22805
f95997e7
AD
228062000-03-10 Akim Demaille <akim@epita.fr>
22807
22808 * src/closure.c:
22809 Formatting changes of various comments.
22810 Respect the GNU coding standards at various places.
22811 Don't use `_()' when no translation is needed.
22812
228131999-12-13 Jesse Thilo <jthilo@gnu.org>
22814
22815 * src/files.c:
22816 OS/2 honors TMPDIR environment variable.
22817
228181999-12-13 Jesse Thilo <jthilo@gnu.org>
22819
22820 * doc/bison.texinfo: Tweaked spelling and grammar.
22821 Updated ISBN.
22822 Removed reference to price of printed copy.
22823 Mention BISON_SIMPLE and BISON_HAIRY.
22824
228251999-12-13 Jesse Thilo <jthilo@gnu.org>
22826
22827 * configure.in, NEWS:
22828 Bison 1.29 released.
22829
228301999-10-27 Jesse Thilo <jthilo@gnu.org>
22831
22832 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22833 Added reference card.
22834
228351999-07-26 Jesse Thilo <jthilo@gnu.org>
22836
22837 * po/ru.po: Added Russian translation.
22838
228391999-07-26 Jesse Thilo <jthilo@gnu.org>
22840
22841 * configure.in: Added Russian translation.
22842
228431999-07-06 Jesse Thilo <jthilo@gnu.org>
22844
22845 * configure.in, NEWS, README:
22846 Released version 1.28.
22847
228481999-06-14 Jesse Thilo <jthilo@gnu.org>
22849
22850 * src/system.h:
22851 Squashed redefinition warning on some systems.
22852
22853 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22854 Have configure build version string instead of relying on ANSI string
22855 concatentation.
22856
228571999-06-14 Jesse Thilo <jthilo@gnu.org>
22858
22859 * po/POTFILES.in: Got rid of version.c.
22860
228611999-06-14 Jesse Thilo <jthilo@gnu.org>
22862
22863 * acconfig.h, configure.in:
22864 Have configure build version string instead of relying on ANSI string
22865 concatentation.
22866
228671999-06-08 Jesse Thilo <jthilo@gnu.org>
22868
22869 * doc/bison.1:
22870 Dropped mention of `+' for long-named options.
22871
228721999-05-30 Jesse Thilo <jthilo@gnu.org>
22873
22874 * src/files.c: Added <unistd.h> for unlink().
22875
22876 * src/Makefile.am, src/system.h:
22877 I18n fixes.
22878
228791999-05-30 Jesse Thilo <jthilo@gnu.org>
22880
22881 * README: Added a FAQ list.
22882
22883 * configure.in, acconfig.h:
22884 I18n fixes.
22885
228861999-05-30 Jesse Thilo <jthilo@gnu.org>
22887
22888 * doc/FAQ, doc/Makefile.am:
22889 Added a FAQ list.
22890
228911999-05-19 Jesse Thilo <jthilo@gnu.org>
22892
22893 * src/alloc.h, src/symtab.h, src/version.c:
22894 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22895
228961999-04-18 Jesse Thilo <jthilo@gnu.org>
22897
22898 * src/.cvsignore, src/Makefile.am:
22899 Reorganized: sources in `src', documentation in `doc'.
22900
22901 * src/lex.c (literalchar):
22902 fixed the code for escaping double quotes (thanks
22903 Jonathan Czisny.)
22904
229051999-04-18 Jesse Thilo <jthilo@gnu.org>
22906
22907 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22908 Adjusted paths to reflect directory reorganization.
22909
229101999-04-18 Jesse Thilo <jthilo@gnu.org>
22911
22912 * doc/.cvsignore, doc/Makefile.am:
22913 Reorganized: sources in `src', documentation in `doc'.
22914
229151999-04-18 Jesse Thilo <jthilo@gnu.org>
22916
22917 * configure.in:
22918 Updated AC_INIT file to reflect directory reorganization.
22919
22920 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22921 Reorganized: sources in `src', documentation in `doc'.
22922
229231999-04-13 Jesse Thilo <jthilo@gnu.org>
22924
22925 * src/allocate.c:
22926 Don't declare calloc() and realloc() if not necessary.
22927
229281999-04-13 Jesse Thilo <jthilo@gnu.org>
22929
22930 * configure.in, acconfig.h, acinclude.m4:
22931 Don't declare calloc() and realloc() if not necessary.
22932
229331999-03-23 Jesse Thilo <jthilo@gnu.org>
22934
22935 * po/.cvsignore: Added i18n support.
22936
229371999-03-23 Jesse Thilo <jthilo@gnu.org>
22938
22939 * acconfig.h, configure.in, Makefile.am:
22940 Added i18n support.
22941
229421999-03-22 Jesse Thilo <jthilo@gnu.org>
22943
22944 * src/bison.s1: Fixed #line numbers.
22945
229461999-03-15 Jesse Thilo <jthilo@gnu.org>
22947
22948 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22949 Added PO files from Translation Project.
22950
229511999-03-03 Jesse Thilo <jthilo@gnu.org>
22952
22953 * Makefile.am:
22954 Added support for non-ANSI compilers (ansi2knr).
22955
229561999-02-16 Jesse Thilo <jthilo@gnu.org>
22957
22958 * configure.in: Bumped version number to 1.27.
22959
22960 * Makefile.am:
22961 Added `bison.simple' to list of files removed by `make distclean'.
22962
229631999-02-12 Jesse Thilo <jthilo@gnu.org>
22964
22965 * src/files.c, src/files.h:
22966 Defined locations of parser files in config.h instead of Makefile.
22967
229681999-02-12 Jesse Thilo <jthilo@gnu.org>
22969
22970 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22971 Defined locations of parser files in config.h instead of Makefile.
22972
229731999-02-09 Jesse Thilo <jthilo@gnu.org>
22974
22975 * Makefile.am:
22976 Removed inappropriate use of $< macro.
22977
229781999-02-05 Jesse Thilo <jthilo@gnu.org>
22979
22980 * po/Makefile.in.in, po/POTFILES.in:
22981 Add `po' directory skeleton.
22982
229831999-01-27 Jesse Thilo <jthilo@gnu.org>
22984
22985 * README: Document help-bison list.
22986
22987 * configure.in: Add check for mkstemp().
22988
229891999-01-20 Jesse Thilo <jthilo@gnu.org>
22990
22991 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22992 Hush a few compiler warnings.
22993
22994 * src/files.c:
22995 Add tryclose(), which verifies that fclose was successful.
22996 Hush a couple of compiler warnings.
22997
229981999-01-20 Jesse Thilo <jthilo@gnu.org>
22999
23000 * Makefile.am, OChangeLog:
23001 ChangeLog is now automatically generated. Include the old version as
23002 OChangeLog.
23003
230041999-01-14 Jesse Thilo <jthilo@gnu.org>
23005
23006 * 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:
23007 Update FSF address.
23008
230091999-01-14 Jesse Thilo <jthilo@gnu.org>
23010
23011 * doc/bison.texinfo: Fix formatting glitch.
23012
23013 * doc/bison.texinfo: Update FSF address.
23014
230151999-01-14 Jesse Thilo <jthilo@gnu.org>
23016
23017 * acconfig.h: Update FSF address.
23018
230191999-01-08 Jesse Thilo <jthilo@gnu.org>
23020
23021 * src/system.h:
23022 Don't define PACKAGE here, since config.h defines it.
23023
230241998-12-30 Jesse Thilo <jthilo@gnu.org>
23025
23026 * src/reader.c: Update copyright date.
23027
23028 * src/main.c:
23029 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23030 favor of output directly to stderr (avoids buffer overruns).
23031
23032 * src/reader.c: Some checks for premature EOF.
23033
23034 * 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:
23035 Use prototypes if the compiler understands them.
23036
23037 * src/files.c: Honor TMPDIR on Unix hosts.
23038 Use prototypes if the compiler understands them.
23039
23040 * src/reader.c:
23041 Fix a couple of buffer overrun bugs.
23042 Use prototypes if the compiler understands them.
23043
23044 * src/system.h: Include unistd.h and ctype.h.
23045 Use #ifdef instead of #if for NLS symbols.
23046
230471998-12-30 Jesse Thilo <jthilo@gnu.org>
23048
23049 * doc/bison.texinfo:
23050 Delete comment "consider using @set for edition number, etc..." since
23051 we now are doing so.
23052
230531998-12-30 Jesse Thilo <jthilo@gnu.org>
23054
23055 * configure.in:
23056 Use prototypes if the compiler understands them.
23057
23058 * NEWS: Document 1.26 highlights.
23059
23060 * Makefile.am: Require Automake 1.3 or later.
23061
23062 * acconfig.h:
23063 Use prototypes if the compiler understands them.
23064
230651998-12-29 Jesse Thilo <jthilo@gnu.org>
23066
23067 * src/version.c:
23068 Use VERSION symbol from automake for version number.
23069
230701998-12-29 Jesse Thilo <jthilo@gnu.org>
23071
23072 * acconfig.h, configure.in, version.cin:
23073 Use VERSION symbol from automake for version number.
23074
230751998-11-28 Jesse Thilo <jthilo@gnu.org>
23076
23077 * Makefile.am:
23078 Distribute original version of simple parser (bison.s1), not built
23079 version (bison.simple).
23080
230811998-11-28 Jesse Thilo <jthilo@gnu.org>
23082
23083 * doc/bison.texinfo: Add info dir entry.
23084
23085 * doc/bison.texinfo:
23086 Let automake put version number into documentation.
23087
230881998-11-26 Jesse Thilo <jthilo@gnu.org>
23089
23090 * src/bison.cld, src/build.com, src/vmshlp.mar:
23091 Add non-RCS files from /gd/gnu/bison.
23092
230931998-11-26 Jesse Thilo <jthilo@gnu.org>
23094
23095 * doc/bison.1:
23096 Document the BISON_HAIRY and BISON_SIMPLE variables.
23097
230981998-11-25 Jesse Thilo <jthilo@gnu.org>
23099
23100 * src/version.c: Build version.c automatically.
23101
23102 * src/reader.c:
23103 Fix token numbering (used to start at 258, not 257).
23104
23105 * src/system.h: Include config.h.
23106
23107 * src/getargs.c: Update bug report address.
23108
23109 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23110 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23111
231121998-11-25 Jesse Thilo <jthilo@gnu.org>
23113
23114 * Makefile.am:
23115 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23116
23117 * configure.in, version.cin:
23118 Build version.c automatically.
23119
23120 * AUTHORS: Add AUTHORS file.
23121
23122 * README: Update bug report address.
23123
23124 * bison.simple:
23125 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23126
23127 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23128 Add automake stuff.
23129
231301998-11-25 Jesse Thilo <jthilo@gnu.org>
23131
23132 * doc/bison.texinfo: Clean up some formatting.
23133
231341998-05-05 Richard Stallman <rms@gnu.org>
23135
23136 * doc/bison.texinfo:
23137 Explain better why to make a pure parser.
23138
231391998-01-05 Richard Stallman <rms@gnu.org>
23140
23141 * src/files.c (openfiles):
23142 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23143 find a temporary directory, if possible. Do not unlink files while
23144 they are open.
23145
231461997-08-25 Richard Stallman <rms@gnu.org>
23147
23148 * src/reader.c (stack_offset;):
23149 Change some warni to warns.
23150
23151 * src/lex.c (literalchar): Use warns, not warni.
23152
231531997-06-28 Richard Stallman <rms@gnu.org>
23154
23155 * src/bison.s1: Add a Bison version comment.
23156
23157 * src/main.c (fatal, warn, berror):
23158 Use program_name.
23159
231601997-06-28 Richard Stallman <rms@gnu.org>
23161
23162 * Makefile.in (bison_version): New variable.
23163 (dist): Use that variable.
23164 (bison.s1): Substitute the Bison version into bison.simple.
23165
23166 * bison.simple: Add a Bison version comment.
23167
231681997-06-18 Richard Stallman <rms@gnu.org>
23169
23170 * src/main.c (fatal, warn, berror):
23171 Make error messages standard.
23172 (toomany): Improve error message text.
23173
23174 * 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:
23175 new.h renamed to alloc.h.
23176
231771997-06-18 Richard Stallman <rms@gnu.org>
23178
23179 * Makefile.in: new.h renamed to alloc.h.
23180
231811997-05-24 Richard Stallman <rms@gnu.org>
23182
23183 * src/lex.c (literalchar):
23184 Fix the code for escaping \, " and '.
23185
23186 (lex): Avoid trouble when there are many chars
23187 to discard in a char literal with just several chars in it.
23188
231891997-05-17 Richard Stallman <rms@gnu.org>
23190
23191 * src/bison.s1:
23192 Use malloc, if using alloca is troublesome.
23193 (YYSTACK_USE_ALLOCA): New flag macro.
23194 Define it for some systems and compilers.
23195 (YYSTACK_ALLOC): New macro.
23196 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23197 If it was malloc'd, free it.
23198
231991997-05-17 Richard Stallman <rms@gnu.org>
23200
23201 * bison.simple:
23202 Use malloc, if using alloca is troublesome.
23203 (YYSTACK_USE_ALLOCA): New flag macro.
23204 Define it for some systems and compilers.
23205 (YYSTACK_ALLOC): New macro.
23206 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23207 If it was malloc'd, free it.
23208
232091997-04-23 Richard Stallman <rms@gnu.org>
23210
23211 * src/bison.s1:
23212 (alloca) [__hpux]: Always define as __builtin_alloca.
23213
232141997-04-23 Richard Stallman <rms@gnu.org>
23215
23216 * bison.simple:
23217 (alloca) [__hpux]: Always define as __builtin_alloca.
23218
232191997-04-22 Richard Stallman <rms@gnu.org>
23220
23221 * src/bison.s1:
23222 [__hpux]: Include alloca.h (right for HPUX 10)
23223 instead of declaring alloca (right for HPUX 9).
23224
23225 * src/bison.s1 (__yy_memcpy):
23226 Declare arg `count' as unsigned int.
23227 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23228
232291997-04-22 Richard Stallman <rms@gnu.org>
23230
23231 * bison.simple:
23232 [__hpux]: Include alloca.h (right for HPUX 10)
23233 instead of declaring alloca (right for HPUX 9).
23234
23235 * bison.simple (__yy_memcpy):
23236 Declare arg `count' as unsigned int.
23237 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23238
232391997-01-03 Richard Stallman <rms@gnu.org>
23240
23241 * src/allocate.c: [__STDC__ or _MSC_VER]:
23242 Declare calloc and realloc to return void *.
23243
232441997-01-02 Richard Stallman <rms@gnu.org>
23245
23246 * src/system.h:
23247 [_MSC_VER]: Include stdlib.h and process.h.
23248 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23249
23250 * src/main.c (main): Return FAILURE as a value.
23251 (printable_version): Declare arg as int, not char.
23252
232531997-01-02 Richard Stallman <rms@gnu.org>
23254
23255 * Makefile.in (dist):
23256 Explicitly check for symlinks, and copy them.
23257
232581996-12-19 Richard Stallman <rms@gnu.org>
23259
23260 * src/files.c:
23261 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23262
232631996-12-18 Paul Eggert <eggert@gnu.org>
23264
23265 * src/bison.s1 (yyparse):
23266 If __GNUC__ and YYPARSE_PARAM are both defined,
23267 declare yyparse to have a void * argument.
23268
232691996-12-18 Paul Eggert <eggert@gnu.org>
23270
23271 * bison.simple (yyparse):
23272 If __GNUC__ and YYPARSE_PARAM are both defined,
23273 declare yyparse to have a void * argument.
23274
232751996-12-17 Richard Stallman <rms@gnu.org>
23276
23277 * src/reduce.c (nbits): Add some casts.
23278
232791996-08-12 Richard Stallman <rms@gnu.org>
23280
23281 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23282
232831996-08-12 Richard Stallman <rms@gnu.org>
23284
23285 * bison.simple: Test _MSDOS as well as _MSDOS_.
23286
232871996-07-31 Richard Stallman <rms@gnu.org>
23288
23289 * src/bison.s1:
23290 [__sun && __i386]: Include alloca.h.
23291
232921996-07-31 Richard Stallman <rms@gnu.org>
23293
23294 * bison.simple:
23295 [__sun && __i386]: Include alloca.h.
23296
232971996-07-30 Richard Stallman <rms@gnu.org>
23298
23299 * src/bison.s1: Comment change.
23300
23301 * src/bison.s1: Test _MSDOS_, not MSDOS.
23302
233031996-07-30 Richard Stallman <rms@gnu.org>
23304
23305 * bison.simple: Comment change.
23306
23307 * bison.simple: Test _MSDOS_, not MSDOS.
23308
233091996-06-01 Richard Stallman <rms@gnu.org>
23310
23311 * 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:
23312 Insert `_' macro around many string constants.
23313
23314 * src/main.c:
23315 Insert `_' macro around many string constants.
23316
23317 (main): Call setlocale, bindtextdomain and textdomain.
23318
23319 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23320 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23321 [ENABLE_NLS]: Include libintl.h.
23322 [ENABLE_NLS] (gettext): Define.
23323 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23324 (N_, PACKAGE, LOCALEDIR): New macros.
23325
233261996-06-01 Richard Stallman <rms@gnu.org>
23327
23328 * POTFILES.in: New file.
23329
23330 * Makefile.in (allocate.o):
23331 Define target explicitly.
23332
23333 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23334 (LDFLAGS): Set to @LDFLAGS@.
23335 (configure): Run autoconf only if preceding `cd' succeeds.
23336 (bison.s1): Redirect output to temporary file then move the
23337 temporary to the target, rather than redirecting directly to bison.s1.
23338 (clean): Remove config.status and config.log.
23339 (distclean): Don't remove config.status here.
23340
233411996-05-12 Richard Stallman <rms@gnu.org>
23342
23343 * src/bison.s1:
23344 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23345
233461996-05-12 Richard Stallman <rms@gnu.org>
23347
23348 * bison.simple:
23349 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23350
233511996-05-11 Richard Stallman <rms@gnu.org>
23352
23353 * src/bison.s1 (__yy_memcpy):
23354 Really reorder the args, as was supposedly done on Feb 14 1995.
23355 (yyparse): Calls changed accordingly.
23356
233571996-05-11 Richard Stallman <rms@gnu.org>
23358
23359 * Makefile.in (dist): Don't use $(srcdir).
23360
23361 * bison.simple (__yy_memcpy):
23362 Really reorder the args, as was supposedly done on Feb 14 1995.
23363 (yyparse): Calls changed accordingly.
23364
233651996-01-27 Richard Stallman <rms@gnu.org>
23366
23367 * src/output.c (output_rule_data):
23368 Test YYERROR_VERBOSE in the conditional
23369 around the definition of ttyname.
23370
233711995-12-29 Richard Stallman <rms@gnu.org>
23372
23373 * src/bison.s1:
23374 Fix line numbers in #line commands.
23375
233761995-12-29 Richard Stallman <rms@gnu.org>
23377
23378 * bison.simple:
23379 Fix line numbers in #line commands.
23380
233811995-12-27 Richard Stallman <rms@gnu.org>
23382
23383 * src/bison.s1 (YYPARSE_PARAM_DECL):
23384 In C++, make it always null.
23385 (YYPARSE_PARAM_ARG): New macro.
23386 (yyparse): Use YYPARSE_PARAM_ARG.
23387
233881995-12-27 Richard Stallman <rms@gnu.org>
23389
23390 * bison.simple (YYPARSE_PARAM_DECL):
23391 In C++, make it always null.
23392 (YYPARSE_PARAM_ARG): New macro.
23393 (yyparse): Use YYPARSE_PARAM_ARG.
23394
233951995-11-29 Richard Stallman <rms@gnu.org>
23396
23397 * doc/bison.texinfo:
23398 Describe literal string tokens, %raw, %no_lines, %token_table.
23399
234001995-11-29 Daniel Hagerty <hag@gnu.org>
23401
23402 * doc/bison.texinfo: Fixed update date
23403
234041995-10-16 Richard Stallman <rms@gnu.org>
23405
23406 * src/version.c: Version 1.25.
23407
234081995-10-16 Richard Stallman <rms@gnu.org>
23409
23410 * NEWS: *** empty log message ***
23411
234121995-10-16 Richard Stallman <rms@gnu.org>
23413
23414 * doc/bison.1, doc/bison.rnh:
23415 Add new options.
23416
234171995-10-15 Richard Stallman <rms@gnu.org>
23418
23419 * src/vmsgetargs.c, src/getargs.c:
23420 Added -n, -k, and -raw switches.
23421 (noparserflag, toknumflag, rawtoknumflag): New variables.
23422
23423 * src/symtab.h (SALIAS):
23424 New #define for adding aliases to %token.
23425 (struct bucket): Added `alias' field.
23426
23427 * src/reduce.c (reduce_grammar):
23428 Revise error message.
23429 (print_notices): Remove final `.' from error message.
23430
23431 * src/reader.c (reader_output_yylsp):
23432 New function.
23433 (readgram): Use `#if 0' around code that accepted %command
23434 inside grammar rules: The documentation doesn't allow it,
23435 and it will fail since the %command processors scan for the next %.
23436 (parse_token_decl): Extended the %token
23437 declaration to allow a multi-character symbol as an alias.
23438 (parse_thong_decl): New function.
23439 (read_declarations): Added %thong declarations.
23440 (read_declarations): Handle NOOP to deal with allowing
23441 % declarations as another means to specify the flags.
23442 (readgram): Allow %prec prior to semantics embedded in a rule.
23443 (skip_to_char, read_declarations, copy_definition)
23444 (parse_token_decl, parse_start_decl, parse_type_decl)
23445 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23446 (get_type_name, copy_guard, copy_action, readgram)
23447 (get_type, packsymbols): Revised most error messages.
23448 Changed `fatal' to `warnxxx' to avoid aborting for error.
23449 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23450 (read_declarations): Improve the error message for
23451 an invalid character. Do not abort.
23452 (read_declarations, copy_guard, copy_action): Use
23453 printable_version to avoid unprintable characters in printed output.
23454 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23455 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23456 Allow the type of a non-terminal can be given
23457 more than once, as long as all specifications give the same type.
23458
23459 * src/output.c:
23460 (output_headers, output_trailers, output, output_gram)
23461 (output_rule_data): Implement noparserflag variable.
23462 Implement toknumflag variable.
23463 (output): Call reader_output_yylsp to output LTYPESTR.
23464
23465 * src/main.c (main):
23466 If reader sees an error, don't process the grammar.
23467 (fatals): Updated to not use VARARGS1.
23468 (printable_version, int_to_string, warn, warni, warns, warnss)
23469 (warnsss): New error reporting functions. Avoid abort for error.
23470
23471 * src/lex.h:
23472 Added THONG and NOOP for alias processing.
23473 Added SETOPT for the new code that allows setting options with %flags.
23474
23475 * src/lex.c:
23476 Include getopt.h. Add some extern decls.
23477 (safegetc): New function to deal with EOF gracefully.
23478 (literalchar); new function to deal with reading \ escapes.
23479 (lex): Use literalchar.
23480 (lex): Implemented "..." tokens.
23481 (literalchar, lex, parse_percent_token): Made tokenbuffer
23482 always contain the token. This includes growing the token
23483 buffer while reading an integer.
23484 (parse_percent_token): Replaced if-else statement with percent_table.
23485 (parse_percent_token): Added % declarations as another
23486 way to specify the flags -n, -l, and -r. Also added hooks for
23487 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23488 major changes to files.c.
23489 (lex) Retain in the incoming stream a character following
23490 an incorrect '/'.
23491 (skip_white_space, lex): Revised most error messages
23492 and changed fatal to warn to avoid aborting.
23493 (percent_table): Added %thong declarations.
23494
23495 * src/gram.h: Comment changes.
23496
23497 * src/files.c (openfiles, open_extra_files, done):
23498 Add faction flag
23499 and actfile file. Handle noparserflag. Both for -n switch.
23500
23501 * src/conflicts.c (resolve_sr_conflict):
23502 Remove use of alloca.
23503
235041995-06-01 Jim Meyering <meyering@gnu.org>
23505
23506 * doc/bison.texinfo: *** empty log message ***
23507
235081995-05-06 Richard Stallman <rms@gnu.org>
23509
23510 * src/bison.s1: Comment change.
23511
235121995-05-06 Richard Stallman <rms@gnu.org>
23513
23514 * bison.simple: Comment change.
23515
235161995-05-03 Richard Stallman <rms@gnu.org>
23517
23518 * src/version.c: Version now 1.24.
23519
23520 * src/bison.s1: Change distribution terms.
23521
23522 * src/version.c: Version now 1.23.
23523
235241995-05-03 Richard Stallman <rms@gnu.org>
23525
23526 * doc/bison.texinfo:
23527 Rewrite "Conditions for Using Bison".
23528 Update version to 1.24.
23529
235301995-05-03 Richard Stallman <rms@gnu.org>
23531
23532 * bison.simple: Change distribution terms.
23533
235341995-02-23 Richard Stallman <rms@gnu.org>
23535
23536 * src/files.c: Test __VMS_POSIX as well as VMS.
23537
235381995-02-14 Jim Meyering <meyering@gnu.org>
23539
23540 * src/bison.s1 (__yy_memcpy):
23541 Renamed from __yy_bcopy to avoid
23542 confusion. Reverse FROM and TO arguments to be consistent with
23543 those of memcpy.
23544
235451995-02-14 Jim Meyering <meyering@gnu.org>
23546
23547 * bison.simple (__yy_memcpy):
23548 Renamed from __yy_bcopy to avoid
23549 confusion. Reverse FROM and TO arguments to be consistent with
23550 those of memcpy.
23551
235521994-11-10 David J. MacKenzie <djm@gnu.org>
23553
23554 * NEWS: reformat
23555
23556 * NEWS: New file.
23557
23558 * Makefile.in (DISTFILES): Include NEWS.
23559
23560 * Makefile.in (DISTFILES):
23561 Include install-sh, not install.sh.
23562
23563 * configure.in: Update to Autoconf v2 macro names.
23564
235651994-10-05 David J. MacKenzie <djm@gnu.org>
23566
23567 * Makefile.in: fix typo
23568
23569 * Makefile.in (prefix, exec_prefix):
23570 Let configure set them.
23571
235721994-09-28 David J. MacKenzie <djm@gnu.org>
23573
23574 * Makefile.in: Set datadir to $(prefix)/share.
23575
235761994-09-15 Richard Stallman <rms@gnu.org>
23577
23578 * src/bison.s1:
23579 Update copyright notice and GPL version.
23580
235811994-09-15 Richard Stallman <rms@gnu.org>
23582
23583 * bison.simple:
23584 Update copyright notice and GPL version.
23585
235861994-07-12 Richard Stallman <rms@gnu.org>
23587
23588 * src/reduce.c, src/reader.c:
23589 entered into RCS
23590
235911994-05-05 David J. MacKenzie <djm@gnu.org>
23592
23593 * Makefile.in: entered into RCS
23594
235951994-03-26 Richard Stallman <rms@gnu.org>
23596
23597 * src/bison.s1: entered into RCS
23598
235991994-03-26 Richard Stallman <rms@gnu.org>
23600
23601 * bison.simple: entered into RCS
23602
236031994-03-25 Richard Stallman <rms@gnu.org>
23604
23605 * src/main.c: entered into RCS
23606
236071994-03-24 Richard Stallman <rms@gnu.org>
23608
23609 * src/conflicts.c: entered into RCS
23610
236111994-01-02 Richard Stallman <rms@gnu.org>
23612
23613 * Makefile.in: *** empty log message ***
23614
236151993-11-21 Richard Stallman <rms@gnu.org>
23616
23617 * src/bison.s1: *** empty log message ***
23618
236191993-11-21 Richard Stallman <rms@gnu.org>
23620
23621 * doc/bison.texinfo: entered into RCS
23622
23623 * doc/bison.texinfo: *** empty log message ***
23624
236251993-11-21 Richard Stallman <rms@gnu.org>
23626
23627 * bison.simple: *** empty log message ***
23628
236291993-10-25 David J. MacKenzie <djm@gnu.org>
23630
23631 * doc/bison.texinfo: *** empty log message ***
23632
236331993-10-19 Richard Stallman <rms@gnu.org>
23634
23635 * src/bison.s1: *** empty log message ***
23636
236371993-10-19 Richard Stallman <rms@gnu.org>
23638
23639 * bison.simple: *** empty log message ***
23640
236411993-10-14 Richard Stallman <rms@gnu.org>
23642
23643 * src/bison.s1: *** empty log message ***
23644
236451993-10-14 Richard Stallman <rms@gnu.org>
23646
23647 * bison.simple: *** empty log message ***
23648
236491993-09-14 David J. MacKenzie <djm@gnu.org>
23650
23651 * doc/bison.texinfo: *** empty log message ***
23652
236531993-09-13 Noah Friedman <friedman@gnu.org>
23654
23655 * Makefile.in: *** empty log message ***
23656
236571993-09-10 Richard Stallman <rms@gnu.org>
23658
23659 * src/conflicts.c: *** empty log message ***
23660
23661 * src/system.h: entered into RCS
23662
236631993-09-10 Richard Stallman <rms@gnu.org>
23664
23665 * doc/bison.1: entered into RCS
23666
236671993-09-06 Noah Friedman <friedman@gnu.org>
23668
23669 * src/version.c: entered into RCS
23670
236711993-09-06 Noah Friedman <friedman@gnu.org>
23672
23673 * Makefile.in: *** empty log message ***
23674
236751993-07-30 David J. MacKenzie <djm@gnu.org>
23676
23677 * Makefile.in: *** empty log message ***
23678
236791993-07-24 Richard Stallman <rms@gnu.org>
23680
23681 * src/bison.s1: *** empty log message ***
23682
236831993-07-24 Richard Stallman <rms@gnu.org>
23684
23685 * bison.simple: *** empty log message ***
23686
236871993-07-08 David J. MacKenzie <djm@gnu.org>
23688
23689 * Makefile.in: *** empty log message ***
23690
236911993-07-04 Richard Stallman <rms@gnu.org>
23692
23693 * src/bison.s1: *** empty log message ***
23694
236951993-07-04 Richard Stallman <rms@gnu.org>
23696
23697 * bison.simple: *** empty log message ***
23698
236991993-06-26 David J. MacKenzie <djm@gnu.org>
23700
23701 * src/getargs.c: entered into RCS
23702
237031993-06-26 David J. MacKenzie <djm@gnu.org>
23704
23705 * doc/bison.texinfo: *** empty log message ***
23706
23707 * doc/bison.1: New file.
23708
237091993-06-25 Richard Stallman <rms@gnu.org>
23710
23711 * src/getargs.c: New file.
23712
237131993-06-16 Richard Stallman <rms@gnu.org>
23714
23715 * src/bison.s1: *** empty log message ***
23716
237171993-06-16 Richard Stallman <rms@gnu.org>
23718
23719 * bison.simple: *** empty log message ***
23720
237211993-06-03 Richard Stallman <rms@gnu.org>
23722
23723 * src/bison.s1: New file.
23724
237251993-06-03 Richard Stallman <rms@gnu.org>
23726
23727 * doc/bison.texinfo: *** empty log message ***
23728
237291993-06-03 Richard Stallman <rms@gnu.org>
23730
23731 * bison.simple: New file.
23732
237331993-05-19 Richard Stallman <rms@gnu.org>
23734
23735 * doc/bison.texinfo: New file.
23736
237371993-05-07 Noah Friedman <friedman@gnu.org>
23738
23739 * Makefile.in: *** empty log message ***
23740
237411993-04-28 Noah Friedman <friedman@gnu.org>
23742
23743 * src/reader.c: *** empty log message ***
23744
237451993-04-23 Noah Friedman <friedman@gnu.org>
23746
23747 * src/alloc.h: entered into RCS
23748
237491993-04-20 David J. MacKenzie <djm@gnu.org>
23750
23751 * src/version.c: *** empty log message ***
23752
23753 * src/files.c, src/allocate.c:
23754 entered into RCS
23755
23756 * src/reader.c: *** empty log message ***
23757
23758 * src/lex.c: entered into RCS
23759
23760 * src/conflicts.c: New file.
23761
23762 * src/symtab.c: entered into RCS
23763
23764 * src/alloc.h: New file.
23765
23766 * src/LR0.c: entered into RCS
23767
237681993-04-18 Noah Friedman <friedman@gnu.org>
23769
23770 * src/reader.c: New file.
23771
23772 * src/version.c: *** empty log message ***
23773
237741993-04-18 Noah Friedman <friedman@gnu.org>
23775
23776 * Makefile.in: *** empty log message ***
23777
237781993-04-17 Noah Friedman <friedman@gnu.org>
23779
23780 * Makefile.in: *** empty log message ***
23781
237821993-04-15 Richard Stallman <rms@gnu.org>
23783
23784 * src/main.c, src/files.c:
23785 New file.
23786
237871993-04-15 Noah Friedman <friedman@gnu.org>
23788
23789 * configure.in: entered into RCS
23790
23791 * configure.in: *** empty log message ***
23792
23793 * configure.in: New file.
23794
237951993-04-14 Richard Stallman <rms@gnu.org>
23796
23797 * Makefile.in: New file.
23798
237991993-04-13 Richard Stallman <rms@gnu.org>
23800
23801 * src/version.c: New file.
23802
238031993-03-25 Richard Stallman <rms@gnu.org>
23804
23805 * src/output.c: entered into RCS
23806
238071992-09-25 Richard Stallman <rms@gnu.org>
23808
23809 * configure.bat: entered into RCS
23810
238111992-06-22 Richard Stallman <rms@gnu.org>
23812
23813 * src/vmsgetargs.c: entered into RCS
23814
238151992-06-22 Richard Stallman <rms@gnu.org>
23816
23817 * doc/bison.rnh: entered into RCS
23818
238191992-04-20 David J. MacKenzie <djm@gnu.org>
23820
23821 * README: entered into RCS
23822
238231992-01-22 Richard Stallman <rms@gnu.org>
23824
23825 * src/machine.h: entered into RCS
23826
238271991-12-21 Richard Stallman <rms@gnu.org>
23828
23829 * src/lalr.c, src/closure.c:
23830 entered into RCS
23831
238321991-12-20 Richard Stallman <rms@gnu.org>
23833
23834 * src/state.h: entered into RCS
23835
238361991-12-18 Richard Stallman <rms@gnu.org>
23837
23838 * src/print.c, src/nullable.c, src/derives.c:
23839 entered into RCS
23840
238411991-11-03 David J. MacKenzie <djm@gnu.org>
23842
23843 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23844 entered into RCS
23845
238461988-09-09 Richard Stallman <rms@gnu.org>
23847
23848 * src/bison.hairy: entered into RCS
23849
238501987-12-16 Richard Stallman <rms@gnu.org>
23851
23852 * REFERENCES: entered into RCS
dc546b0f 23853
f294a2c2 23854
04098407 23855 -----
f294a2c2 23856
04098407 23857 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e021191b
JD
23858 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
23859 2008, 2009 Free Software Foundation, Inc.
f294a2c2 23860
04098407
PE
23861 Copying and distribution of this file, with or without
23862 modification, are permitted provided the copyright notice and this
23863 notice are preserved.