]> git.saurik.com Git - bison.git/blame - ChangeLog
build: avoid ignored errors.
[bison.git] / ChangeLog
CommitLineData
796a2b0a
AD
12009-05-25 Akim Demaille <demaille@gostai.com>
2
3 build: avoid ignored errors.
4 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
5 errors, they pollute the output.
6
0b6d43c5
JD
72009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
8
9 Convert multiple variable definition warnings to complaints.
10 * NEWS (2.5): Add a new entry for that change.
11 * doc/bison.texinfo (Decl Summary): Update %define entry.
12 (Bison Options): Update -D/--define/-F/--force-define entry.
13 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
14 * src/muscle-tab.h (muscle_percent_define_insert): Update
15 comments.
16 * tests/input.at (`%define errors'): Update.
17 (`%define, --define, --force-define'): Update.
18
de5ab940
JD
192009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
20
21 -F/--force-define and relative %define/-D/--define priorities.
22 * NEWS (2.5): Add documentation to -D/--define entry.
23 * build-aux/cross-options.pl: Hard-code association of
24 --force-define with %define.
25 * doc/bison.texinfo (Decl Summary): In %define entry,
26 cross-reference command-line options.
27 (Bison Options): Add documentation to -D/--define entry.
28 (Option Cross Key): Widen column for --force-define row.
29 * src/getargs.c (usage): Document -F/--force-define. Realign
30 options in output.
31 (short_options, long_options, getargs): Parse -F/--force-define,
32 and update muscle_percent_define_insert invocations.
33 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
34 (muscle_percent_define_insert): Add argument with that type.
35 * src/muscle-tab.c (muscle_percent_define_insert): Implement
36 -F/--force-define behavior and priorities.
37 (muscle_percent_define_ensure): Update
38 muscle_percent_define_insert invocation.
39 * src/parse-gram.y (prologue_declaration): Update
40 muscle_percent_define_insert invocations.
41 * tests/input.at (`%define, --define'): Rename to...
42 (`%define, --define, --force-define'): ... this and extend.
43
f8e7258f
JD
442009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
45
46 Update some comments to make sense for -D.
47 * data/bison.m4 (b4_check_user_names): In header comments, say
48 "user occurrence" instead of "grammar occurrence".
49 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
50 (muscle_percent_code_grow): Likewise just for consistency.
51
b987342b
JD
522009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
53
54 * data/c++.m4 (b4_namespace_close): Simplify slightly.
55
4977e0a7
JD
562009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
57
58 Handle a trailing `:' in a user-supplied C++ namespace better.
59 * data/c++.m4 (b4_namespace_close): Don't let it be printed
60 among the closing braces here. This fix might make the
61 generated code easier to debug, but otherwise it should be
62 insignificant because a trailing `:' is a C++ error already.
63
9b04dad7
AD
642009-05-19 Akim Demaille <demaille@gostai.com>
65
66 remove useless variable.
67 * src/getargs.c (skeleton_arg): Remove now useless variable.
68 Should help the compiler see that this printf-like call is sane.
69
4c6622c2
AD
702009-05-15 Akim Demaille <demaille@gostai.com>
71
72 Rename token.prefix as api.tokens.prefix.
73 Discussed here.
74 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
75
76 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
77 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
78 (token.prefix): Rename as...
79 (api.tokens.prefix): this.
80
3c248d70
AD
812009-05-11 Akim Demaille <demaille@gostai.com>
82
83 doc: use C++ headers.
84 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
85 headers.
86
99c08fb6
AD
872009-05-11 Akim Demaille <demaille@gostai.com>
88
89 doc: token.prefix
90 * doc/bison.simple (Decl Summary): Document token.prefix.
91 (Calc++ Parser): Various fixes.
92 Formatting changes.
93 Use token.prefix.
94 Introduce a macro TOKEN to shorten the code and make it more
95 readable.
96 (Calc++ Scanner): Adjust.
97 * NEWS (Variable token.prefix): New.
98
84a1cb5a
AD
992009-05-04 Akim Demaille <demaille@gostai.com>
100
101 bison: catch bad symbol names.
102 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
103 * tests/input.at: Adjust.
104
cdf3f113
AD
1052009-05-04 Akim Demaille <demaille@gostai.com>
106
107 identifiers: dashes are letters.
108 Dashes can now start identifiers (symbols and directives).
84a1cb5a 109
cdf3f113
AD
110 * src/scan-gram.l ({letter}): Add dash.
111 ({id}): Remove it.
112 * tests/input.at (Symbols): Adjust.
113 Remove stray comment.
114 * tests/regression.at (Invalid inputs): Adjust error message.
115 * doc/bison.texinfo (Symbols): Update.
116
98a345a2
JD
1172009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
118
119 Declare %code to be a permanent feature.
120 * NEWS (2.4.2): Here.
121 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
122 experimental.
123 (Decl Summary): Likewise.
124
67212941
JD
1252009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
126
127 Convert underscores to dashes in some %define variable names.
128 For now, just api.push-pull and lr.keep-unreachable-states.
129 Maintain old names for backward compatibility.
130 * NEWS (2.5): Document.
131 * data/c.m4 (b4_identification): Update comment.
132 * data/yacc.c: Update access.
133 * doc/bison.texinfo: Update.
134 * etc/bench.pl.in (bench_push_parser): Update use.
135 * src/files.c (tr): Move to...
136 * src/getargs.c, src/getargs.h (tr): ... here because I can't
137 think of a better place to expose it. My logic is that, for all
138 uses of tr so far, command-line arguments can be involved, and
139 getargs.h is already included.
140 * src/main.c (main): Update access.
141 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
142 variable names to new variable names before assigning value.
143 * src/reader.c (reader): Update setting default.
144 * tests/calc.at: Update uses.
145 * tests/conflicts.at (Unreachable States After Conflict
146 Resolution): Update use.
147 * tests/input.at (%define enum variables): Update use.
148 (%define backward compatibility): New test group.
149 * tests/push.at: Update uses.
150 * tests/reduce.at: Update uses.
151 * tests/torture.at: Update uses.
152
ba5c6d94
JD
1532009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
154
155 Set all front-end %define defaults in one place.
156 * src/main.c (main): Move lr.keep_unreachable_states default...
157 * src/reader.c (reader): ... to here.
158
5bab9d08
JD
1592009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
160
161 Rename lr.default_reductions to lr.default-reductions.
162 * NEWS (2.5): Here.
163 * doc/bison.texinfo: Here.
164 * src/lalr.c (initialize_LA): Here.
165 * src/print.c (print_reductions): Here.
166 * src/reader.c (reader): Here.
167 * src/tables.c (action_row): Here.
168 * tests/input.at (%define enum variables): Here.
169 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
170
d521ee19
JD
1712009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
172
173 Pacify ./configure --enable-gcc-warnings.
174 * tests/input.at (Symbols): Prototype yyerror and yylex.
175
1762009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
177
178 Document how `%define "var" "value"' is not M4-friendly.
179 * src/parse-gram.y (variable): In comments here.
180
8f0d265e
JD
1812009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
182
183 Clean up recent patches a little.
184 Reported by Akim Demaille.
185 * doc/bison.texinfo (Understanding): Fix typos.
186 * src/print.c (print_reductions): Don't use negated variable.
187
f4909773
JD
1882009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
189
190 List accepted values for a %define enum variable with an invalid value.
191 Suggested by Akim Demaille at
192 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
193 * data/bison.m4 (_b4_percent_define_check_values): Implement.
194 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
195 * tests/input.at (%define lr.default_reductions invalid values): Merge
196 into...
197 (%define enum variables): ... here, and update output.
198
110ef36a
JD
1992009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
200
201 Rename "default rule" to "default reduction".
202 This includes changing variable names in code, changing
203 comments, and renaming %define lr.default_rules to %define
204 lr.default_reductions.
205 * NEWS (2.5): Update IELR documentation.
206 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
207 documentation.
208 * data/glr.c, data/lalr1.java: Sync copyright dates.
209 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
210 and lr.type documentation. Make some other wording
211 improvements.
212 (Glossary): Adjust cross-references and Default Reduction
213 definition.
214 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
215 Remove a confusing comment pointed out by Akim Demaille.
216 (initialize_LA): Adjust code.
217 * src/print-xml.c (print_reductions): Adjust code.
218 * src/print.c (print_reductions): Adjust code.
219 * src/reader.c (reader): Adjust code.
220 * src/tables.c (action_row): Adjust code.
221 (token_actions): Adjust code.
222 * src/tables.h: Adjust YYDEFACT documentation.
223 * tests/input.at (%define lr.default_rules invalid values):
224 Rename test group to...
225 (%define lr.default_reductions invalid values): ... this, and
226 update grammar file and expected output.
227 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
228 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
229
746ee38c
AD
2302009-04-21 Akim Demaille <demaille@gostai.com>
231
232 tests: check the use of dashes and periods in symbols.
233 * tests/input.at (Symbol): New test group.
234
eb45ef3b
JD
2352009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
236
237 Document %define lr.type and lr.default_rules.
238 * NEWS (2.5): Add an entry.
239 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
240 besides just LALR(1) and GLR(1).
241 * doc/bison.texinfo (Introduction): Likewise.
242 (Language and Grammar): Bison is no longer limited to LALR(1)
243 restrictions.
244 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
245 when trying to distinguish from GLR. Talk about LR(1) grammars
246 rather than LALR(1) grammars.
247 (Decl Summary): In %define api.push_pull entry, say it applies
248 to deterministic parsers in C rather than LALR(1) parsers in C.
249 Add lr.default_rules entry.
250 Add lr.type entry.
251 (Mystery Conflicts): Bison is no longer limited to LALR(1)
252 restrictions.
253 (Generalized LR Parsing): Same changes as for the previous GLR
254 section.
255 (Memory Management): Say deterministic rather than LALR(1).
256 (Understanding): Correct some bison output.
257 Index discussion of "accepting state".
258 Say deterministic rather than LALR(1).
259 (Bison Options): In --yacc entry, say deterministic rather than
260 LALR(1).
261 In --report, --graph, and --xml entries, just don't mention
262 LALR(1).
263 (C++ Parsers): Say deterministic rather than LALR(1).
264 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
265 (Glossary): Add Accepting State, Consistent State, Default Rule,
266 and IELR(1) definitions.
267 In Generalized LR (GLR) definition, make same changes as in
268 previous GLR sections.
269 In LALR(1) definition, say Bison uses LALR(1) by default rather
270 than implying Bison is limited to LALR(1).
271 (LocalWords): Add IELR.
272
db34f798
JD
2732009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
274
275 Finish implementing %define lr.type.
276 Its value can be "LALR", "IELR", or "canonical LR".
277 * lib/timevar.def (TV_IELR_PHASE1): New var.
278 (TV_IELR_PHASE2): New var.
279 (TV_IELR_PHASE3): New var.
280 (TV_IELR_PHASE4): New var.
281 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
282 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
283 Sbitset.h, ielr.h, and ielr.c.
284 * src/getargs.h, src/getargs.c (enum trace, trace_args,
285 trace_types): Add trace_ielr.
286 * src/lalr.h, src/lalr.c (ngotos): Export it.
287 (F): Rename to...
288 (goto_follows): ... this, update all uses, and export it.
289 (set_goto_map): Export it.
290 (map_goto): Export it.
291 (compute_lookahead_tokens): Don't free goto_follows yet. Now
292 handled in ielr.
293 (initialize_LA): Export it. Move lookback allocation to...
294 (lalr): ... here because, for canonical LR, initialize_LA must
295 be invoked but lookback and much of the rest of LALR isn't
296 needed.
297 * main.c (main): Instead of lalr, invoke ielr, which invokes
298 lalr.
299 * src/reader.c (reader): Default lr.type to "LALR".
300 Default lr.default_rules to "accepting" if lr.type is "canonical
301 LR". Leave the default as "all" otherwise.
302 Check for a valid lr.type value.
303 * src/state.h, src/state.c (struct state_list): Add state_list
304 member.
305 (state_new): Initialize state_list member to NULL.
306 (state_new_isocore): New function, exported.
307 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
308 exercises all values of lr.type.
309 (GNU AWK Grammar): Rename test group to...
310 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
311 AT_TEST_EXISTING_GRAMMAR.
312 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
313 (GNU pic Grammar): Rename test group to...
314 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
315 AT_TEST_EXISTING_GRAMMAR.
316 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
317 all values of lr.type.
318 (Single State Split): New test groups using AT_TEST_LR_TYPE.
319 (Lane Split): Likewise.
320 (Complex Lane Split): Likewise.
321 (Split During Added Lookahead Propagation): Likewise.
322
7fe11bb5
JD
3232009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
324
325 Add new files for IELR and canonical LR implementation.
326 * src/AnnotationList.c: New.
327 * src/AnnotationList.h: New.
328 * src/InadequacyList.c: New.
329 * src/InadequacyList.h: New.
330 * src/Sbitset.c: New.
331 * src/Sbitset.h: New.
332 * src/ielr.c: New.
333 * src/ielr.h: New.
334
7254f6a8
JD
3352009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
336
337 Implement %define lr.default_rules.
338 Its value describes the states that are permitted to contain
339 default rules: "all", "consistent", or "accepting".
340 * src/reader.c (reader): Default lr.default_rules to "all".
341 Check for a valid lr.default_rules value.
342 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
343 is "accepting", then only mark the accepting state as
344 consistent.
345 (initialize_LA): Tell state_lookahead_tokens_count whether
346 lr.default_rules is "accepting".
347 * src/tables.c (action_row): If lr.default_rules is not "all",
348 then disable default rules in inconsistent states.
349 * src/print.c (print_reductions): Use this opportunity to
350 perform some assertions about whether lr.default_rules was
351 obeyed correctly.
352 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
353 helps with checking the parser tables for a grammar.
354 * tests/input.at (%define lr.default_rules invalid values): New
355 test group.
356 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
357 AT_TEST_TABLES_AND_PARSE.
358 (`no %define lr.default_rules'): New test group generated by
359 AT_TEST_LR_DEFAULT_RULES.
360 (`%define lr.default_rules "all"'): Likewise.
361 (`%define lr.default_rules "consistent"'): Likewise.
362 (`%define lr.default_rules "accepting"'): Likewise.
363
72e727f2
AD
3642009-04-20 Akim Demaille <demaille@gostai.com>
365
366 Formatting change.
367
90462b8d
AD
3682009-04-20 Akim Demaille <demaille@gostai.com>
369
370 bison: factoring.
371 * src/output.c (token_definitions_output): Use symbol_id_get
372 instead of duplicating its logic.
373 * TODO (YYERRCODE): Extend.
374
4f646c37
AD
3752009-04-20 Akim Demaille <demaille@gostai.com>
376
71b00ed8
AD
377 variables: prefer error-verbose to error_verbose.
378 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
379 instead of error_verbose.
380 * src/scan-gram.l (%error-verbose): Map to the error-verbose
381 variable.
382 * doc/bison.texinfo: Promote %define error-verbose instead of
383 %error-verbose.
384 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
385
3862009-04-15 Akim Demaille <demaille@gostai.com>
387
4f646c37
AD
388 variables: accept dashes.
389 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
390 underscores.
391 * src/scan-gram.l ({id}): Also accept dashes after the initial
392 letter.
393 ({directive}): Use {id}.
394 * src/parse-gram.y: Comment and formatting changes.
395 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
396 symbols.
397 * src/complain.h, src/complain.c (yacc_at): New.
398 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
399 symbol names.
400 * src/output.c (token_definitions_output): Do not #define token
401 names with dashes.
402
184e3179
AD
4032009-04-20 Akim Demaille <demaille@gostai.com>
404
405 Consistently refer to Yacc, not YACC.
406 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
407
41253c3a
JD
4082009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
409
410 Pacify make maintainer-check-posix.
411 * tests/input.at (%define, --define): Move bison command-line
412 options before grammar file name.
413
197b82ba
JD
4142009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
415
416 Document semicolon warnings.
417 * NEWS (2.5): Here.
418
0c90a1f5
AD
4192009-04-14 Akim Demaille <demaille@gostai.com>
420
421 variables: use `parse.assert' instead of `assert'.
422 * TODO (assert): Remove.
423 * data/bison.m4 (b4_assert_if): Replace with...
424 (b4_parse_assert_if): this.
425 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
426 * doc/bison.texinfo (Decl Summary): Document parse.assert.
427
fa819509
AD
4282009-04-14 Akim Demaille <demaille@gostai.com>
429
16dc0d90 430 variables: use `parse.trace' instead of `debug'.
fa819509
AD
431 * src/getargs.c (getargs): Map -t to %define trace.parse.
432 * src/scan-gram.l (%debug): Map to %define trace.parse.
433 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
434 names to `_' in macro names.
435 (b4_debug_if): Replace with...
436 (b4_parse_trace_if): this.
437 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
438 * data/yacc.c: Adjust.
439 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
440 Use @code to label the variable list.
441 Document the variable parse.trace.
442 (Tracing): Promote the parse.trace variable.
443 * TODO: %printer is not documented.
444
f7dae1ea
AD
4452009-04-14 Akim Demaille <demaille@gostai.com>
446
447 doc: minor fixes.
448 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
449 (Table of Symbols): Remove duplicate entry for %debug.
450
3535c071
EB
4512009-04-10 Eric Blake <ebb9@byu.net>
452
453 submodules: update to latest
454 * submodules/autoconf: Use latest upstream Autoconf.
455
cf48f675
EB
4562009-04-06 Eric Blake <ebb9@byu.net>
457
458 Work around autoconf 2.63b bug in testsuite.
459 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
460 autoconf bug related to # in test.
461
50cca368
JD
4622009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
463
464 * NEWS (2.5): New section. Describe new -D/--define feature.
465
3583d96b
AD
4662009-04-06 Akim Demaille <demaille@gostai.com>
467
468 Regen.
469 * src/parse-gram.h, src/parse-gram.c: Regen.
470
00f5d575
AD
4712009-04-06 Akim Demaille <demaille@gostai.com>
472
473 rename muscle_tab.* as muscle-tab.* for consistency.
474 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
475 * src/muscle-tab.h, src/muscle-tab.c: these.
476 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
477 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
478
76bf5102
AD
4792009-04-06 Akim Demaille <demaille@gostai.com>
480
481 Makefile: introduce $(BISON).
482 * src/local.mk (BISON): New.
483 (YACC): Use it.
484
bc0f5737
AD
4852009-04-06 Akim Demaille <demaille@gostai.com>
486
487 parser: handle %locations as %define locations.
488 * src/getargs.h, src/getargs.c (locations_flag): Remove.
489 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
490 to set "locations" to true.
491 * src/output.c (prepare): Don't output "locations".
492 * src/scan-gram.l (%locations): Handle it as a %<flag>.
493 * src/parse-gram.y: It's no longer a token.
494 Don't handle it.
495 * data/bison.m4 (b4_locations_if): Define it with
496 b4_percent_define_if_define.
497 * data/c.m4, data/glr.cc: Adjust.
498
697c912f
AD
4992009-04-06 Akim Demaille <demaille@gostai.com>
500
501 Regen.
502 * src/parse-gram.c: Regen.
503
4920ae8b
AD
5042009-04-06 Akim Demaille <demaille@gostai.com>
505
506 muscle: factor the handling of obsolete of obsolete directives.
507 Suggested by Joel E. Denny.
50cca368 508
4920ae8b
AD
509 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
510 New, extracted from...
511 * src/parse-gram.y (prologue_declaration: pure-parser): here.
512 Remove it.
513 (prologue_declaration: "%<flag>"): Use
514 muscle_percent_define_ensure.
515 (%error-verbose, %pure-parser): No longer tokens.
516 * src/scan-gram.l (pure-parser): Return as a %<flag>.
517
1d5b3c08
JD
5182009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
519
520 Fix options documentation.
521 * build-aux/cross-options.pl: As in --help output, write optional
522 arguments as [=ARG] not =[ARG].
523 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
524
62c99cf4
JD
5252009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
526
527 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
528 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
529 requirements for a correct m4 are stricter.
530 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
531 * configure.ac: Update to use AC_PROG_GNU_M4.
532 Reported by Eric Blake.
533
1c93f35b
JD
5342009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
535
536 Help with updating web manual.
537 * HACKING: Incorporate instructions from gnulib/doc/README.
538 * bootstrap.conf (gnulib_modules): Add gendocs.
539
86cfae0a
AD
5402009-04-03 Akim Demaille <demaille@gostai.com>
541
542 Regen.
543 * src/parse-gram.h, src/parse-gram.c: Regen.
544
ba061fa6
AD
5452009-04-03 Akim Demaille <demaille@gostai.com>
546
547 Factor %FLAG at scan level.
548 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
549 definitions and associated rules, replaced by....
550 (PERCENT_FLAG): this new token type, and rule.
551 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
552 Use it for %debug and %error-verbose.
553
b19ebeb3
AD
5542009-04-03 Akim Demaille <demaille@gostai.com>
555
556 Regen.
557 * src/parse-gram.h, src/parse-gram.c: Regen.
558
001a16a9
AD
5592009-04-03 Akim Demaille <demaille@gostai.com>
560
561 Treat %debug as %define debug.
562 * data/bison.m4 (b4_debug_if): New.
563 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
564 * data/lalr1.java: Use it instead of b4_debug_flag.
565 * src/getargs.h, src/getargs.c (debug_flag): Remove.
566 * src/output.c (prepare): Don't output it.
567 * src/parse-gram.y: Treat %debug as %define debug.
568
5692009-04-03 Akim Demaille <demaille@gostai.com>
570
571 Treat %error-verbose as %define error_verbose.
572 This allows to pass -Derror_verbose on the command line. Better
573 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
574 ERROR_VERBOSE being defined as false or true.
575 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
576 on b4_percent_define_ifdef, for does not check the defined value,
577 but only whether the symbol is defined, rely on
578 b4_percent_define_flag_if, so that a value of "false" is processed
579 as a false.
580 If not defined, define the flag to "false".
581 (b4_error_verbose_if): New.
582 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
583 b4_error_verbose_flag.
584 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
585 * src/output.c (prepare): Don't output it.
586 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
587
92822aff
JD
5882009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
589
590 Fix strange %define locations for default values.
591 Reported by Akim Demaille at
592 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
593 and discussed again starting at
594 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
595 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
596 because location information is bogus.
597 Use angle brackets to delimit fake file name because square brackets
598 look like underexpanded m4. Choose a better fake file name.
599 Use negative line numbers.
600 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
601 * src/location.c (location_print): If line for a boundary is negative,
602 only print that boundary's file name.
603 * src/location.h: Document that.
604 * tests/skeletons.at (%define Boolean variables: invalid skeleton
605 defaults): Update output.
606
e021191b
JD
6072009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
608
609 Pacify ./configure --enable-gcc-warnings.
610 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
611 in lib won't compile with it.
612 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
613
78f65418
AD
6142009-03-31 Akim Demaille <demaille@gostai.com>
615
616 bootstrap: --help to stdout.
617 * bootstrap (usage): Don't send --help to stderr.
618 Use a here doc instead of a long string.
619
f7e241f4
AD
6202009-03-31 Akim Demaille <demaille@gostai.com>
621
622 bootstrap: README-hacking no longer exists
623 * bootstrap (checkout_only_file): Set to HACKING.
624
31d3e510
AD
6252009-03-26 Akim Demaille <demaille@gostai.com>
626
627 doc: merge HACKING and README-hacking.
628 Two files is confusing.
629 Reported by Alexandre Duret-Lutz.
1f9d8248 630
31d3e510
AD
631 * README-hacking: Merge into...
632 * HACKING (Working from the repository): here.
633
81535bfa
AD
6342009-03-26 Akim Demaille <demaille@gostai.com>
635
636 doc: update README-hacking.
637 * README-hacking: We now use git and git submodules.
638 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
639
56f772e9
AD
6402009-03-26 Akim Demaille <demaille@gostai.com>
641
642 lalr1.cc: avoid GCC 4.3 warnings.
643 GCC 4.3 now warns about "a || b && c" and asks for explicit
644 parentheses.
645 Reported by Alexandre Duret-Lutz.
646 * data/location.cc: Update copyright years.
647 (Position::operator==): Use parens to make precedence explicit.
648 Compare lines and columns first, as they are more likely to be
649 different, and they are faster to compare.
650
11c073b7
AD
6512009-03-26 Akim Demaille <demaille@gostai.com>
652
653 gnulib: update.
654 * gnulib: Update to latest.
655 * src/local.mk (AM_CFLAGS): Move to...
656 * Makefile.am: here.
657 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
658 AM_CFLAGS.
659
91be6b28
AD
6602009-03-02 Akim Demaille <demaille@gostai.com>
661
662 Comment changes.
663
cbf25ce7
AD
6642009-03-02 Akim Demaille <demaille@gostai.com>
665
666 Share b4_yytranslate_define.
667 * data/lalr1.cc (b4_yytranslate_define): Move to...
668 * data/c++.m4: here.
669
882f02ed
AD
6702009-03-02 Akim Demaille <demaille@gostai.com>
671
672 Use locations in the variant example.
1f9d8248
AD
673 Yes, this obfuscates the point of this example, variants only.
674 But glr.cc cannot work (yet?) without locations. This change
675 makes it easier to use this example with glr.cc.
11c073b7 676
882f02ed
AD
677 * examples/variant.yy (assert): %define it.
678 (locations): Request them.
679 (yylex): Bind the location to the stage.
680
0623bacc
AD
6812009-03-02 Akim Demaille <demaille@gostai.com>
682
683 Dub make_TOKEN as a public type interface.
684 * data/c++.m4 (b4_symbol_constructor_declare)
685 (b4_symbol_constructor_define): New empty stubs.
686 (b4_public_types_declare, b4_public_types_define): Use them.
687 * data/lalr1.cc (b4_symbol_constructor_declare)
688 (b4_symbol_constructor_declare_)
689 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
690 Move to...
691 * data/variant.hh: here.
692 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
693 needed.
694 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
695 b4_symbol_constructor_declare, as it is now done by
696 b4_public_types_define and b4_public_types_declare.
697
5f5a90df
AD
6982009-03-02 Akim Demaille <demaille@gostai.com>
699
700 Coding style changes.
701 * data/lalr1.cc (b4_symbol_constructor_declaration_)
702 (b4_symbol_constructor_declarations)
703 (b4_symbol_constructor_definition_)
704 (b4_symbol_constructor_definitions)
705 (b4_yytranslate_definition): Rename as...
706 (b4_symbol_constructor_declare_)
707 (b4_symbol_constructor_declare)
708 (b4_symbol_constructor_define_)
709 (b4_symbol_constructor_define)
710 (b4_yytranslate_define): these.
711 * data/variant.hh (b4_variant_definition): Rename as...
712 (b4_variant_define): this.
713
b47b6ff7
AD
7142009-03-02 Akim Demaille <demaille@gostai.com>
715
716 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
717 * data/bison.m4 (b4_percent_define_if_define): New.
718 * data/c++.m4 (b4_variant_if): Move to...
719 * data/bison.m4: Here, using b4_percent_define_if_define.
720 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
721 * data/bison.m4: Here, using b4_percent_define_if_define.
722
1d6b689b
AD
7232009-03-02 Akim Demaille <demaille@gostai.com>
724
725 Dub symbol_type_base as a public type.
726 * data/c++.m4 (b4_public_types_declare): Now define
727 symbol_type_base and symbol_type.
728 (b4_public_types_define): New.
729 In both cases, the definitions are taken verbatim from lalr1.cc.
730 * data/lalr1.cc: Adjust.
731
4f84717d
AD
7322009-03-02 Akim Demaille <demaille@gostai.com>
733
734 b4_public_types_declare.
735 * data/c++.m4 (b4_public_types_declare): New.
736 * data/glr.cc, data/lalr1.cc: Use it.
737
b9e4eb5b
AD
7382009-03-02 Akim Demaille <demaille@gostai.com>
739
740 b4_semantic_type_declare.
741 * data/c++.m4 (b4_semantic_type_declare): New.
742 Factors and generalizes what was in glr.cc and lalr1.cc.
743 * data/variant.hh (b4_semantic_type_declare): Redefine it for
744 variants.
745 * data/lalr1.cc, data/glr.cc: Use it.
746
6a6e7f0c
AD
7472009-02-26 Akim Demaille <demaille@gostai.com>
748
749 Upgrade gnulib.
750 * gnulib: Upgrade from master.
751 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
752 Regen.
753
e9e61b00
AD
7542009-02-25 Akim Demaille <demaille@gostai.com>
755
756 Remove useless arguments.
757 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
758 relevant.
759
3eead995
AD
7602009-02-25 Akim Demaille <demaille@gostai.com>
761
762 Comment changes.
763 * data/lalr1.cc: here.
764
87f28efe
AD
7652009-02-25 Akim Demaille <demaille@gostai.com>
766
767 Fix glr.cc's debug level handling.
768 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
769 glr.c which is used.
770 (debug_level, set_debug_level): Adjust.
771
9be2a009
AD
7722009-02-25 Akim Demaille <demaille@gostai.com>
773
774 Copyright years.
775 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
776
07a6e87d
AD
7772009-02-25 Akim Demaille <demaille@gostai.com>
778
779 Style changes.
780 * etc/bench.pl.in (generate_grammar_list): Consitently use
781 location_type, not yy::location.
782
33c78bd2
AD
7832009-02-25 Akim Demaille <demaille@gostai.com>
784
785 Comment change.
786 * data/lalr1.cc: here.
787
49572920
AD
7882009-02-19 Akim Demaille <demaille@gostai.com>
789
790 Make yyparser::error public.
791 * data/lalr1.cc: here.
792 There is no good reason to keep it private (and it is convenient
793 to use it from the scanner for instance). It is already public in
794 glr.cc.
795
88654b47
AD
7962009-02-19 Akim Demaille <demaille@gostai.com>
797
798 Comment changes.
799 * data/glr.cc: here.
800
4524c55b
AD
8012009-02-19 Akim Demaille <demaille@gostai.com>
802
803 Remove trailing blanks.
6a6e7f0c
AD
804 The epilogue has its own ending \n, no need to add another.
805
4524c55b
AD
806 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
807 epilogue.
808 * data/glr.cc: dnl when extending the epilogue.
809 Remove stray "private:".
810
6ceccee8
AD
8112009-02-19 Akim Demaille <demaille@gostai.com>
812
813 Use b4_c_modern.
814 * data/c.m4 (b4_c_function_decl): Here.
815
9c6a8966
AD
8162009-02-19 Akim Demaille <demaille@gostai.com>
817
818 Comment changes.
819 * data/lalr1.cc: here.
820
507aa0e2
AD
8212009-02-19 Akim Demaille <demaille@gostai.com>
822
823 Extract variant.hh
824 * data/variant.hh: New, extracted from...
825 * data/lalr1.cc: here.
826 Adjust.
827 * data/local.mk: Adjust.
828
51bacae6
AD
8292009-02-19 Akim Demaille <demaille@gostai.com>
830
831 Extract stack.hh from lalr1.cc.
832 * data/stack.hh: New.
833 * data/lalr1.cc: Extract from here.
834 * data/local.mk: Adjust.
835
06c3084f
JD
8362009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
837
838 Add reminder about uploading public key to keys.gnupg.net.
839 * HACKING (Release Procedure): Here.
840
0ea583d2
AD
8412009-01-28 Akim Demaille <demaille@gostai.com>
842
843 * NEWS: Update information about 2.4.1 and 2.4.2.
844
402b123d
AD
8452008-11-04 Akim Demaille <demaille@gostai.com>
846
847 Reformat NEWS.
848 * NEWS: Use more outline-mode markup.
849 Suggested by Jim Meyering.
850
74553c98
AD
8512009-01-08 Akim Demaille <demaille@gostai.com>
852
853 Fix grep portability issues.
854 Grep on Solaris does not support -q.
855 Reported by Summum Bonum.
856
857 * NEWS: Add a stub for 2.4.2.
858 * THANKS: Add Summum Bonum.
859 * tests/atlocal.in (EGREP): New.
860 (CC, CXX, XSLTPROC): Make it possible to override them via
861 envvars.
862 * tests/java.at: Use $EGREP instead of egrep.
863 Use AT_CHECK's ignore instead of grep's -q.
864
84eedf86
AD
8652008-12-11 Akim Demaille <demaille@gostai.com>
866
867 Pass the token type to yysyntax_error.
868 * data/yacc.c (yysyntax_error): Take the transated token instead
869 of the raw number.
870 Adjust callers.
871 * TODO: Update.
872
5860cc8c
AD
8732008-12-11 Akim Demaille <demaille@gostai.com>
874
875 Formatting changes.
876 * data/glr.c: Formatting changes.
877
2b008529
AD
8782008-12-11 Akim Demaille <demaille@gostai.com>
879
880 Propagate i18n changes into glr.c.
881 * TODO: Update.
882 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
883 building the error message format dynamically.
884 * data/lalr1.java: Formatting changes.
885
2cd1af95
AD
8862008-12-11 Akim Demaille <demaille@gostai.com>
887
888 Use testsuite -C.
889 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
890 Solves problems when top_srcdir is an absolute path.
891 Suggested by Eric Blake.
892 * configure.ac: Require Autoconf 2.62.
893
eeb29422
AD
8942008-12-11 Akim Demaille <demaille@gostai.com>
895
896 Simplify the i18n of the error messages.
897 * data/lalr1.cc: Comment changes.
898 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
899 lalr1.cc instead of building dynamically the format string.
900
6617622c
AD
9012008-12-08 Akim Demaille <demaille@gostai.com>
902
903 Fix portability issue in the test suite.
904 * tests/local.at (AT_MATCHES_CHECK): New.
905 Based on Perl instead of Sed. Sed has too many portability
906 pitfalls, not ever Sed is GNU Sed.
907 * tests/actions.at (Fix user actions without a trailing semicolon):
908 Use it.
909
2ca1136c
AD
9102008-12-08 Akim Demaille <demaille@gostai.com>
911
912 Update data/README.
913 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
914
6c63b895
AD
9152008-12-08 Akim Demaille <demaille@gostai.com>
916
917 Install autoconf as a submodule to get m4sugar.
918 * .gitmodules: Add submodules/autoconf.
919 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
920 submodules/autoconf.
921
417e31d2
AD
9222008-12-08 Akim Demaille <demaille@gostai.com>
923
924 Test token.prefix in all the skeletons.
925 * data/java.m4 (b4_token_enum): Use the token.prefix.
926 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
927 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
928 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
929 * tests/java.at: Comment changes.
930 (AT_CHECK_JAVA_MINIMAL): Define the END token.
931 (Java parser class and package names): Add token.prefix check.
932
97abf544
AD
9332008-12-08 Akim Demaille <demaille@gostai.com>
934
935 Fix regeneration of atconfig.
936 * tests/local.mk (tests/atconfig): The rule was incorrect, but
937 remove it: now that there is no tests/Makefile.am, the top-level
938 Makefile properly updates atconfig when needed.
939
e8cd1ad6
DJ
9402008-12-07 Di-an Jan <dianj@freeshell.org>
941
942 Implement the FIXME that ends an user action with a semicolon
943 if it seems necessary.
944 * src/scan-code.l (flex rules section): Flag cpp directive from
945 any `#' to the first unescaped end-of-line. Semicolon is not
946 needed after `;', `{', '}', or cpp directives and is needed after
947 any other token (whitespaces and comments have no effect).
948 * tests/actions.at (Fix user actions without a trailing semicolon):
949 New test.
950 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
951 to make user actions complete statements.
952 Adjust column numbers in error messages.
953 * tests/regression.at (Fix user actions without a trailing semicolon):
954 Remove. Covered by new test.
955
ce9447fc
AD
9562008-12-07 Akim Demaille <demaille@gostai.com>
957
958 Update gnulib.
959 * gnulib: Update from master.
960
d333175f
EB
9612008-12-05 Eric Blake <ebb9@byu.net>
962
963 Avoid compiler warning.
964 * src/output.c (muscle_insert_item_number_table): Delete unused
965 function.
966
215b40ac
EB
9672008-12-02 Eric Blake <ebb9@byu.net>
968
969 Build testsuite with newer autoconf.
970 * tests/output.at (m4_expand): Don't override in newer autoconf,
971 where the underlying implementation changed.
972 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
973 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
974 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
975 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
976 since some of them contain unbalanced ')'.
977
3bb21113
AD
9782008-12-01 Akim Demaille <demaille@gostai.com>
979
980 Use b4_symbol for printers and destructors everywhere.
981 * data/bison.m4 (b4_symbol_action_location): New.
982 * data/c.m4 (b4_symbol_actions): Remove.
983 Adjust all callers to use by b4_symbol_foreach and the corresponding
984 b4_symbol_printer/destructor macro.
985 * data/glr.cc: Adjust.
986 * data/lalr1.java: Adjust the %destructor sanity check.
987 * src/output.c (symbol_code_props_output): Remove, we no longer
988 need the b4_symbol_printers/destructors tables.
989
fb7c5b1f
AD
9902008-12-01 Akim Demaille <demaille@gostai.com>
991
992 Use b4_symbol_case_.
993 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
994 b4_symbol_case_.
995
cf6fb222
AD
9962008-12-01 Akim Demaille <demaille@gostai.com>
997
998 Move b4_symbol based macro to bison.m4.
999 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1000 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1001 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1002 (b4_type_foreach): Move to...
1003 * data/bison.m4: Here.
1004 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1005 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 1006
e3c52a63
AD
10072008-12-01 Akim Demaille <demaille@gostai.com>
1008
1009 b4_symbol/type_foreach.
1010 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1011 Use them.
1012
2bde9113
AD
10132008-12-01 Akim Demaille <demaille@gostai.com>
1014
1015 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
1016 Instead of defining complex list of tuples to define various
1017 properties of the symbols, we now prefer to define symbols as
1018 "structs" in m4: using the symbol key (its number), and the
1019 property name, b4_symbol gives it value. Use this to handle
1020 destructors and printers.
1021
2bde9113
AD
1022 * src/output.c (CODE_PROP): New.
1023 (prepare_symbol_definitions): Use it to define the printer and
1024 destructor related attributes of the symbols.
1025 * data/lalr1.cc (b4_symbol_actions): Rename as...
1026 (b4_symbol_action): this.
1027 Use b4_symbol instead of 6 arguments.
1028 (b4_symbol_printer, b4_symbol_destructor): New.
1029 Use them instead of b4_symbol_actions.
1030
44494bf6
AD
10312008-12-01 Akim Demaille <demaille@gostai.com>
1032
1033 Avoid capturing variables too easily.
1034 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1035 v__ and p__ instead of v and p.
1036
fad814bd
AD
10372008-12-01 Akim Demaille <demaille@gostai.com>
1038
1039 Remove spurious empty line before syncline.
1040 * data/bison.m4 (b4_syncline): Don't output an empty line before
1041 the output.
1042
feda5527
AD
10432008-11-26 Akim Demaille <demaille@gostai.com>
1044
1045 Convert lib/Makefile.am into lib/local.mk.
1046 The real problem is rather gnulib.mk, which itself is extracted
1047 from a Makefile.am that gnulib expects to the "recursive". The
1048 tool prefix-gnulib-mk converts such a gnulib.mk to be
1049 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1050
1051 * etc/prefix-gnulib-mk: New.
1052 * bootstrap (slurp): Use it to convert further gnulib.mk.
1053 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1054 are deeper.
1055 * lib/Makefile.am: Rename as...
1056 * lib/local.mk: this.
1057 Adjust to be prefixed.
1058 * Makefile.am, configure.ac: Adjust.
1059 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1060
56ddee7f
AD
10612008-11-26 Akim Demaille <demaille@gostai.com>
1062
1063 s/_FLAGS/FLAGS/.
1064 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1065 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1066 Reported by Eric Blake.
1067
728e89a0
AD
10682008-11-26 Akim Demaille <demaille@gostai.com>
1069
1070 Use b4_parser_tables_define in glr.cc.
1071 * data/glr.c: Use b4_parser_tables_define instead of defining the
1072 (deterministic integral) tables by hand.
1073
2c1bf9bd
AD
10742008-11-26 Akim Demaille <demaille@gostai.com>
1075
1076 Use b4_parser_tables_define in Java.
1077 * data/java.m4 (b4_typed_parser_table): Rename as...
1078 (b4_typed_parser_table_define): this, for consistency.
1079 Accept a comment as $4.
1080 Move $2 into yy*_.
1081 (b4_integral_parser_table): Rename as...
1082 (b4_integral_parser_table_define): this.
1083 * data/lalr1.java: Adjust all uses.
1084 Use b4_parser_tables_define instead of generation by hand.
1085
ba206cf4
AD
10862008-11-26 Akim Demaille <demaille@gostai.com>
1087
1088 Prepare the convergence bw C style and Java table generation.
1089 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1090 (b4_tables_define): Rename as...
1091 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1092 (b4_parser_tables_define): these.
1093 * data/c.m4 (b4_table_define): Rename as...
1094 (b4_integral_parser_table_define): this.
1095 * data/lalr1.cc: Adjust.
1096 (b4_table_define, b4_table_declare): Rename as...
1097 (b4_integral_parser_table_define)
1098 (b4_integral_parser_table_declare): these.
1099 (yyrline_): Move the comment where it is actually used.
1100 * data/yacc.c: Adjust.
1101 (yyrline): Use b4_integral_parser_table_define.
1102
d12f8e49
AD
11032008-11-26 Akim Demaille <demaille@gostai.com>
1104
1105 Regen.
1106 * src/parse-gram.h, src/parse-gram.c: Regen.
1107
0991e29b
AD
11082008-11-26 Akim Demaille <demaille@gostai.com>
1109
1110 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1111 * data/lalr1.cc (b4_tables_map): Move to...
1112 * data/bison.m4: here.
1113 Update the comment for yytable during the flight.
1114 (b4_tables_declare, b4_tables_define): New.
1115 * data/lalr1.cc: Use them.
1116 * data/c.m4 (b4_table_define): New.
1117 * data/yacc.c: Use b4_tables_define instead of output the tables
1118 by hand.
1119 * tests/regression.at (Web2c Actions): Adjust the expected output,
1120 the order of the tables changed.
1121
3d3bc1fe
AD
11222008-11-26 Akim Demaille <demaille@gostai.com>
1123
1124 Get rid of (yy)rhs and (yy)prhs.
1125 These tables are no longer needed in the parsers, and they don't seem to
1126 be useful. They are not documented either.
feda5527 1127
3d3bc1fe
AD
1128 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1129 Adjust the computation of (yy)r2.
1130
08c81469
AD
11312008-11-26 Akim Demaille <demaille@gostai.com>
1132
1133 Rule length is unsigned.
1134 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1135
932b0c96
AD
11362008-11-26 Akim Demaille <demaille@gostai.com>
1137
1138 Get rid of lalr1-split.cc.
1139 It was no longer maintainer.
feda5527 1140
932b0c96
AD
1141 * data/lalr1-split.cc: Remove.
1142 * etc/bench.pl.in (bench_fusion_parser): Remove.
1143 Adjust.
1144
8452c667
AD
11452008-11-26 Akim Demaille <demaille@gostai.com>
1146
1147 Use yy* consistently.
1148 * data/glr.c: Now that yyrhs no longer exists as a global
1149 variable, rename local "rhs" variables into "yyrhs" for
1150 consistency.
1151
783aa653
AD
11522008-11-25 Akim Demaille <demaille@gostai.com>
1153
1154 Get rid of yyrhs and yyprhs in glr.c.
1155 * data/glr.c (yyrhs, yyprhs): Remove.
1156 Instead, use the state stack and yystos.
1157
6130b755
AD
11582008-11-25 Akim Demaille <demaille@gostai.com>
1159
1160 Flag glr tests.
1161 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1162 as an Autotest keyword.
1163
95a7b1c9
AD
11642008-11-25 Akim Demaille <demaille@gostai.com>
1165
1166 Prefer TESTSUITE_FLAGS.
1167 TESTSUITEFLAGS is barely readable.
feda5527 1168
95a7b1c9
AD
1169 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1170 for backward compatibility.
1171 Use the former instead of the latter.
1172
b4f18401
AD
11732008-11-25 Akim Demaille <demaille@gostai.com>
1174
1175 Get rid of yyrhs and yyprhs in larl1.java.
1176 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1177 (yy_reduce_print): Rather, use yystos_ and the state stack.
1178
c265fd6b
AD
11792008-11-25 Akim Demaille <demaille@gostai.com>
1180
1181 Formatting changes.
1182
68dbdee8
AD
11832008-11-25 Akim Demaille <demaille@gostai.com>
1184
1185 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
1186 They were used to get the symbol types, given a rule number, when
1187 displaying the top of the stack before a reduction. But the
1188 symbol type is available from the state stack. This has two be
1189 benefits: two tables less in the parser (making it smaller), and a
1190 more consistent use of the three stacks which will help to fuse
1191 them.
feda5527 1192
68dbdee8
AD
1193 * data/yacc.c (yyprhs, yyrhs): Remove.
1194 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1195 (yy_reduce_print): Take yyssp as argument.
1196 Use it, together with yystos, to get the symbol type.
1197 * tests/regression.at (Web2c Report): Remove these tables from the
1198 expected output.
1199
6ab1adbe
AD
12002008-11-25 Akim Demaille <demaille@gostai.com>
1201
1202 b4_tables_map.
1203 The point is to factor the generation of the tables across skeletons.
1204 This is language dependant.
feda5527 1205
6ab1adbe
AD
1206 * data/c.m4 (b4_comment_): New.
1207 Should be usable to define how to generate tables independently of
1208 the language.
1209 (b4_c_comment): New.
1210 (b4_comment): Bounce to b4_c_comment.
1211 Now support $2 = [PREFIX] for indentation.
1212 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1213 there is no comment.
1214 Indent it properly when there is one.
1215 Output the ending semicolon.
1216 (b4_table_define): Space changes.
1217 Output the ending semicolon.
1218 (b4_tables_map): New.
1219 Use it twice instead of declaring and defining the (integral)
1220 tables by hand.
1221
0fddb3d5
AD
12222008-11-25 Akim Demaille <demaille@gostai.com>
1223
1224 b4_table_declare.
1225 * data/lalr1.cc (b4_table_declare): New.
1226 Use it to declare the tables defined with b4_table_define.
1227 (b4_table_define): Declare a third arg to match b4_table_declare
1228 signature.
1229 Move all the comments around invocations of b4_table_define into
1230 the invocations itselves.
1231 Move things around to have the order for declarations and
1232 definitions.
1233
c4ddc0fb
AD
12342008-11-25 Akim Demaille <demaille@gostai.com>
1235
1236 Formatting changes.
1237 * data/lalr1.java: here.
1238
e0c653e7
AD
12392008-11-25 Akim Demaille <demaille@gostai.com>
1240
1241 b4_args is more general than only C++.
1242 * data/lalr1.cc (b4_args, _b4_args): Move to...
1243 * data/bison.m4: here.
1244
4182a0a1
DJ
12452008-11-21 Di-an Jan <dianj@freeshell.org>
1246
1247 Implement no-XXX arguments for --warnings, --report, --trace.
1248 * src/getargs.c (flags_argmatch): Handles no-XXX.
1249 Fix typo in doxygen comment.
1250
01466c3e
AD
12512008-11-21 Akim Demaille <demaille@gostai.com>
1252
1253 Display the changes in cross-options.texi.
1254 * build-aux/cross-options.pl ($sep): New, to separate items.
1255 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1256 changes.
1257
a7c09cba
DJ
12582008-11-20 Di-an Jan <dianj@freeshell.org>
1259
1260 Improves options in the manual.
1261 * doc/bison.texinfo (-g, -x): Add space before argument.
1262 (Option Cross Key): Implement FIXME: listing directives also.
1263 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1264 (Short Option): Special case -d. Put arguments inside @option.
feda5527 1265 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
1266 src/scan-gram.l (actual name passed as the first argument)
1267 with special case for %define.
1268 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
1269 to build-aux/cross-options.pl.
1270 * src/getargs.c (usage): Document limitations of cross-options.pl.
1271 * src/scan-gram.l: Likewise.
1272
6c88b51e
JD
12732008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1274
1275 Fix unexpanded macros in GLR defines file.
1276 Reported by Csaba Raduly at
1277 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1278 * THANKS (Csaba Raduly): Add.
1279 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1280 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1281 lexer in a separate module that includes the defines file.
1282 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
1283 source.
1284 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1285 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1286 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1287 (AT_DATA_SOURCE_PROLOGUE): New.
1288 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1289 (AT_DATA_SOURCE): New.
1290 (AT_FULL_COMPILE): Extend to support an additional source file.
1291
1e034807
AD
12922008-11-18 Akim Demaille <demaille@gostai.com>
1293
1294 More TODO.
1295 * TODO: More short term issues.
1296
e3dda35c
AD
12972008-11-18 Akim Demaille <demaille@gostai.com>
1298
1299 Regen.
1300 * src/parse-gram.h, src/parse-gram.c: Regen.
1301
bd187d7b
AD
13022008-11-18 Akim Demaille <demaille@gostai.com>
1303
1304 Use b4_subtract where possible.
1305 * data/lalr1.cc (b4_subtract): Move to...
1306 * data/bison.m4: here.
1307 * data/glr.c (b4_rhs_data): Use it.
1308 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
1309
6085ab0d
AD
13102008-11-18 Akim Demaille <demaille@gostai.com>
1311
1312 Remove incorrect mode specification.
1313 * data/glr.cc: Don't pretend it's C code.
1314
9ce405ce
JD
13152008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1316
1317 Simplify last patch slightly.
1318 * src/getargs.c (getargs): Here.
1319
a8beef7e
JD
13202008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1321
1322 Fix last warning from --enable-gcc-warnings.
1323 * src/getargs.c (getargs): Don't assign const address to non-const
1324 pointer.
1325
d50eea6d
JD
13262008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1327
1328 Don't let maintainer-*-check targets force a version update.
1329 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1330 handled.
1331
f5f419de
DJ
13322008-11-17 Di-an Jan <dianj@freeshell.org>
1333
1334 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1335 Align menus. Adjust word wrapping. Use node names for menu names.
1336 (Examples): Don't abbreviate node names.
1337 (LocalWords): Remove abbreviations.
1338 (Copying): Make description a sentence.
d50eea6d 1339 (Java Action Features): Remove period to match the rest of menu.
f5f419de 1340
d73e55e0
DJ
13412008-11-17 Di-an Jan <dianj@freeshell.org>
1342
1343 Handles several --enable-gcc-warnings.
1344 * src/getargs.c (command_line_location): Set parameters to void.
1345 * src/output.c (symbol_type_name_cmp): Make static.
1346 (symbols_by_type_name): Set parameters to void.
1347 (symbol_definitions_output): Remove unused parameter. Rename as...
1348 (prepare_symbol_definitions): this.
1349 (muscles_output): Move symbol_definitions_output to...
1350 (output): here as prepare_symbol_definitions.
1351 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 1352 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 1353
68c989de
DJ
13542008-11-17 Di-an Jan <dianj@freeshell.org>
1355
1356 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
1357 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
1358
23ce6f4c
AD
13592008-11-16 Akim Demaille <demaille@gostai.com>
1360
1361 Add missing $(EXEEXT).
1362 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
1363 "src/bison$(EXEEXT)".
1364 Reported by Di-an Jan.
1365
dd704c35
AD
13662008-11-15 Akim Demaille <demaille@gostai.com>
1367
1368 * TODO: Update.
1369
dab244d5
AD
13702008-11-15 Akim Demaille <demaille@gostai.com>
1371
1372 Formatting changes.
1373 * tests/input.at: here.
1374
4b4da9fb
AD
13752008-11-15 Akim Demaille <demaille@gostai.com>
1376
1377 Remove duplicate header inclusion.
1378 * src/LR0.c: here.
1379
4ea3f53d
AD
13802008-11-15 Akim Demaille <demaille@gostai.com>
1381
1382 * src/parse-gram.h, src/parse-gram.c: Regen.
1383
cb823b6f
AD
13842008-11-15 Akim Demaille <demaille@gostai.com>
1385
1386 Support parametric types.
b06df3c2
AD
1387
1388 There are two issues to handle: first scanning nested angle
1389 bracket pairs to support types such as std::pair< std::string,
1390 std::list<std::string> > >.
1391
1392 Another issue is to address idiosyncracies of C++: do not glue two
1393 closing angle brackets together (otherwise it's operator>>), and
1394 avoid sticking blindly a TYPE to the opening <, as it can result
1395 in '<:' which is a digraph for '['.
1396
cb823b6f
AD
1397 * src/scan-gram.l (brace_level): Rename as...
1398 (nesting): this.
1399 (SC_TAG): New.
1400 Implement support for complex tags.
b06df3c2 1401 (tag): Accept
cb823b6f
AD
1402 , but not <.
1403 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
1404 (b4_symbol_variant): Leave space around types as parameters.
1405 * examples/variant.yy: Use nested template types and leading ::.
1406 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
1407 Rename as...
1408 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
1409 * tests/c++.at: Test parametric types.
1410
7b6e6753
AD
14112008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1412
1413 Test token.prefix.
1414 This is not sufficient, but we test at least that the make_SYMBOL
1415 interface is not affected by token.prefix. A more general test
1416 will be implemented when the support of token.prefix is generalized
1417 to more skeletons.
b06df3c2 1418
7b6e6753
AD
1419 * tests/c++.at: One more variant test, using token.prefix.
1420
dddec537
AD
14212008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1422
1423 Test the make_TOKEN interface.
1424 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
1425 Factor the common code in yylex.
1426 Use it to test "%define lex_symbol".
1427
7d3e21ba
AD
14282008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1429
1430 Formatting change.
1431
4fc55348
AD
14322008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1433
1434 Simplify code for variants bench marks.
1435 * etc/bench.pl.in (&generate_grammar_list): Define and use
1436 location_type.
1437 Factor the common code in yylex.
1438
070e6509
AD
14392008-11-15 Akim Demaille <demaille@gostai.com>
1440
1441 Better error message.
1442 * bootstrap (find_tool): Fix the error message.
1443
0078681b
AD
14442008-11-15 Akim Demaille <demaille@gostai.com>
1445
1446 Update variant.yy to newest interface.
1447 * examples/variant.yy: Define lex_symbol.
1448 Adjust.
1449
ff084799
AD
14502008-11-15 Akim Demaille <demaille@gostai.com>
1451
1452 Don't use locations in variant.yy.
1453 * examples/variant.yy: Adjust to not using locations.
1454
b0d79ec6
AD
14552008-11-15 Akim Demaille <demaille@gostai.com>
1456
1457 Comment changes.
1458 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1459 comments for the license.
1460
d4977ce3
AD
14612008-11-15 Akim Demaille <demaille@gostai.com>
1462
1463 Remove tests/Makefile.am.
1464 * tests/Makefile.am: Rename as...
1465 * tests/local.mk: this.
1466 * Makefile.am, configure.ac: Adjust.
1467 * Makefile.am (DISTCLEANFILES): Define.
1468 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1469 Remove, we no longer need to bounce to the real targets.
1470
87f1149a
AD
14712008-11-15 Akim Demaille <demaille@gostai.com>
1472
1473 Comment changes.
1474
36415906
AD
14752008-11-15 Akim Demaille <demaille@gostai.com>
1476
1477 djgpp/local.mk.
1478 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1479 * djgpp/local.mk: this new file.
1480
e2c2f696
AD
14812008-11-15 Akim Demaille <demaille@gostai.com>
1482
1483 Remove doc/Makefile.am.
1484 * doc/Makefile.am: Rename as...
1485 * doc/local.mk: this.
1486 Adjust paths
1487 * Makefile.am, configure.ac: Adjust.
1488 * Makefile.am (MOSTLYCLEANFILES): New.
1489 * src/local.mk: Adjust.
1490
2ead32e6
AD
14912008-11-15 Akim Demaille <demaille@gostai.com>
1492
1493 Move sc_tight_scope into maint.mk.
b06df3c2
AD
1494 It does not work, and I don't know how it was supposed to work: it
1495 seems to be looking for sources in the build tree. I just moved
1496 it at a better place, fixing it is still required.
1497
2ead32e6
AD
1498 * src/local.mk (echo): Remove.
1499 (sc_tight_scope): Move to...
1500 * maint.mk: here.
1501
2df9ec37
AD
15022008-11-15 Akim Demaille <demaille@gostai.com>
1503
1504 Regen.
1505 * src/parse-gram.h, src/parse-gram.h: Regen.
1506
0305d25e
AD
15072008-11-15 Akim Demaille <demaille@gostai.com>
1508
1509 Remove src/Makefile.am.
1510 * src/Makefile.am: Rename as...
1511 * src/local.mk: this.
1512 Prefix all the paths with src/.
1513 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1514 (AM_CPPFLAGS): Find find in builddir/src.
1515 (YACC): Move the flags into...
1516 (AM_YFLAGS): here.
1517 * maint.mk (sc_tight_scope): Disable.
1518 It used to bounce to the version in src/Makefile.am which is now
1519 part of this very Makefile.
1520 * Makefile.am, configure.ac: Adjust.
1521 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1522 include "..." to find files "here": we are no longer in src/, so
1523 qualify the includes with src/.
1524 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1525 prefix.
1526 (.x.1): Adjust to be able to create src/foo from the top level
1527 Makefile, instead of going bounce to src/Makefile the creation of
1528 foo.
1529
5277c0a3
AD
15302008-11-15 Akim Demaille <demaille@gostai.com>
1531
1532 Remove useless variable.
1533 * doc/Makefile.am (srcsrcdir): Remove.
1534
6a5aa0cd
AD
15352008-11-15 Akim Demaille <demaille@gostai.com>
1536
1537 Remove data/Makefile.am.
1538 * data/Makefile.am: Rename as...
1539 * data/local.mk: this.
1540 Adjust paths.
1541 * Makefile.am, configure.ac: Adjust.
1542
7cb794dc
AD
15432008-11-15 Akim Demaille <demaille@gostai.com>
1544
1545 Remove etc/Makefile.am.
1546 * etc/Makefile.am: Rename as...
1547 * etc/local.mk: this.
1548 Adjust.
1549 * Makefile.am, configure.ac: Adjust.
1550
cd409e3b
AD
15512008-11-15 Akim Demaille <demaille@gostai.com>
1552
1553 Remove examples/local.mk.
1554 examples/calc++/Makefile.am might be interesting to keep as is, since
1555 it is an example in itself.
2df9ec37 1556
cd409e3b
AD
1557 * examples/Makefile.am: Rename as...
1558 * examples/local.mk: this.
1559 Adjust.
1560 * Makefile.am, configure.ac: Adjust.
1561
9a1e4214
AD
15622008-11-15 Akim Demaille <demaille@gostai.com>
1563
1564 Remove build-aux/Makefile.am.
1565 Recursive Makefiles are really way too slow, let's get rid of some of
1566 them.
2df9ec37 1567
9a1e4214
AD
1568 * build-aux/Makefile.am: Rename as...
1569 * build-aux/local.mk: this.
1570 Adjust paths.
1571 * Makefile.am, configure.ac: Adjust.
1572
0634493c
AD
15732008-11-15 Akim Demaille <demaille@gostai.com>
1574
1575 Provide convenience constructors for locations and positions.
1576 * data/location.cc (position::position): Accept file, line and
1577 column as arguments with default values.
1578 Always qualify initial line and column literals as unsigned.
1579 (location::location): Provide convenience constructors.
1580
fe1b448a
AD
15812008-11-15 Akim Demaille <demaille@gostai.com>
1582
b06df3c2
AD
1583 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1584 token type.
fe1b448a
AD
1585 Using template buys us nothing, and makes it uselessly complex to
1586 construct a symbol. Besides, it could not be generalized to other
1587 languages, while make_FOO would work in C/Java etc.
2df9ec37 1588
fe1b448a
AD
1589 * data/lalr1.cc (b4_symbol_): New.
1590 (b4_symbol): Use it.
1591 (b4_symbol_constructor_declaration_)
1592 (b4_symbol_constructor_definition_): Instead of generating
1593 specializations of an overloaded template function, just generate
1594 several functions whose names are forged from the token names
1595 without the token.prefix.
1596 (b4_symbol_constructor_declarations): Generate them for all the
1597 symbols, not just by class of symbol type, now that instead of
1598 specializing a function template by the token, we generate a
1599 function named after the token.
1600 (b4_symbol_constructor_specialization_)
1601 (b4_symbol_constructor_specializations): Remove.
1602 * etc/bench.pl.in: Adjust to this new API.
1603
5679f311
AD
16042008-11-13 Akim Demaille <demaille@gostai.com>
1605
1606 %define token.prefix.
b06df3c2
AD
1607 Provide a means to add a prefix to the name of the tokens as
1608 output in the generated files. Because of name clashes, it is
1609 good to have such a prefix such as TOK_ that protects from names
1610 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 1611
5679f311
AD
1612 * data/bison.m4 (token.prefix): Empty by default.
1613 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1614 * data/lalr1.cc (b4_symbol): Ditto.
1615
3204049e
AD
16162008-11-13 Akim Demaille <demaille@gostai.com>
1617
1618 Compute at M4 time some of the subtractions.
90290ce5 1619 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
1620 (b4_rhs_data): Use it.
1621
202598d3
AD
16222008-11-13 Akim Demaille <demaille@gostai.com>
1623
1624 symbol::token.
b06df3c2 1625 This allows the user to get the type of a token returned by yylex.
2df9ec37 1626
202598d3
AD
1627 * data/lalr1.cc (symbol::token): New.
1628 (yytoknum_): Define when %define lex_symbol, independently of
1629 %debug.
1630 (yytoken_number_): Move into...
1631 (symbol::token): here, since that's the only use.
1632 The other one is YYPRINT which was not officially supported
1633 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1634 array under a different name (yytoknum).
1635
fc2476c7
AD
16362008-11-13 Akim Demaille <demaille@gostai.com>
1637
1638 YYERRCODE.
1639 * TODO (YYERRCODE): Mention the case of $undef.
1640
865f1e9f
AD
16412008-11-13 Akim Demaille <demaille@gostai.com>
1642
1643 TODO: YYPRINT.
1644 * TODO (YYPRINT): New.
1645
cb0b136a
AD
16462008-11-13 Akim Demaille <demaille@gostai.com>
1647
1648 Comment changes.
1649 * data/lalr1.cc, data/yacc.c: Fix the description of the
1650 yytranslate and yytoknum tables.
1651
2c086d29
AD
16522008-11-13 Akim Demaille <demaille@gostai.com>
1653
1654 Define make_symbol in the header.
b06df3c2
AD
1655 To reach good performances these functions should be inlined (yet
1656 this is to measure precisely). To this end they must be available
1657 to the caller.
2df9ec37 1658
2c086d29
AD
1659 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1660 location_type with the class name.
1661 Since will now be output in the header, declare "inline".
1662 No longer use b4_symbol_constructor_specializations, but
1663 b4_symbol_constructor_definitions in the header.
1664 Don't call it in the *.cc file.
1665
1c4af381
AD
16662008-11-13 Akim Demaille <demaille@gostai.com>
1667
1668 Define yytranslate in the header for lex_symbol.
1669 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1670 into the header file when using %define lex_symbol.
1671 (yytranslate_): Declare inline.
1672
e51b0a82
AD
16732008-11-13 Akim Demaille <demaille@gostai.com>
1674
b06df3c2
AD
1675 Define the constructors of symbol_type in
1676 b4_symbol_constructor_definitions.
e51b0a82 1677 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
1678 forthcoming patch will move elsewhere. Hence the interest of
1679 putting them together.
2df9ec37 1680
b06df3c2
AD
1681 The stack_symbol_type does not need to be moved, it is used only
1682 by the parser.
2df9ec37 1683
e51b0a82
AD
1684 * data/lalr1.cc: Move symbol_type and symbol_base_type
1685 constructors into...
1686 (b4_symbol_constructor_definitions): here.
1687 Adjust.
1688
78835571
AD
16892008-11-13 Akim Demaille <demaille@gostai.com>
1690
1691 Make it easier to move the definition of yytranslate_.
1692 Forthcoming changes will make it possible to use yytranslate_
1693 from outside the parser implementation file.
2df9ec37 1694
78835571
AD
1695 * data/lalr1.cc (b4_yytranslate_definition): New.
1696 Use it.
1697
c1e6c88c
AD
16982008-11-13 Akim Demaille <demaille@gostai.com>
1699
1700 Remove useless class specification.
1701 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1702 to refer to the class name to use a type defined by the class for
1703 arguments of member functions.
1704
4654b0c0
AD
17052008-11-13 Akim Demaille <demaille@gostai.com>
1706
1707 Finer input type for yytranslate.
1708 This patch is debatable: the tradition expects yylex to return an int
1709 which happens to correspond to token_number (which is an enum). This
1710 allows for instance to return characters (such as '*' etc.). But this
1711 goes against the stronger typing I am trying to have with the new
1712 lex interface which return a symbol_type. So in this case, feed
1713 yytranslate_ with a token_type.
2df9ec37 1714
4654b0c0
AD
1715 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
1716 expect a token_type.
1717
dd735e4e
AD
17182008-11-13 Akim Demaille <demaille@gostai.com>
1719
1720 Honor lex-params in %define lex_symbol mode.
1721 * data/lalr1.cc: Use b4_lex_param.
1722
6659366c
AD
17232008-11-13 Akim Demaille <demaille@gostai.com>
1724
1725 Simplify names.
1726 * src/output.c (symbol_definitions_output): Rename symbol
1727 attributes type_name and has_type_name as type and has_type.
1728 * data/lalr1.cc: Adjust uses.
1729
e9805e57
AD
17302008-11-13 Akim Demaille <demaille@gostai.com>
1731
1732 Use b4_type_names for the union type.
b06df3c2
AD
1733 The union used to compute the size of the variant used to iterate
1734 over the type of all the symbols, with a lot of redundancy. Now
1735 iterate over the lists of symbols having the same type-name.
2df9ec37 1736
e9805e57
AD
1737 * data/lalr1.cc (b4_char_sizeof_): New.
1738 (b4_char_sizeof): Use it.
1739 Adjust to be called with a list of numbers instead of a single
1740 number.
1741 Adjust its caller for new-line issues.
1742
aea10ef4
AD
17432008-11-13 Akim Demaille <demaille@gostai.com>
1744
1745 Define the "identifier" of a symbol.
b06df3c2
AD
1746 Symbols may have several string representations, for instance if
1747 they have an alias. What I call its "id" is a string that can be
1748 used as an identifier. May not exist.
2df9ec37 1749
b06df3c2
AD
1750 Currently the symbols which have the "tag_is_id" flag set are
1751 those that don't have an alias. Look harder for the id.
2df9ec37 1752
aea10ef4
AD
1753 * src/output.c (is_identifier): Move to...
1754 * src/symtab.c (is_identifier): here.
1755 * src/symtab.h, src/symtab.c (symbol_id_get): New.
1756 * src/output.c (symbol_definitions_output): Use it to define "id"
1757 and "has_id".
1758 Remove the definition of "tag_is_id".
1759 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
1760 "tag_is_id" were used to produce code.
1761 We still use "tag" for documentation.
1762
2ea7730c
AD
17632008-11-11 Akim Demaille <demaille@gostai.com>
1764
1765 Locations are no longer required by lalr1.cc.
1766 * data/lalr1.cc (_b4_args, b4_args): New.
1767 Adjust all uses of locations to make them optional.
1768 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
1769 (AT_CHECK_NAMESPACE): Check the use of locations.
1770 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
1771 without locations with lalr1.cc.
1772 Test these cases.
1773 * tests/output.at: Check lalr1.cc with and without location
1774 support.
1775 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
1776 Don't use locations.
1777
7ca2266a
AD
17782008-11-11 Akim Demaille <demaille@gostai.com>
1779
1780 AT_FULL_COMPILE.
1781 * tests/local.at (AT_FULL_COMPILE): New.
1782 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
1783
1a7a65f9
AD
17842008-11-11 Akim Demaille <demaille@gostai.com>
1785
1786 Support parens in calc++.
1787 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
1788 * examples/calc++/test (run): Check the expected output.
1789 Adjust callers.
1790 Check parens too.
1791
c944f7f2
AD
17922008-11-11 Akim Demaille <demaille@gostai.com>
1793
1794 Simplify lalr1.cc since %defines is mandatory.
1795 * data/lalr1.cc: Remove useless calls to b4_defines_if.
1796
dada3cd1
AD
17972008-11-11 Akim Demaille <demaille@gostai.com>
1798
1799 TODO: yyfmt.
1800 * TODO (yysyntax_error): New item.
1801
422c18f4
AD
18022008-11-11 Akim Demaille <demaille@gostai.com>
1803
1804 Prefer M4 to CPP.
1805 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
1806 YYERROR_VERBOSE.
1807
a0ffc175
AD
18082008-11-11 Akim Demaille <demaille@gostai.com>
1809
1810 Support i18n of the parse error messages.
1811 * TODO (lalr1.cc/I18n): Remove.
1812 * data/lalr1.cc (yysyntax_error_): Support the translation of the
1813 error messages, as done in yacc.c.
1814 Stay within the yy* pseudo namespace.
1815
00a8a083
AD
18162008-11-11 Akim Demaille <demaille@gostai.com>
1817
1818 More TODO.
1819 * TODO (single stack, yysyntax_error): New.
1820
09277875
AD
18212008-11-11 Akim Demaille <demaille@gostai.com>
1822
1823 Make it possible to return a symbol_type from yylex.
1824 * data/lalr1.cc (b4_lex_symbol_if): New.
1825 (parse): When lex_symbol is defined, expected yylex to return the
1826 complete lookahead.
1827 * etc/bench.pl.in (generate_grammar_list): Extend to support this
1828 yylex interface.
1829 (bench_variant_parser): Exercise it.
1830
64c1b92a
AD
18312008-11-11 Akim Demaille <demaille@gostai.com>
1832
1833 Remove useless bench case.
1834 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
1835 no longer used.
1836
2722aa42
AD
18372008-11-11 Akim Demaille <demaille@gostai.com>
1838
1839 Improve display of directives.
1840 * etc/bench.pl.in (parse_term): Don't add useless eol.
1841
918eb7c5
AD
18422008-11-11 Akim Demaille <demaille@gostai.com>
1843
1844 Use string_cast in the bench.
1845 * etc/bench.pl.in (generate_grammar_list): Define and use
1846 string_cast.
1847
39be9022
AD
18482008-11-11 Akim Demaille <demaille@gostai.com>
1849
1850 Replace yychar with a Boolean.
1851 * data/lalr1.cc (parse::yychar): Replace by...
1852 (parse::yyempty): this.
1853
a2e3fa77
AD
18542008-11-11 Akim Demaille <demaille@gostai.com>
1855
1856 Factor the tables.
1857 * TODO: New item.
1858
aba12ad1
AD
18592008-11-11 Akim Demaille <demaille@gostai.com>
1860
1861 Let yytranslate handle the eof case.
1862 * data/lalr1.cc (yytranslate_): Handle the EOF case.
1863 Adjust callers.
1864 No longer expect yychar to be equal to yyeof_, rather, test the
1865 lookahead's (translated) kind.
1866
27cb5b59
AD
18672008-11-11 Akim Demaille <demaille@gostai.com>
1868
1869 yychar cannot be empty in yyerrlab.
1870 * TODO (yychar == yyempty_): New.
1871 * data/lalr1.cc: Remove the handling of this case.
1872 This eases forthcoming changes related to yychar and yytranslate.
1873
fce629c0
AD
18742008-11-11 Akim Demaille <demaille@gostai.com>
1875
1876 Bench: syntactic sugar for %define/#define.
1877 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
1878 (&bench_push_parser, bench_variant_parser): Use this feature.
1879 (&eat): New.
1880 Use it.
1881
ce671960
AD
18822008-11-11 Akim Demaille <demaille@gostai.com>
1883
1884 Less memory pressure on the "list" bench.
1885 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
1886 the values, to limit memory pressure.
1887
2873fdf8
AD
18882008-11-11 Akim Demaille <demaille@gostai.com>
1889
1890 Introduce make_symbol.
b06df3c2
AD
1891 make_symbol provides a means to construct a full symbol (kind,
1892 value, location) in a single shot. It is meant to be a Symbol
1893 constructor, parameterized by the symbol kind so that overloading
1894 would prevent incorrect kind/value pairs. Unfortunately
1895 parameterized constructors do not work well in C++ (unless the
1896 parameter also appears as an argument, which is not acceptable),
1897 hence the use of a function instead of a constructor.
2df9ec37 1898
2873fdf8
AD
1899 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1900 (b4_symbol_constructor_declarations)
1901 (b4_symbol_constructor_specialization_)
1902 (b4_symbol_constructor_specializations)
1903 (b4_symbol_constructor_definition_)
1904 (b4_symbol_constructor_definitions): New.
1905 Use them where appropriate to generate declaration, declaration of
1906 the specializations, and implementations of the templated
1907 overloaded function "make_symbol".
1908 (variant::variant): Always define a default ctor.
1909 Also provide a copy ctor.
1910 (symbol_base_type, symbol_type): New ctor overloads for value-less
1911 symbols.
1912 (symbol_type): Now public, so that functions such as yylex can use
1913 it.
1914
8be046d7
AD
19152008-11-11 Akim Demaille <demaille@gostai.com>
1916
1917 Inform m4 whether a tag is a valid id.
1918 * src/output.c (is_identifier): New.
1919 (symbol_definitions_output): Use it to define tag_is_id.
1920 But maybe this should be done at m4 level?
1921
de62edee
AD
19222008-11-11 Akim Demaille <demaille@gostai.com>
1923
1924 Test 214 was failing: it greps with a pattern containing [ ]*
1925 which obviously meant to catch spaces and tabs, but contained only
1926 spaces. Tabulations in sources are a nuisance, so to simplify the
1927 matter, get rid of all the tabulations in the Java sources. The
1928 other skeletons will be treated equally later.
1929
1930 * data/java.m4, data/lalr1.java: Untabify.
1931 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
1932 tabulations are no longer generated.
1933
905f0697
PB
19342008-11-11 Paolo Bonzini <bonzini@gnu.org>
1935
1936 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1937 * configure.ac: Adjust usage.
1938 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1939 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1940 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1941
09ccae9b
DJ
19422008-11-10 Di-an Jan <dianj@freeshell.org>
1943
1944 Workaround Java's ``code too large'' problem for parser tables
1945 in most cases, by using one function per initialization.
1946 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
1947 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
1948 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
1949 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
1950 (yytname_): Use b4_typed_parser_table.
1951 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
1952 ``code too large'' error.
1953
1979121c
DJ
19542008-11-10 Di-an Jan <dianj@freeshell.org>
1955
1956 * NEWS: Document them.
de62edee 1957
1979121c
DJ
1958 General Java skeleton improvements.
1959 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
1960 using gcj < 4.3 in the testsuite, according to comments in
1961 gnulib/m4/javacomp.m4.
1962 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
1963 location_type, position_type): Remove extraneous brackets from
1964 b4_percent_define_default.
1965 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
1966 m4_define and m4_define_default.
1967 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
1968 which marks the end of user code with appropriate syncline, like all
1969 the other skeletons.
1970 (b4_user_post_prologue): Add. Don't silently drop.
1971 (yylex): Remove.
1972 (parse): Inline yylex.
1973 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
1974 (%{...%}): Fix typo of %code imports.
1975 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
1976
1977 Support annotations on parser class with %define annotations.
1978 * data/lalr1.java (annotations): Add to parser class modifier.
1979 * doc/bison.texinfo (Java Parser Interface): Document
1980 %define annotations.
1981 (Java Declarations Summary): Document %define annotations.
1982 * tests/java.at (Java parser class modifiers): Test annotations.
1983
1984 Do not generate code for %error-verbose unless requested.
1985 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
1986 Make private. Make conditional on %error-verbose.
1987 (getErrorVerbose, setErrorVerbose): New.
1988 (yytnamerr_): Make conditional on %error-verbose.
1989 (yysyntax_error): Make some code conditional on %error-verbose.
1990 * doc/bison.texinfo (Java Bison Interface): Remove the parts
1991 about %error-verbose having no effect.
1992 (getErrorVerbose, setErrorVerbose): Document.
1993
1994 Move constants for token names to Lexer interface.
1995 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
1996 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
1997 (parse): Qualify EOF to Lexer.EOF.
1998 * doc/bison.texinfo (Java Parser Interface): Move documentation of
1999 EOF and token names to Java Lexer Interface.
2000 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2001
2002 Make yyerror public.
2003 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2004 (yyerror): Change to public. Add Javadoc comments. Use longer
2005 parameter names. Make the body rather than the declarator
2006 conditional on %locations.
2007 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2008
2009 Allow user to add code to the constructor with %code init.
2010 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2011 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2012 Add %code init to the front of the constructor body.
2013 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2014 and %define init_throws.
2015 (Java Declarations Summary): Document %code init and
2016 %define init_throws.
2017 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2018 (Java constructor init and init_throws): Add tests.
de62edee 2019
42f832d6
AD
20202008-11-10 Akim Demaille <demaille@gostai.com>
2021
2022 Update TODO.
2023 * TODO (-D): is implemented.
2024 (associativity): Same precedence must have the same associativity.
2025 For instance, how can a * b / c be parsed if * is %left and / is
2026 %right?
2027 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2028
247efe34
AD
20292008-11-10 Akim Demaille <demaille@gostai.com>
2030
2031 Formatting changes.
2032
5d731440
AD
20332008-11-10 Akim Demaille <demaille@gostai.com>
2034
2035 More information about the symbols.
2036 * src/output.c (type_names_output): Document all the symbols,
2037 including those that don't have a type-name.
2038 (symbol_definitions_output): Define "is_token" and
2039 "has_type_name".
2040 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2041 type-name, now that they are defined too in b4_type_names.
2042
21db118b
AD
20432008-11-10 Akim Demaille <demaille@gostai.com>
2044
2045 Regen.
2046
6ed15cde
AD
20472008-11-10 Akim Demaille <demaille@gostai.com>
2048
2049 Make parser::yytranslate static.
b06df3c2
AD
2050 Small speedup (1%) on the list grammar. And makes yytranslate_
2051 available in non member functions.
de62edee 2052
6ed15cde
AD
2053 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2054 function.
2055
30bb2edc
AD
20562008-11-10 Akim Demaille <demaille@gostai.com>
2057
2058 Avoid trailing spaces.
2059 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2060 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2061 they can be empty, and anyway this incorrectly indents the first
2062 action.
2063
b3a28fd4
AD
20642008-11-10 Akim Demaille <demaille@gostai.com>
2065
2066 Comment changes.
2067
914202bd
AD
20682008-11-10 Akim Demaille <demaille@gostai.com>
2069
2070 Use "enum" for integral constants.
2071 This is just nicer to read, I observed no speedup.
de62edee 2072
914202bd
AD
2073 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2074 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2075 (yyuser_token_number_max_, yyundef_token_): Move into...
2076 (yytranslate_): here.
2077
c17f9a4a
AD
20782008-11-10 Akim Demaille <demaille@gostai.com>
2079
2080 Shortcuts in bench directives.
2081 * etc/bench.pl.in (parse_dirs): New.
2082 Use it.
2083 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2084 Create the benches in "benches/".
2085
b9855ea5
AD
20862008-11-10 Akim Demaille <demaille@gostai.com>
2087
2088 Formatting changes.
2089 * data/lalr1.cc: here.
2090
6e097787
AD
20912008-11-10 Akim Demaille <demaille@gostai.com>
2092
2093 Adjust verbose message to using emacs.
2094 * etc/bench.pl.in: Inform compilation-mode when we change the
2095 directory.
2096 (generate_grammar_list): Recognize %define "variant" in addition
2097 to %define variant.
2098
4c3cc7da
AD
20992008-11-10 Akim Demaille <demaille@gostai.com>
2100
2101 Classify symbols by type-name.
2102 * src/uniqstr.h (UNIQSTR_CMP): New.
2103 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2104 (type_names_output): New.
2105 (muscles_output): Use it.
2106 * data/lalr1.cc (b4_symbol_action_): Remove.
2107 (b4_symbol_case_, b4_type_action_): New.
2108 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2109
d69c9694
AD
21102008-11-10 Akim Demaille <demaille@gostai.com>
2111
2112 Change the handling of the symbols in the skeletons.
2113 Before we were using tables which lines were the symbols and which
2114 columns were things like number, tag, type-name etc. It is was
2115 difficult to extend: each time a column was added, all the numbers had
2116 to be updated (you asked for colon $2, not for "tag"). Also, it was
2117 hard to filter these tables when only a subset of the symbols (say the
2118 tokens, or the nterms, or the tokens that have and external number
2119 *and* a type-name) was of interest.
de62edee 2120
d69c9694
AD
2121 Now instead of monolithic tables, we define one macro per cell. For
2122 instance "b4_symbol(0, tag)" is a macro name which contents is
2123 self-decriptive. The macro "b4_symbol" provides easier access to
2124 these cells.
de62edee 2125
d69c9694
AD
2126 * src/output.c (type_names_output): Remove.
2127 (symbol_numbers_output, symbol_definitions_output): New.
2128 (muscles_output): Call them.
2129 (prepare_symbols): Define b4_symbols_number.
2130
5263bea9
AD
21312008-11-10 Akim Demaille <demaille@gostai.com>
2132
2133 --trace=muscles
2134 * src/getargs.h, src/getargs.c (trace_muscle): New.
2135 (trace_types, trace_args): Support it.
2136 * src/output.c (output_skeleton): Use it.
2137
4175f6bb
AD
21382008-11-10 Akim Demaille <demaille@gostai.com>
2139
2140 muscles_output.
2141 * src/output.c (muscles_output): New, extracted from...
2142 (output_skeleton): here.
2143 Adjust.
2144
1de69d6a
AD
21452008-11-10 Akim Demaille <demaille@gostai.com>
2146
2147 Formatting changes.
2148
36db78a7
AD
21492008-11-10 Akim Demaille <demaille@gostai.com>
2150
2151 Update the variant example.
2152 * examples/variant.yy: Formatting changes.
2153 One stage build.
2154
e5eb92e7
AD
21552008-11-10 Akim Demaille <demaille@gostai.com>
2156
2157 Support constructor with an argument.
2158 This improves the "list" bench by 2%.
de62edee 2159
e5eb92e7
AD
2160 * data/lalr1.cc (variant::build): Add an overloaded version with
2161 an argument.
2162 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2163
76307410
AD
21642008-11-10 Akim Demaille <demaille@gostai.com>
2165
2166 Test variants.
2167 * tests/c++.at (AT_CHECK_VARIANTS): New.
2168 Use it with and without %define assert.
2169
d78f0ac9
AD
21702008-11-10 Akim Demaille <demaille@gostai.com>
2171
2172 Add %precedence support.
2173 Unfortunately it is not possible to reuse the %prec directive. This
2174 is because to please POSIX, we do not require to end the rules with a
2175 semicolon. As a result,
de62edee 2176
d78f0ac9 2177 foo: bar %prec baz
de62edee 2178
d78f0ac9
AD
2179 is ambiguous: either a rule which precedence is that of baz, or a rule,
2180 and then a declaration of the precedence of the token baz.
de62edee 2181
d78f0ac9
AD
2182 * doc/bison.texinfo: Document %precedence.
2183 (Precedence Only): New.
2184 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2185 * src/conflicts.c (resolve_sr_conflict): Support it.
2186 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2187 Parse it.
2188 * tests/calc.at: Use %precedence for NEG.
2189 * tests/conflicts.at (%precedence does not suffice)
2190 (%precedence suffices): New tests.
2191
c85be41a
AD
21922008-11-09 Akim Demaille <demaille@gostai.com>
2193
2194 Make benches in a sub dirs.
2195 * etc/bench.pl.in ($dir): New.
2196 Use it.
2197 Check the use of constructors with an argument.
2198 (bench_variant_parser): Fix.
2199
db65ca1f
AD
22002008-11-09 Akim Demaille <demaille@gostai.com>
2201
2202 fix eof condition
2203
9b0efa5b
AD
22042008-11-09 Akim Demaille <demaille@gostai.com>
2205
2206 Fix --help.
2207
432ac57a
AD
22082008-11-09 Akim Demaille <demaille@gostai.com>
2209
2210 Require the generation of parse-gram.output.
2211 * src/Makefile.am (YACC): Pass --report=all.
2212
deef2a0a
AD
22132008-11-09 Akim Demaille <demaille@gostai.com>
2214
2215 Formatting changes.
2216
df72984a
AD
22172008-11-09 Akim Demaille <demaille@gostai.com>
2218
2219 Update TODO.
2220 * TODO: Remove obsolete items.
2221 Update others.
2222
f10e19fd
AD
22232008-11-09 Akim Demaille <demaille@gostai.com>
2224
2225 Enhance bench.pl.
2226 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2227 (@token, $grammar, $bench): New.
2228 (generate_grammar_variant): Rename as...
2229 (generate_grammar_list): this.
2230 (generate_grammar): Adjust.
2231 (bench_grammar): Rename as...
2232 (bench): this.
2233 Use it in the various bench-marking routines.
2234 (-b, -g): New options.
2235
5de9c593
AD
22362008-11-09 Akim Demaille <demaille@gostai.com>
2237
2238 Use a static hierarchy for symbols in the C++ parser.
2239 * data/lalr1.cc (symbol_base_type, symbol_type)
2240 (stack_symbol_type): Make it a static hierarchy.
2241 Adjust dependencies.
2242
757f8f98
AD
22432008-11-09 Akim Demaille <demaille@gostai.com>
2244
2245 bench.pl -d, --directive.
2246 * etc/bench.pl.in (@directive): New.
2247 (&bench_grammar): Use it.
2248 (&bench_list_grammar): New, to provide access to the "variant"
2249 grammar.
2250 Use it.
2251 (getopts): Support -d, --directive.
2252
d3be4f6d
AD
22532008-11-09 Akim Demaille <demaille@gostai.com>
2254
2255 Use inline for small operations.
2256 * data/lalr1.cc (symbol_base_type, symbol_type)
2257 (stack_symbol_type): Declare constructor and other operations as
2258 inline.
2259 (yy_destroy_): Inline.
2260
1f7d007b
AD
22612008-11-09 Akim Demaille <demaille@gostai.com>
2262
2263 Introduce a hierarchy for symbols.
2264 * data/lalr1.cc (symbol_base_type, symbol_type): New.
2265 (data_type): Rename as...
2266 (stack_symbol_type): this.
2267 Derive from symbol_base_type.
2268 (yy_symbol_value_print_): Merge into...
2269 (yy_symbol_print_): this.
2270 Rename as...
2271 (yy_print_): this.
2272 (yydestruct_): Rename as...
2273 (yy_destroy_): this.
2274 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
2275 (parser::parse): yyla is now of symbol_type.
2276 Use its type member instead of yytoken.
2277
bc0b0477
AD
22782008-11-09 Akim Demaille <demaille@gostai.com>
2279
2280 Rename data_type and stack_symbol_type.
2281 * data/lalr1.cc (data_type): Rename as...
2282 (stack_symbol_type): this.
2283
57295d14
AD
22842008-11-09 Akim Demaille <demaille@gostai.com>
2285
2286 Handle semantic value and location together.
2287 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
2288 yydata.value and yydata.location.
2289 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
2290 (YY_SYMBOL_PRINT): Now take semantic value and location as a
2291 single arg.
2292 Adjust all callers.
2293 (yydestruct_): New overload for a stack symbol.
2294
e9b0834e
AD
22952008-11-09 Akim Demaille <demaille@gostai.com>
2296
2297 Push a complete symbol, not connected parts.
2298 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
2299 state, value and location.
2300 Adjust callers.
2301
6082531a
AD
23022008-11-09 Akim Demaille <demaille@gostai.com>
2303
2304 Agregate yylval and yylloc.
2305 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
2306 (parser::yyla): this.
2307
33c195cc
AD
23082008-11-09 Akim Demaille <demaille@gostai.com>
2309
2310 Rely on the state stack to display reduction traces.
b06df3c2
AD
2311 To display rhs symbols before a reduction, we used information
2312 about the rule reduced, which required the tables yyrhs and
2313 yyprhs. Now use rely only on the state stack to get the same
2314 information.
de62edee 2315
33c195cc
AD
2316 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
2317 Use them.
2318 (parser::yyrhs_, parser::yyprhs_): Remove.
2319 (parser::yy_reduce_print_): Use the state stack.
2320
e1f93869
AD
23212008-11-09 Akim Demaille <demaille@gostai.com>
2322
2323 Fuse yyval and yyloc into yylhs.
2324 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
2325 yylhs.
2326 (parse): Replace yyval and yyloc with yylhs.value and
2327 yylhs.location.
2328 After a user action, compute yylhs.state earlier.
2329 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
2330 fresh error_token.
2331
2935744b
DJ
23322008-11-09 Di-an Jan <dianj@freeshell.org>
2333
2334 Remove unused variable.
2335 * src/output.c (type_names_output): Remove unused variable sep.
2336
bbf9ca37
PB
23372008-11-09 Paolo Bonzini <bonzini@gnu.org>
2338
2339 Change tests/output.at quoting.
2340 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
2341 expanding arguments.
2342
d9a9b96b
JD
23432008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2344
2345 Don't add a semicolon to actions for %skeleton or %language.
2346 It breaks Java test cases as reported by Akim Demaille.
2347 * src/scan-code.l: Implement.
2348
51365192
JD
23492008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2350
2351 Clean up %skeleton and %language priority implementation.
2352 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2353 remove static qualifier because others will soon need to see it.
2354 (language_prio): Likewise.
2355 (getargs): Use command_line_prio rather than 0.
2356 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2357 enum fields.
2358 (skeleton_prio): Extern it.
2359 (language_prio): Extern it.
2360 * src/parse-gram.y: Use grammar_prio rather than 1.
2361
9380cfd0
AD
23622008-11-07 Akim Demaille <demaille@gostai.com>
2363
2364 Moving push traces into yypush_.
2365 * data/lalr1.cc (yypush_): Now takes a optional trace message.
2366 Adjust all uses.
2367
8901f32e
AD
23682008-11-07 Akim Demaille <demaille@gostai.com>
2369
2370 The single-stack C++ parser is now the standard one.
2371 * data/lalr1.cc: Rename as...
2372 * data/lalr1-split.cc: this.
2373 * data/lalr1-fusion.cc: Rename as...
2374 * data/lalr1.cc: this.
2375 * etc/bench.pl.in: Adjust.
2376
8cdabf02
AD
23772008-11-07 Akim Demaille <demaille@gostai.com>
2378
2379 Avoid empty-if warnings.
2380 Reported by Quentin Hocquet.
de62edee 2381
8cdabf02
AD
2382 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
2383 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
2384
5a893c2b
AD
23852008-11-07 Akim Demaille <demaille@gostai.com>
2386
2387 Pass command line location to skeleton_arg and language_argmatch.
2388 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2389 The location argument is now mandatory.
2390 Adjust all dependencies.
2391 (getargs): Use command_line_location.
2392
58697c6d
AD
23932008-11-07 Akim Demaille <demaille@gostai.com>
2394
2395 -D, --define.
2396 * src/getargs.c (usage): Document -D.
2397 Fix help string for --locations.
2398 (command_line_location): New.
2399 (short_options, long_options, getargs): Support -D, --define.
2400 (getargs): Move -d support at the right place.
2401 * doc/bison.texinfo (Bison Options): Update.
2402 * tests/input.at (%define, --define): New.
2403
9fe5a457
AD
24042008-11-07 Akim Demaille <demaille@gostai.com>
2405
2406 Initialize the muscle table before parsing the command line.
2407 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2408 (getargs): Define file_name.
2409 * src/main.c (main): Initialize muscle_tab before calling
2410 getargs.
2411 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2412 its value is not available yet.
2413
56c5eca9
AD
24142008-11-07 Akim Demaille <demaille@gostai.com>
2415
2416 Locations without columns for command line arguments.
2417 * src/location.c (location_print): Don't display negative columns.
2418 * src/location.h: Document this.
2419
9b9e0a7d
AD
24202008-11-07 Akim Demaille <demaille@gostai.com>
2421
2422 Fix --help.
2423 * src/getargs.c (usage): Fix help string for -W.
2424
74eae918
AD
24252008-11-07 Akim Demaille <demaille@gostai.com>
2426
2427 Handle more general types of option arguments.
2428 * build-aux/cross-options.pl: The argument ends at the first
2429 space, not the first non-symbol character.
2430 Use @var for each word appearing the argument description.
2431
a3d4c6fb
AD
24322008-11-07 Akim Demaille <demaille@gostai.com>
2433
2434 Destroy the variants that remain on the stack in case of error.
2435 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
2436 destructor.
2437 Display the value only if yymsg is nonnull.
2438 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
2439
2d32fc9f
AD
24402008-11-07 Akim Demaille <demaille@gostai.com>
2441
2442 Add "%define assert" to variants.
2443 This is used to help the user catch cases where some value gets
2444 ovewritten by a new one. This should not happen, as this will
2445 probably leak.
de62edee 2446
2d32fc9f
AD
2447 Unfortunately this uncovered a bug in the C++ parser itself: the
2448 lookahead value was not destroyed between two calls to yylex. For
2449 instance if the previous lookahead was a std::string, and then an int,
2450 then the value of the std::string was correctly taken (i.e., the
2451 lookahead was now an empty string), but std::string structure itself
2452 was not reclaimed.
de62edee 2453
2d32fc9f
AD
2454 This is now done in variant::build(other&) (which is used to take the
2455 value of the lookahead): other is not only stolen from its value, it
2456 is also destroyed. This incurs a new performance penalty of a few
2457 percent, and union becomes faster again.
de62edee 2458
2d32fc9f
AD
2459 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2460 (b4_variant_if): New.
2461 (variant::built): New.
2462 Use it whereever the status of the variant changes.
2463 * etc/bench.pl.in: Check the penalty of %define assert.
2464
f6038cb8
AD
24652008-11-07 Akim Demaille <demaille@gostai.com>
2466
2467 Use "%define variant" in bench.pl.
2468 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2469 just use %define variants.
2470
ccde1f98
AD
24712008-11-07 Akim Demaille <demaille@gostai.com>
2472
2473 Regen.
2474 * src/parse-gram.h, src/parse-gram.c: Regen.
2475
58bd33b7
JD
24762008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2477
2478 Fix user actions without a trailing semicolon.
2479 Reported by Sergei Steshenko at
2480 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2481 * THANKS (Sergei Steshenko): Add.
2482 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2483 * tests/regression.at (Fix user actions without a trailing semicolon):
2484 New test case.
2485
639867b5
AD
24862008-11-04 Akim Demaille <demaille@gostai.com>
2487
2488 Use b4_copyright_years.
2489 * data/yacc.c (b4_copyright_years): New.
2490 Fix its value according to the comments in the file.
2491 Use it and undefine it.
2492
3c262606
AD
24932008-11-04 Akim Demaille <demaille@gostai.com>
2494
2495 Formatting changes.
2496 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2497
a2b93d52
AD
24982008-11-04 Akim Demaille <demaille@gostai.com>
2499
2500 Formatting changes.
2501 * data/lalr1-fusion.cc: here.
2502
3a2803df
AD
25032008-11-04 Akim Demaille <demaille@gostai.com>
2504
2505 Use strict on bench.pl.
2506 * etc/bench.pl.in (&run, &generate_grammar): New.
2507 Rename the grammar generating functions for consistency.
2508 Change the interface so that the list of benches to run is passed
2509 as (optionless) arguments.
2510 (&compile): Use &run.
2511
a0d4650a
AD
25122008-11-04 Akim Demaille <demaille@gostai.com>
2513
2514 Remove spurious initial empty lines.
2515 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2516 * data/yacc.c: End the @output lines with an @.
2517
cac9e09b
AD
25182008-11-04 Akim Demaille <demaille@gostai.com>
2519
2520 Improve the display of sizes.
2521 * etc/bench.p.in: Higher precision.
2522 Sort by decreasing size.
2523
4af4348a
AD
25242008-11-04 Akim Demaille <demaille@gostai.com>
2525
2526 Don't memcpy C++ structures.
2527 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2528 arguments.
2529 (variant::build): New overload for
2530 copy-construction-that-destroys.
2531 (variant::swap): New.
2532 (parser::yypush_): Use it in variant mode.
2533
ef05c4d6
AD
25342008-11-04 Akim Demaille <demaille@gostai.com>
2535
2536 Better defaults for bench.pl.
2537 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2538 default values.
2539 Adjust &verbose uses.
2540 (-q, --quiet): New.
2541
9718cfa9
AD
25422008-11-04 Akim Demaille <demaille@gostai.com>
2543
2544 Make variant.yy more complex.
2545 std::list cannot be copied via memcpy, they are more demanding than
2546 std::string. Use one std::list to strengthen the test.
de62edee 2547
9718cfa9
AD
2548 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2549 Adjust.
2550 Create a list of strings, instead of a single large string.
2551
a6df593d
AD
25522008-11-04 Akim Demaille <demaille@gostai.com>
2553
2554 bench.pl --bench.
2555 * etc/bench.pl.in (--bench, $bench): New.
2556
006a0303
AD
25572008-11-04 Akim Demaille <demaille@gostai.com>
2558
2559 Sort methods.
2560 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2561 Define it after as().
2562
faef3466
AD
25632008-11-04 Akim Demaille <demaille@gostai.com>
2564
2565 Useless parens.
2566 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2567
2141aded
AD
25682008-11-04 Akim Demaille <demaille@gostai.com>
2569
2570 Issue missing synclines after user actions.
2571 * data/c.m4 (b4_case): Issue synclines on the output file.
2572
e426d17b
AD
25732008-11-04 Akim Demaille <demaille@gostai.com>
2574
2575 Remove trailing empty line.
2576 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2577 epilogue.
2578
a9ce3f54
AD
25792008-11-04 Akim Demaille <demaille@gostai.com>
2580
2581 Fix output of copyright years.
2582 * data/bison.m4 (b4_copyright): Fix the indentation of the
2583 copyright year paragraph.
2584 Use b4_copyright_years when no years are given.
2585 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2586 (b4_copyright_years): New.
2587 Use it.
2588
59c544c2
AD
25892008-11-04 Akim Demaille <demaille@gostai.com>
2590
2591 Avoid the spurious initial empty line.
2592 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2593 the end of @output request to suppress the empty line that
2594 results.
2595
96b15448
AD
25962008-11-04 Akim Demaille <demaille@gostai.com>
2597
2598 Remove parser::rhs_number_type.
2599 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2600 (yyrhs_): Use b4_table_define.
2601
f0633174
AD
26022008-11-04 Akim Demaille <demaille@gostai.com>
2603
2604 Fix iteration type.
2605 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2606
417b8004
AD
26072008-11-04 Akim Demaille <demaille@gostai.com>
2608
2609 Factor the declaration of the integer tables.
2610 * data/lalr1-fusion.cc (b4_table_define): New.
2611 Use it.
2612
1a5246c6
AD
26132008-11-03 Akim Demaille <demaille@gostai.com>
2614
2615 Fix indentation of tables in lalr1.cc
2616 * data/lalr1-fusion.cc: Fix the indentation.
2617
f8a95c9c
AD
26182008-11-03 Akim Demaille <demaille@gostai.com>
2619
2620 Destroy the lhs symbols after reduction.
2621 * data/lalr1-fusion.cc (parse): After the user action, when in
2622 variant mode, destroy the lhs symbols.
2623
d7f4d823
AD
26242008-11-03 Akim Demaille <demaille@gostai.com>
2625
2626 Simplify yysyntax_error_ use.
2627 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2628 type, but make it unnamed in the declaration when it is not used.
2629
8b9c89fb
AD
26302008-11-03 Akim Demaille <demaille@gostai.com>
2631
2632 Let yy::variant::build return an lvalue.
2633 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2634 object.
2635
83243c24
AD
26362008-11-03 Akim Demaille <demaille@gostai.com>
2637
2638 Define yy::variant only when needed.
2639 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2640 used.
2641
429b4848
AD
26422008-11-03 Akim Demaille <demaille@gostai.com>
2643
2644 Bench the three-stack lalr1.cc.
2645 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2646 one-stack one.
2647
414c76a4
AD
26482008-11-03 Akim Demaille <demaille@gostai.com>
2649
2650 Fail on parse error in calc++.
2651 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2652 status.
2653 * examples/calc++/test ($me, $number, $exit, run): New.
2654 Use them to propagate errors to the exit status.
2655
8a5783fd
AD
26562008-11-03 Akim Demaille <demaille@gostai.com>
2657
2658 Don't specify the skeleton twice in the example.
2659 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2660 file does what is needed.
2661
0cc5bead
AD
26622008-11-03 Akim Demaille <demaille@gostai.com>
2663
2664 bench: Improve output.
2665 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2666
5b421a4e
AD
26672008-11-03 Akim Demaille <demaille@gostai.com>
2668
2669 bench: check impact of %debug on variants.
2670 * etc/bench.pl.in (variant_grammar): Fix the computation of
2671 $variant.
2672 Generate a grammar file that can work with or without %debug.
2673 Do use the @directive.
2674 (bench_variant_parser): Check impact of %debug.
2675 (@directives): Rename all the occurrences to...
2676 (@directive): this, for consistency.
2677
d11ee647
AD
26782008-11-03 Akim Demaille <demaille@gostai.com>
2679
2680 bench: report the size too.
2681 * etc/bench.pl.in ($iterations): Defaults to -3.
2682 (&bench_grammar): Require hireswallclock.
2683 Compute and display the size of the result.
2684 More comments.
2685
e1b74b92
AD
26862008-11-03 Akim Demaille <demaille@gostai.com>
2687
2688 bench: More use of the verbosity level.
2689 * etc/bench.pl.in ($verbose, &verbose): New.
2690 Use them.
2691 More POD documentation.
2692
7e5f9c54
AD
26932008-11-03 Akim Demaille <demaille@gostai.com>
2694
2695 bench.pl: a command line interface
2696 * etc/bench.pl.in: More doc.
2697 Some fixes in the documentation.
2698 ($cflags, $iterations, &help, &getopt): New.
2699 Use them.
2700 (&variant_grammar): Let the number of stages be 10 times what is
2701 specified.
2702
7109a18d
AD
27032008-11-03 Akim Demaille <demaille@gostai.com>
2704
2705 Bench the use of Boost.Variants.
2706 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2707 New.
2708 (&compile): Be ready to compile C++ parsers.
2709 (&bench_push_parser): Move debug information to the outermost
2710 level.
2711 * THANKS: Add Michiel De Wilde.
2712
922730fe
AD
27132008-11-03 Akim Demaille <demaille@gostai.com>
2714
2715 bench.pl: Pass directives as a list instead of as a string.
2716 * etc/bench.pl.in (&directives): New.
2717 (&triangular_grammar, &calc_grammar): Use it to format the Bison
2718 directives.
2719 (&triangular_grammar): Do use the directives (were ignored).
2720 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
2721 directives.
2722
7484f1d4
AD
27232008-11-03 Akim Demaille <demaille@gostai.com>
2724
2725 Improve genericity of bench.pl.
2726 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
2727 argument.
2728 (&bench_push_parser): New.
2729 Call it.
2730
15129f25
AD
27312008-11-03 Akim Demaille <demaille@gostai.com>
2732
2733 Add documentation to bench.pl.
2734 * etc/bench.pl.in: Comment changes.
2735
0e0ed236
AD
27362008-11-03 Akim Demaille <demaille@gostai.com>
2737
2738 Fuse the three stacks into a single one.
de62edee 2739
b06df3c2
AD
2740 In order to make it easy to perform benchmarks to ensure that
2741 there are no performance loss, lalr1.cc is forked into
2742 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
2743 lalr1.cc.
2744
2745 Meanwhile, to make sure that lalr1-fusion.cc is correctly
2746 exercized by the test suite, the user must install a symbolic link
2747 from lalr1.cc to it.
de62edee 2748
b06df3c2
AD
2749 Instead of having three stacks (state, value, location), use a
2750 stack of triples. This considerably simplifies the code (and it
2751 will be easier not to require locations as currently does the C++
2752 parser), and also gives a 10% speedup according to
2753 etc/bench (probably mainly since memory allocation is done once
2754 instead of three times).
de62edee 2755
0e0ed236
AD
2756 Another motivation is to make it easier to destruct properly
2757 semantic values: now that they are bound to their state (hence
2758 symbol type) it will be easier to call the appropriate destructor.
de62edee 2759
0e0ed236 2760 These changes should probably benefit the C parser too.
de62edee 2761
b06df3c2
AD
2762 * data/lalr1.cc: Copy as...
2763 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
2764 (b4_rhs_value, b4_rhs_location): New definitions overriding those
2765 from c++.m4.
2766 (state_stack_type, semantic_stack_type, location_stack_type)
2767 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
2768 (data_type, stack_type, yystack_): New.
2769 (YYLLOC_DEFAULT, yypush_): Adjust.
2770 (yyerror_range): Now based on data_type, not location_type.
2771
7dedf26e
AD
27722008-11-03 Akim Demaille <demaille@gostai.com>
2773
2774 Push the state, value, and location at the same time.
2775 This is needed to prepare a forthcoming patch that fuses the three
2776 stacks into one.
de62edee 2777
7dedf26e
AD
2778 * data/lalr1.cc (parser::yypush_): New.
2779 (parser::yynewstate): Change the semantics: instead of arriving to
2780 this label when value and location have been pushed, but yystate
2781 is to be pushed on the state stack, now the three of them must
2782 have been pushed before. yystate still must be the new state.
2783 This allows to use yypush_ everywhere instead of individual
2784 handling of the stacks.
2785
c4585f1e
AD
27862008-11-03 Akim Demaille <demaille@gostai.com>
2787
2788 Prefer references to pointers.
2789 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
2790 definition to use references instead of pointers.
2791 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
2792 Take the value and location as references.
2793 Adjust callers.
2794
56017c17
AD
27952008-11-03 Akim Demaille <demaille@gostai.com>
2796
2797 stack::size instead of stack::height.
2798 * data/lalr1.cc (stack::height): Rename as...
2799 (stack::size): this.
2800 Fix the output type.
2801 Comment changes.
2802
5ab8c47b
AD
28032008-11-03 Akim Demaille <demaille@gostai.com>
2804
2805 Use variants to support objects as semantic values.
b06df3c2
AD
2806 This patch was inspired by work by Michiel De Wilde. But he used
2807 Boost variants which (i) requires Boost on the user side, (ii) is
2808 slow, and (iii) has useless overhead (the parser knows the type of
2809 the semantic value there is no reason to duplicate this
2810 information as Boost.Variants do).
2811
2812 This implementation reserves a buffer large enough to store the
2813 largest objects. yy::variant implements this buffer. It was
2814 implemented with Quentin Hocquet.
de62edee 2815
5ab8c47b
AD
2816 * src/output.c (type_names_output): New.
2817 (output_skeleton): Invoke it.
2818 * data/c++.m4 (b4_variant_if): New.
2819 (b4_symbol_value): If needed, provide a definition for variants.
2820 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
2821 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
2822 (b4_char_sizeof, yy::variant): New.
2823 (parser::parse): If variants are requested, define
2824 parser::union_type, parser::variant, change the definition of
2825 semantic_type, construct $$ before running the user action instead
2826 of performing a default $$ = $1.
2827 * examples/variant.yy: New.
2828 Based on an example by Michiel De Wilde.
2829
1fa5d8bb
AD
28302008-11-03 Akim Demaille <demaille@gostai.com>
2831
2832 Parameterize the extraction of semantic values.
2833 To make future changes easier, no longer rely on ".TYPE" being the
2834 way to get a semantic value.
de62edee 2835
1fa5d8bb
AD
2836 * data/c.m4 (b4_symbol_value): New.
2837 Use it.
2838 * data/c++.m4, data/yacc.c: Use it.
2839 * data/glr.c: Use b4_symbol_value.
2840 (b4_rhs_data): New.
2841 Use it.
2842
91ba8a55
AD
28432008-11-03 Akim Demaille <demaille@gostai.com>
2844
2845 Prepare easier M4 changes.
2846 * data/lalr1.cc: Use escaped [] instead of literals to prepare
2847 future changes.
2848
c9ba9e59
JD
28492008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2850
2851 Initiate further development.
2852 * NEWS: Create an empty section for new entries.
2853 * gnulib: Update submodule to HEAD.
2854
bfb40910
JD
28552008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2856
2857 * NEWS: Version 2.4.
2858
241fda7a
JD
28592008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2860
2861 Prepare for next release.
2862 * NEWS: Briefly mention changes since 2.3b.
2863 * README: Say GNU m4 1.4.6, which we've been requiring in release
2864 announcements already, not 1.4.3, which breaks the build.
2865
ed4d67dc
JD
28662008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
2867
2868 Say %language is experimental.
2869 We're thinking of extending it's effect on output file naming. See the
2870 thread at
2871 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
2872 * NEWS: Say it's experimental.
2873 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
2874 recommend it over %skeleton for now.
2875 (Bison Options): Likewise.
2876 (C++ Bison Interface): Use %skeleton not %language.
2877 (Calc++ Parser): Use %skeleton not %language.
2878 * src/getargs.c (usage): Say it's experimental.
2879
e254a580
DJ
28802008-11-01 Di-an Jan <dianj@freeshell.org>
2881 Paolo Bonzini <bonzini@gnu.org>
2882
2883 Support all Java parser class modifiers.
2884 * data/java.m4 (b4_percent_define_get3): New.
2885 (b4_final_if, b4_strictfp_if): New.
2886 * data/lalr1.java (final, strictfp, extends, implements): Support.
2887 * doc/bison.texinfo (final, strictfp, extends, implements): Add
2888 documentation.
2889 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
2890 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
2891 (AT_CHECK_JAVA_GREP): New.
2892 (Java parser class modifiers): New test.
2893 (Java parser class extends and implements): New test.
2894
2895 Model exception propagation better with throws and lex_throws.
2896 * data/java.m4 (b4_list2): New.
2897 (throws): Change default.
2898 * data/lalr1.java (yyaction): Add throws.
2899 (parse): Add lex_throws in addition to throws.
2900 * doc/bison.texinfo (throws, lex_throws): Add documentation.
2901 * tests/java.at (Java throws specifications): New test.
2902
2903 Improve documentation for Java parsers.
2904 * doc/bison.texinfo (Java Parsers): Add subsections.
2905 Don't quote first argument of %define.
2906 (Java Bison Interface): Document output files. Move documentation
2907 of parser class and merge into Java Parser Interface. Document
2908 features that error out. Document directives with no effect.
2909 Move note about Javadoc higher.
2910 (Java Semantic Values): Explicitly mention stype.
2911 Document that generic types cannot be used.
2912 (Java Location Values): Use @deftypeivar. Document constructors.
2913 Correct return value for toString.
2914 (Java Parser Interface): List undocumented constants/fields.
2915 Move documentation of fields added by %parse-param closer to list
2916 of members. Document that token names are added as fields.
2917 Document constructors accurately. Remove error method.
2918 (Java Scanner Interface): Move note on %pure-parser to Java Bison
2919 Interface. Describe %code lexer and yylex accutately.
2920 Remove documentation that does not match the code.
2921 (Java Action Features): New.
2922 (Java Differences): Add reference. Add item on semantic values.
2923 Add note about @{ ... @}. Clarify %% epilogue placement.
2924 (Java Declarations Summary): New.
2925
2926 Fix Java skeleton.
2927 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
2928 (b4_remove_comma): Quote test argument.
2929 (b4_identification): Remove "bison" field.
2930 * tests/java.at (Java parser class and package names): New test.
2931 (Java %parse-param and %lex-param): New test.
2932 (Java stype, position_class and location_class): New test.
2933
f259e4e6
PB
29342008-10-31 Di-an Jan <dianj@freeshell.org>
2935
2936 * data/lalr1.jave: Update copyright years.
2937 (YYParser): Correct name of "generated from" file in Javadoc:
2938 use b4_file_name instead of @ofile@.
2939 (Location constructor): Correct Javadoc parameter name.
2940 (yylloc): Add missing opening m4 quote after b4_location_if.
2941 This removes a stray [ in the Javadoc of Lexer.getStartPos.
2942 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
2943 (YYParser constructor): Correct Javadoc parameter name.
2944
cae5057f
JD
29452008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
2946
2947 Always put auxiliary code files in the same dir as other output files.
2948 * src/files.c (compute_file_name_parts): When the user specifies
2949 --output but not --file-prefix, extract the directory prefix from the
2950 file prefix not from the grammar file name. This affects the location
2951 of files like location.hh generated by the C++ skeleton. The includes
2952 in the other output files require this fix.
2953 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
2954 for expected output files.
2955 (Output files): Add a test for the above.
2956
4af432ba
JD
29572008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
2958
2959 * gnulib: Update submodule to HEAD.
2960
e26d4e43
JD
29612008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2962
2963 Update copyright year.
2964 * src/files.c: Here.
2965
c0ee9e21
DJ
29662008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
2967
2968 Don't overwrite the input file.
2969 * src/files.c (output_file_name_check): Fatal error if using input file
2970 for output.
2971 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
2972 argument.
2973 (Conflicting output files): Add test.
2974
482dc52f
AD
29752008-10-28 Akim Demaille <demaille@gostai.com>
2976
2977 Space changes.
2978 * data/lalr1.cc: Formatting changes.
2979
52cbbe84
AD
29802008-10-28 Akim Demaille <demaille@gostai.com>
2981
2982 Don't define debugging functions when !YYDEBUG.
2983 * data/lalr1.cc (debug_stream, set_debug_stream)
2984 (debug_level_type, debug_level, set_debug_level): Don't
2985 declare them when YYDEBUG is not defined.
2986 The implementation are already YYDEBUG-aware.
2987
0925d5bf
AD
29882008-10-28 Akim Demaille <demaille@gostai.com>
2989
2990 Prefer "continue" for empty loop bodies.
2991 * etc/bench.pl.in: Use "continue" instead of {}.
2992
cf98343c
AD
29932008-10-28 Akim Demaille <demaille@gostai.com>
2994
2995 Space and comments changes.
2996 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
2997 * data/c.m4, data/lalr1.cc: Space changes.
2998
9f467b7d
AD
29992008-10-28 Akim Demaille <demaille@gostai.com>
3000
3001 Make gnulib a submodule.
3002 * gnulib: New.
3003 * .gitmodules (gnulib): New.
3004
0f0e1ace
JD
30052008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3006
3007 Fix yyerror_range for user-defined location type in C++. Reported by
3008 Georg Sauthoff at
3009 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3010 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3011 * THANKS (Georg Sauthoff): Add.
3012
548e2104
JD
30132008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3014
3015 Update several administrative files mainly to facilitate releasing.
3016 * HACKING (Administrivia): Make the git-merge-changelog notes more
3017 helpful.
3018 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3019 (Release Procedure): Update for git and add numerous details that were
3020 previously missing.
3021 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3022 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3023 that announcements don't claim we bootstrapped with whatever bison
3024 happened to be in PATH. Add flex as a bootstrap tool.
3025 * Makefile.maint: Remove, previously replaced by maint.mk.
3026 * Makefile.cfg: Remove, and migrate settings to...
3027 * cfg.mk: ... here for the sake of `make announcement'.
3028 * bootstrap.conf (gnulib_modules): Add announce-gen.
3029 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3030 Berry.
3031
ddf17a6e
PB
30322008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3033
3034 Small but important bugfixes for the Java skeleton.
3035 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3036 (yy_symbol_print): Call toString on yyvaluep.
3037
e1145ad8
AD
30382008-08-29 Akim Demaille <demaille@gostai.com>
3039
3040 Clarify UPDATED use.
215b40ac 3041 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 3042 not to the release date of Bison.
215b40ac 3043 Reported by Joel E. Denny.
e1145ad8 3044
0df72d78
AD
30452008-08-29 Akim Demaille <demaille@gostai.com>
3046
3047 * README: Update FAQ pointer.
3048 Reported by Joel E. Denny.
3049
9a90b6bb
EB
30502008-08-27 Eric Blake <ebb9@byu.net>
3051
3052 Resync m4sugar from autoconf.
3053 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3054 (m4_init): Adjust to latest m4.git changes.
3055 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3056 effects.
3057 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3058 (_m4_list_cmp): Reduce side effects.
3059
65015668
AD
30602008-08-27 Akim Demaille <demaille@gostai.com>
3061
3062 Check yyerrok in calc.at.
215b40ac
EB
3063 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3064 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3065 expected.
65015668 3066
98e26a92
AD
30672008-08-27 Akim Demaille <demaille@gostai.com>
3068
3069 Support yyerrok in lalr1.cc.
3070 YYBACKUP is still to import back into lalr1.cc.
215b40ac 3071 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 3072
86c0e784
JD
30732008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3074
3075 For maintainer-check*, don't recompile for a $(VERSION) update.
3076 * cfg.mk: New file.
3077 (_is-dist-target): Override the one in GNUmakefile.
3078 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3079
88511166
JD
30802008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3081
3082 Update for recent change to gnulib.
3083 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3084 string.h now.
3085
6bbb2ed5
EB
30862008-08-15 Eric Blake <ebb9@byu.net>
3087
d67c52e8
EB
3088 Remaining m4sugar merge from autoconf.
3089 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3090 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3091 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3092 * src/output.c (output_skeleton): Tell m4 how to find it.
3093
6bbb2ed5
EB
3094 Partial m4sugar merge from autoconf: m4_map.
3095 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3096 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3097 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3098 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3099 for empty list.
3100 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3101 Likewise.
3102 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3103 declares it.
3104
8dce3875
JD
31052008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3106
3107 Keep .version and PACKAGE_VERSION in sync.
3108 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3109 dependency, and add comments justifying this in more detail. Discussed
3110 starting at
3111 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3112
882a1fbf
EB
31132008-08-06 Eric Blake <ebb9@byu.net>
3114
a3764451
EB
3115 Partial m4sugar merge from autoconf: m4_shiftn.
3116 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3117 (m4_shift2, m4_shift3): New macros.
3118 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3119 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3120 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3121 * data/java.m4 (b4_remove_comma): Likewise.
3122
882a1fbf
EB
3123 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3124 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3125 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3126 (m4_init): Consolidate wrapped text into single m4_wrap.
3127 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3128 in wrapped text.
3129
a30e920d
EB
31302008-08-05 Eric Blake <ebb9@byu.net>
3131
dfcc5959
EB
3132 Partial m4sugar merge from autoconf: builtins, version.m4.
3133 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3134 (m4_prepend): Remove, as it is unused and inherently quadratic,
3135 whereas m4_append is linear in newer m4.
3136 (m4_mkstemp): New builtin.
3137 (m4_symbols): Make rename conditional.
3138 (m4_version_prereq): Ensure fatal error if used in bison, which
3139 intentionally lacks version.m4.
3140
a30e920d
EB
3141 Fix comments in m4sugar.
3142 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3143
445b7470
JD
31442008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3145
3146 Update for recent .gitignore fix in Gnulib.
3147 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3148 anchored .gitignore entries.
3149
a1e50014
JD
31502008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3151
3152 Set gnu or gnits strictness.
3153 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3154 development and gnits strictness for releases. Based on Eric Blake's
3155 suggestion at
3156 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3157
d43f77e7
PB
31582008-07-31 Paolo Bonzini <bonzini@gnu.org>
3159
3160 * NEWS: Clarify documentation of %language.
3161
fee2ed87
PB
31622008-07-31 Paolo Bonzini <bonzini@gnu.org>
3163
3164 Support usage of git-merge-changelog.
3165 * .gitattributes: New.
3166 * HACKING: Document usage of git-merge-changelog.
3167 * bootstrap: Install git-merge-changelog entries in .git/config
3168 if appropriate.
3169
78029cd5
JD
31702008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3171
3172 Remove remaining dependence on CVS Id keyword.
3173 * ChangeLog: For the sake of people still using CVS, don't use dollars
3174 when mentioning Id.
3175 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3176 unusual anyway.
3177 * data/xslt/xml2dot.xsl: Likewise.
3178 * data/xslt/xml2text.xsl: Likewise.
3179 * data/xslt/xml2xhtml.xsl: Likewise.
3180 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3181 * doc/Makefile.am (neutralize): Remove, no longer needed.
3182 (.x.1): Don't use neutralize.
3183 (edit): Don't substitute for ID.
3184 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3185
c53d18b1
JD
31862008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3187
3188 Fix dependence on computed configure variables.
3189 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3190 $(top_srcdir)/configure.ac so that changes to computed variables, such
3191 as PACKAGE_VERSION, are seen.
3192 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3193
5523ac79
JD
31942008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3195
3196 Update copyright dates for recent changes.
3197 * Makefile.am: Here.
3198 * src/Makefile.am: Here.
3199 * src/reduce.c: Here.
3200 * tests/reduce.at: Here.
3201
8fa36911
JD
32022008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3203
3204 Use git-version-gen for version names between releases.
3205 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3206 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3207 * .prev-version: New.
3208 * .version.in: Remove.
78029cd5 3209 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3210 revision.
3211 * GNUmakefile: Remove, now copied from Gnulib.
3212 * Makefile.am: Add code suggested by comments in
3213 build-aux/git-version-gen.
3214 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3215 .prev-version, and .version.
3216 * NEWS (2.3b+): Rename to...
3217 (?.?): ... this because we're dropping the "+" version naming scheme,
3218 but, in general, we still can't be sure of our next release name.
3219 * bootstrap: Add a quick hack to remove from .gitignore the
3220 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3221 entry. This should really be fixed in gnulib instead.
3222 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3223 * configure.ac (AC_INIT): Set version name by invoking
3224 build-aux/git-version-gen.
3225 (AC_CONFIG_FILES): Remove .version, now generated by
3226 build-aux/git-version-gen.
3227 * maint.mk: New, copied from coreutils.
3228 * doc/.cvsignore (bison.1): Add.
3229 * doc/.gitignore (/bison.1): Add.
3230 * doc/bison.1: Remove, generated.
3231 * src/.cvsignore (revision.c): Remove.
3232 * src/.gitignore (/revision.c): Remove.
3233 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3234 (BUILT_SOURCES): Remove revision.c.
3235 (revision.c): Remove.
3236 * src/getargs.c (version): Don't print revision after the VERSION.
3237 * src/revision.h: Remove.
3238
bcf07cb7
JD
32392008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3240
3241 Fix untranslatable composition of sentences. Reported by Goran
3242 Uddeborg at
3243 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3244 * THANKS (Goran Uddeborg): Add.
3245 * src/reduce.c (reduce_print): Report the number of nonterminals and
3246 rules useless in the grammar in separate sentences.
3247 * tests/reduce.at (Useless Rules): Update output.
3248 (Reduced Automaton): Likewise.
3249 (Underivable Rules): Likewise.
3250 (Empty Language): Likewise.
3251
9aacab9a
JD
32522008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3253
3254 Fix some .gitignore and .cvsignore problems.
3255 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3256 (insert_vc_ignore): ... this new function, which prepends `/' to all
3257 .gitignore entries before passing them to insert_sorted_if_absent.
3258 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3259 .cvsignore files are maintained even though Bison developers run
3260 bootstrap while using Git.
3261 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3262 unneeded by Bison.
3263 (gnulib): Add.
3264 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3265 unneeded. Reported by Eric Blake.
3266 * lib/.gitignore (/*~): Add.
3267 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3268 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3269 Blake.
3270 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3271
a9fc7990
JD
32722008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3273
3274 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3275 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3276 * bootstrap.conf (gnulib_modules): Add unsetenv.
3277 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3278 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3279 (/setenv.m4): Add.
3280 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3281 the first argument because it may become position-dependent, and unset
3282 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3283 Add comments explaining these issues in more detail.
3284
0f1d6f10
JD
32852008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3286
3287 Add .gitignore everywhere based on .cvsignore.
3288 * .gitignore: New.
3289 * build-aux/.gitignore: New.
3290 * data/.gitignore: New.
3291 * doc/.gitignore: New.
3292 * etc/.gitignore: New.
3293 * examples/.gitignore: New.
3294 * examples/calc++/.gitignore: New.
3295 * lib/.gitignore: New.
3296 * m4/.gitignore: New.
3297 * po/.gitignore: New.
3298 * runtime-po/.gitignore: New.
3299 * src/.gitignore: New.
3300 * tests/.gitignore: New.
3301
7bd1665a
JD
33022008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3303
3304 * NEWS (2.3b+): New section, empty for now.
3305 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3306
72c5b982
JD
33072008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3308
3309 * NEWS (2.3b): Update release date since there has been a delay in
3310 getting the announcements and tarballs out.
3311
bd02cd5d
JD
33122008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3313
3314 * NEWS: Version 2.3b.
3315 * configure.ac (AC_INIT): Likewise.
3316 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3317
9126263e
JD
33182008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3319
3320 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3321 been doing it for years.
3322 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3323 (Release Procedure): Add FIXME about make alpha being unmaintained.
3324
fa6aa7b3
JD
33252008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3326
3327 * data/yacc.c: Reformat m4 a little for readability.
3328 * src/lalr.c (build_relations): Correct comment.
3329
d30b312d
JMG
33302008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3331
3332 DJGPP specific issue.
3333 * djgpp/config.sed: Fixes required to run configure scripts generated
3334 by autoconf 2.62.
3335
138d4cd9
JD
33362008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3337
3338 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3339 coordinator@translationproject.org.
3340
8f7e2e1f
JD
33412008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3342
3343 * THANKS: Add Eric Blake.
3344
f55efa38
JD
33452008-04-23 Eric Blake <ebb9@byu.net>
3346
3347 Revert prior patch, by working around autoconf regression.
3348 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3349 ("Output file name: ("): Uncomment test.
3350 ("Output file name: )"): Likewise.
3351 Based on an idea from Noah Misch.
3352
096c9f9d
JD
33532008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3354
3355 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3356 2.61. Reported by Juan Manuel Guerrero at
3357 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3358 * tests/output.at ("Output file name: ("): Comment out test case for
3359 now.
3360 ("Output file name: )"): Likewise.
3361
0f664b89
JD
33622008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3363
3364 * GNUmakefile: Update git-version-gen invocation so make dist
3365 succeeds.
3366
1cfe6375
JD
33672008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3368
3369 Update to the current gnulib CVS repository, and fix trigraph handling
3370 in Bison.
3371 * bootstrap: Update gnulib CVS repository URL.
3372 (symlink_to_dir): Encapsulate the code that guarantees the destination
3373 directory exists into...
3374 (check_dst_dir): ... this new function, and...
3375 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3376 fail when copying files into lib/uniwidth/.
3377 * src/output.c (prepare_symbols): When writing yytname muscles, where
3378 symbol names will be encoded in C-string literals, tell quotearg to
3379 escape trigraphs. This used to be the default in gnulib.
3380 * tests/regression.at (Token definitions): Because of the change in
3381 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3382 escapes trigraphs in symbol names. Thus, yytname no longer has
3383 trigraphs unnecessarily doubly escaped. Update test case output.
3384 Extend test case to be sure Bison's own error messages will no longer
3385 have trigraphs in symbol names unnecessarily escaped once.
3386
74c52fc8
JD
33872008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3388
3389 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3390 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3391 * .cvsignore: Add .version.
3392 * .version.in: New.
3393 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3394 * configure.ac (AC_CONFIG_FILES): Add .version.
3395 * build-aux/.cvsignore: Add git-version-gen.
3396
8e55b3aa
JD
33972008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3398
3399 * NEWS (2.3a+): Mention that -g now takes an argument.
3400 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3401 consistency. Update the -g and -x entries now that they take
3402 arguments. Use brackets to indicate optional arguments.
3403 * src/getargs.c (usage): Explain the relationship between arguments of
3404 long and short options more completely. Document --defines and -d
3405 separately since the former takes an argument but, for POSIX Yacc, the
3406 latter does not.
3407 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 3408 (getargs): Sort cases.
8e55b3aa 3409
59c5ac72
AD
34102008-02-28 Akim Demaille <demaille@gostai.com>
3411
3412 * doc/bison.texinfo: Fix a few typos.
3413
118d4978
AD
34142008-02-28 Akim Demaille <akim@epita.fr>
3415
3416 * doc/bison.texinfo (Bison Options): Document -W.
3417 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3418
7020f1e9
AD
34192008-02-28 Akim Demaille <akim@epita.fr>
3420
3421 * src/getargs.c (short_options): Split and sort for readability.
3422 -g and -x take optional arguments, just like their long options.
3423 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3424 understand.
3425 Fix the handling of $opt which resulted in all the argument to be
3426 considered as optional.
3427
59da312b
JD
34282008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3429
3430 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3431 say its interface is experimental.
3432 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3433 Java.
3434 (Bison Options): In the -L and --language entry, mention Java.
3435 (Java Bison Interface): Say the interface is experimental.
3436 * src/getargs.c (usage): Mention -L and --language.
3437
3438 * NEWS (2.3a+): Say the push parsing interface is experimental.
3439 * doc/bison.texinfo (Push Decl): Likewise.
3440 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3441 (Push Parser Function): Likewise.
3442 (Pull Parser Function): Likewise.
3443 (Parser Create Function): Likewise.
3444 (Parser Delete Function): Likewise.
3445 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3446 yypull_parse, and yypush_parse entries.
3447
3448 * NEWS (2.3a+): Mention XML support, and say the schema is
3449 experimental.
3450 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3451 * src/getargs.c (usage): Say the XML schema is experimental.
3452
3453 * NEWS (2.3a+): Say option instead of flag.
3454
2bb3ebec
WP
34552008-02-21 Wojciech Polak <polak@gnu.org>
3456
3457 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3458 text.
3459
333e670c
JD
34602008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3461
3462 Fix impure push parser compile error reported by Bob Rossi at
3463 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3464 * data/yacc.c: Clean up whitespace in the output a little.
3465 (yypstate_allocated): Define for impure push parsers regardless of
3466 whether the pull interface is also requested.
3467 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3468 check impure push parsers without the pull interface.
3469
3470 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3471 yyerror takes arguments specified by %parse-param while yypstate_new
3472 does not.
3473 * doc/bison.texinfo (Parser Create Function): Document that
3474 yypstate_new returns 0 for multiple impure parser instances.
3475 * tests/push.at (Push Parsing: Multiple impure instances): Update
3476 expected stderr output.
3477
798096e1
JD
34782008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3479
3480 * runtime-po/POTFILES.in (push.c): Remove.
3481
9ca7f077
JD
34822008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3483
3484 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3485 * data/push.c: Rename to...
3486 * data/yacc.c: ... this, overwriting it.
3487 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3488 `%push-pull-parser' -> `%define api.push_pull "both"'.
3489 Remove old yacc.c tests, and update push.c tests to yacc.c.
3490
42ee26bb
JD
34912008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3492
3493 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3494 `"%code top" blocks' instead of `%code "top" blocks'.
3495 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3496 Clean up whitespace in the output a little.
3497
b1cc23c4
JD
34982008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3499
3500 Fix documentation problems reported by Tim Josling at
3501 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3502 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3503 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3504 integers. Explain the effect of literal string aliases on error
3505 messages. Copy token 0 documentation from the C++ skeleton
3506 documentation.
3507
ab7f29f8
JD
35082008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3509
3510 Accept a token number in a %left, %right, or %nonassoc for POSIX
3511 conformance. Reported by Tim Josling at
3512 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3513 * NEWS (2.3a+): Mention.
3514 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3515 and code numbers are treated by precedence declarations.
3516 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3517 of symbols.1.
3518 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3519 of symbol.
3520 (symbol.prec): New, just like symbol but allows INT.
3521 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3522 longer holds.
3523 * tests/regression.at (Token number in precedence declaration): New
3524 test case.
3525
a924ef36
JMG
35262008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3527
3528 DJGPP specific issues.
3529 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3530 be changed. Copyright timestamp adjusted.
3531 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3532 be changed. Copyright timestamp adjusted.
3533 * djgpp/config.site: Copyright timestamp adjusted.
3534 * djgpp/config_h.sed: Copyright timestamp adjusted.
3535 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3536 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3537 filename translation list.
3538 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3539 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3540 files shall be created. Before trying to use the temp dir where the
3541 environment variable points to check that the dir really exists. If
3542 not default to the cwd as temp dir. Copyright timestamp adjusted.
3543 * djgpp/subpipe.h: Copyright timestamp adjusted.
3544 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3545
389c8cfd
PE
35462008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3547
3548 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3549
5d1cfef4
PE
35502008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3551
3552 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3553 Problem reported by Claudio Saavedra in
3554 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3555
e2dcf996
WP
35562008-01-05 Wojciech Polak <polak@gnu.org>
3557
3558 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3559 document's title with the input grammar file name.
3560
da730230
JD
35612007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3562
3563 Automate regression testing of the XML/XSLT implementation. Discussed
3564 starting at
3565 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3566 * configure.ac (XSLTPROC): New substitution.
3567 * Makefile.am (maintainer-xml-check): New phony target invoking...
3568 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3569 invoking make maintainer-check with BISON_TEST_XML=1.
3570 * tests/atlocal.in (XSLTPROC): New.
3571 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3572 not to report reachable memory when Bison is expected to have a
3573 non-zero exit status and (2) to compare XML/XSLT output with --graph
3574 and --report=all output for every working grammar when
3575 BISON_TEST_XML=1.
3576 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3577 (AT_BISON_CHECK_XML): New.
3578 (AT_QUELL_VALGRIND): New.
3579 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3580 (AT_CHECK): ... don't redefine this since this was the old way to
3581 quell Valgrind.
3582 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3583 AT_BISON_CHECK invocations.
3584 * tests/c++.at: Likewise.
3585 * tests/calc.at: Likewise.
3586 * tests/conflicts.at: Likewise.
3587 * tests/cxx-type.at: Likewise.
3588 * tests/existing.at: Likewise.
3589 * tests/glr-regression.at: Likewise.
3590 * tests/headers.at: Likewise.
3591 * tests/input.at: Likewise.
3592 * tests/java.at: Likewise.
3593 * tests/output.at: Likewise.
3594 * tests/push.at: Likewise.
3595 * tests/reduce.at: Likewise.
3596 * tests/regression.at: Likewise.
3597 * tests/sets.at: Likewise.
3598 * tests/skeletons.at: Likewise.
3599 * tests/synclines.at: Likewise.
3600 * tests/torture.at: Likewise.
3601 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3602 tends to hang xsltproc.
3603 (Big horizontal): Likewise.
3604
408476bc
JD
36052007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3606
3607 In XML output, remove redundant class attribute on symbol element.
3608 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3609 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3610 look up a symbol to determine whether it's a nonterminal or terminal.
3611 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3612 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3613
3614 Add prec/assoc information to XML output.
3615 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3616 %prec, add a percent_prec attribute.
3617 * src/print-xml.c (print_grammar): For each terminal that has a
3618 precedence or associativity, add a prec or assoc attribute.
3619 (xml_indent): New.
3620 (xml_puts): Use xml_indent.
3621 (xml_printf): Use xml_indent.
3622 * src/print-xml.h (xml_indent): Prototype.
3623
3624 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3625 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3626
d4a26c48
JD
36272007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3628
3629 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3630 (bison:ruleByNumber): ... this for clarity.
3631 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3632 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3633 (xsl:template match="reduction"): Update.
3634 (xsl:template match="item"): Update.
3635 (xsl:template match="reduction"): Update.
3636
3637 In the XML output, don't print the list of rules where symbols appear.
3638 Compute it in XSLT instead. Discussed at
3639 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3640 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3641 (bison:ruleByRhs): New.
3642 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3643 bison:ruleByRhs.
3644 (xsl:template match="terminal/rule"): Remove.
3645 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3646 bison:ruleByRhs.
3647 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3648 Remove.
3649 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3650 bison:ruleByRhs and mode="number-link" for rule template.
3651 (xsl:template match="terminal/rule"): Remove.
3652 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3653 bison:ruleByRhs and mode="number-link" for rule template.
3654 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3655 Rewrite as...
3656 (xsl:template match="rule" mode="number-link"): ... this.
3657 * src/print-xml.c (print_grammar): Don't print the list of rules.
3658
ef1b4273
JD
36592007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3660
3661 Don't let --report affect XML output; always print all information.
3662 Discussed at
3663 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3664 * src/conflicts.c (log_resolution): Implement.
3665 * src/print-xml.c (print_core): Implement.
3666 (print_state): Implement.
3667 (print_xml): Implement.
3668
3669 * NEWS (2.3a+): Fix quotes.
3670 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3671 don't let %verbose clear the list specified by --report.
3672
0f6cd9e3
AD
36732007-11-26 Akim Demaille <akim@epita.fr>
3674
3675 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3676
d80fb37a
JD
36772007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3678
3679 In the XML output, list useless and unused symbols and rules with the
3680 useful ones and add a "usefulness" attribute. Discussed starting at
3681 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3682 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3683 (grammar_rules_print_xml): Print all rules instead of just those
3684 useful in the grammar, and add a "usefulness" attribute.
3685 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3686 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3687 (print_grammar): Print all nonterminals instead of just useful ones,
3688 and add a "usefulness" attribute to nonterminals and terminals.
3689 (print_xml): Don't print a separate "reductions" or
3690 "rules-useless-in-parser" element.
3691 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3692 (reduce_xml): Remove.
3693 (reduce_token_unused_in_grammar): New.
3694 (reduce_nonterminal_useless_in_grammar): New.
3695 * src/reduce.h (reduce_xml): Remove prototype.
3696 (reduce_token_unused_in_grammar): Add prototype.
3697 (reduce_nonterminal_useless_in_grammar): Add prototype.
3698 * data/xslt/xml2text.xsl: Update for XML changes.
3699 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3700 * tests/reduce.at (Useless Terminals): Update output.
3701 (Useless Rules): Update output.
3702 (Reduced Automaton): Update output.
3703
3704 Say "Terminals unused in grammar" instead of "Unused terminals".
3705 * NEWS (2.3a+): Update.
3706 * doc/bison.texinfo (Understanding): Update example output.
3707 * src/reduce.c (reduce_output): Implement.
3708 * data/xslt/xml2text.xsl: Implement.
3709 * data/xslt/xml2xhtml.xsl: Implement.
3710
1bb2bd75
JD
37112007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3712
3713 Accept --report-file=FILE to override the default `.output' filename.
3714 * NEWS (2.3a+): Mention.
3715 * doc/bison.texinfo (Bison Options): Add an entry.
3716 * src/files.c (compute_output_file_names): Don't override
3717 spec_verbose_file if already set.
3718 * src/getargs.c (usage): Document --report-file.
3719 (REPORT_FILE_OPTION): New anonymous enum member.
3720 (long_options): Add entry for it.
3721 (getargs): Add case for it setting spec_verbose_file.
3722
3723 * build-aux/cross-options.pl: Don't record a short option just because
3724 there's an arg.
3725 * doc/.cvsignore: Add yacc.1.
3726
a005a9c4
AD
37272007-11-14 Akim Demaille <akim@epita.fr>
3728
3729 * doc/yacc.1.in: New.
3730 * configure.ac, doc/Makefile.am: Adjust.
3731 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
3732 config.h symbol.
3733 Use AC_SUBST for assignments too.
3734 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
3735
cff03fb2
JD
37362007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3737
3738 * src/gram.c: Remove comments that duplicate comments in gram.h.
3739
3740 When reporting useless rules and nonterminals, say "useless in grammar"
3741 instead of "useless", and say "useless in parser" instead of "never
3742 reduced". Discussed starting at
3743 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
3744 * NEWS (2.3a+): Mention this change.
3745 * data/xslt/xml2text.xsl: Update output text and expected input XML
3746 element names to match changes below.
3747 * data/xslt/xml2xhtml.xsl: Likewise.
3748 (xsl:template match="bison-xml-report"): Add missing entry in Table of
3749 Contents: "Rules useless in parser due to conflicts".
3750 * doc/bison.texinfo (Decl Summary): Reword a little.
3751 (Understanding): Update example output for changes below.
3752 * src/gram.c: (rule_useful_p): Rename to...
3753 (rule_useful_in_grammar_p): ... this.
3754 (rule_useless_p): Rename to...
3755 (rule_useless_in_grammar_p): ... this.
3756 (rule_never_reduced_p): Rename to...
3757 (rule_useless_in_parser_p): ... this.
3758 (grammar_rules_print): Update for renames.
3759 (grammar_rules_print_xml): Update for renames.
3760 (grammar_rules_never_reduced_report): Rename to...
3761 (grammar_rules_useless_report): ... this since it is used for either
3762 kind of useless rule.
3763 * src/gram.h: Reword comments and update function names in prototypes.
3764 * src/main.c (main): Say "rule useless in parser due to conflicts".
3765 * src/print-xml.c (print_rules_never_reduced): Rename to...
3766 (print_rules_useless_in_parser): ... this, and rename output XML
3767 element "rules-never-reduced" to "rules-useless-in-parser".
3768 (print_xml): Update for rename.
3769 * src/print.c (print_results): Say "Rules useless in parser due to
3770 conflicts".
3771 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
3772 (nonterminals_reduce): Say "nonterminal useless in grammar".
3773 (reduce_output): Say "Nonterminals useless in grammar".
3774 Say "Rules useless in grammar".
3775 (reduce_xml): Rename output XML element "useless" to
3776 "useless-in-grammar".
3777 (reduce_print): Don't report the count of grammatically useless rules
3778 as "rules never reduced" just because %yacc is specified.
3779 In the correct report of this count, say nonterminal(s) and rule(s)
3780 "useless in grammar".
3781 * tests/conflicts.at (S/R in initial): Update expected output.
3782 (Defaulted Conflicted Reduction): Likewise.
3783 (Unreachable States After Conflict Resolution): Likewise.
3784 * tests/existing.at (GNU pic Grammar): Likewise.
3785 * tests/reduce.at (Useless Nonterminals): Likewise.
3786 (Useless Rules): Likewise.
3787 (Reduced Automaton): Likewise.
3788 (Underivable Rules): Likewise.
3789 (Empty Language): Likewise.
3790
66f0441d
JD
37912007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3792
3793 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
3794 here document and before the EOF so that BSD's implementation of Bourne
3795 shell doesn't parse the delimiter as part of the here document.
3796 * doc/.cvsignore: Add cross-options.texi.
3797 * src/getargs.c (usage): Add a blank line after the warning categories.
3798
d0ee4105
PB
37992007-11-08 Paolo Bonzini <bonzini@gnu.org>
3800
3801 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
3802
e8b1fb9b
AD
38032007-11-05 Akim Demaille <akim@epita.fr>
3804
3805 Remove Id: from bison.1.
3806 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
3807 (perl -0777 -pi -e 's/\.PP\nId): New.
3808 (.x.1): Use it to ignore the version control revision.
3809
2f7a96b5
AD
38102007-11-05 Akim Demaille <demaille@gostai.com>
3811
3812 * build-aux/Makefile.am: Ship cross-options.pl.
3813 * doc/Makefile.am: Always refer to cross-options.texi with
3814 $(srcdir).
3815 (MAINTAINERCLEANFILES): Add it.
3816
f4101aa6
AD
38172007-11-04 Akim Demaille <demaille@gostai.com>
3818
3819 Generate the long/short option cross-table.
3820 * build-aux/cross-options.pl: New.
3821 * doc/Makefile.am (cross-options.texi): New.
3822 * doc/bison.texinfo: Use it.
3823
727a1401
AD
38242007-11-04 Akim Demaille <demaille@gostai.com>
3825
3826 Generate bison.1 using help2man.
3827 * doc/common.x, doc/bison.x: New.
3828 * doc/Makefile.am (bison.1, .x.1): New.
3829 The code is taken from autoconf-2.61/man/Makefile.am.
3830 * configure.ac: Look for help2man.
3831
6aeb9c57
AD
38322007-11-04 Akim Demaille <demaille@gostai.com>
3833
3834 Complete --help.
3835 * src/getargs.c (usage): Document -W, make it clear that -d,
3836 -g and -x have optional arguments.
3837
d7be4085
AD
38382007-11-04 Akim Demaille <demaille@gostai.com>
3839
3840 Find sha1sum when named gsha1sum.
3841 * bootstrap (find_tool): New.
3842 ($SHA1SUM): New.
3843
d9df47b6
JD
38442007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3845
3846 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
3847 at
3848 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
3849 * NEWS (2.3a+): Mention.
3850 * data/bison.m4 (b4_pure_if): Don't define it here.
3851 * data/c.m4 (b4_identification): Depend on individual skeletons to
3852 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
3853 values of the %define variables api.pure or api.push_pull. Define
3854 YYPURE, YYPUSH, and YYPULL accordingly.
3855 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
3856 glr.cc has already defined b4_pure_flag.
3857 * data/push.c: Define b4_pure_if based on `%define api.pure'.
3858 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 3859 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
3860 * doc/bison.texinfo (Pure Decl): Update.
3861 (Push Decl): Update.
3862 (Decl Summary): Add api.pure to %define entry.
3863 In %pure-parser entry, say it's deprecated and reference %define.
3864 (Pure Calling): Update.
3865 (Error Reporting): Update.
3866 (C++ Scanner Interface): Update.
3867 (How Can I Reset the Parser): Update.
3868 (Table of Symbols): In %pure-parser entry, say it's deprecated and
3869 reference %define.
3870 * src/getargs.c (pure_parser): Remove global variable.
3871 * src/getargs.h (pure_parser): Remove extern.
3872 * src/output.c (prepare): Don't define pure_flag muscle.
3873 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
3874 wrapper around `%define api.pure'.
3875 * tests/calc.at (Simple LALR Calculator): Update.
3876 (Simple GLR Calculator): Update.
3877 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
3878 Update.
3879 (GLR: Resolve ambiguity, pure, locations): Update.
3880 (GLR: Merge conflicting parses, pure, no locations): Update.
3881 (GLR: Merge conflicting parses, pure, locations): Update.
3882 * tests/glr-regression.at (Uninitialized location when reporting
3883 ambiguity): Update
3884 * tests/input.at (Unused %define api.pure): New test case.
3885 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
3886 AT_PURE_IF and AT_PURE_AND_LOC_IF.
3887 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3888
c373bf8b
JD
38892007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3890
3891 %define push_pull -> %define api.push_pull. Discussed starting at
3892 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
3893 * data/push.c: Expect the new name.
3894 * data/yacc.c: Likewise.
3895 * doc/bison.texinfo (Push Decl): Update.
3896 (Decl Summary): Update %define entry.
3897 (Push Parser Function): Update.
3898 (Pull Parser Function): Update.
3899 (Parser Create Function): Update.
3900 (Parser Delete Function): Update.
3901 * tests/calc.at (Simple LALR Calculator): Update.
3902 * tests/input.at (%define enum variables): Update.
3903 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
3904 (Push Parsing: Multiple impure instances): Update.
3905 (Push Parsing: Unsupported Skeletons): Update.
3906 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
3907 (Exploding the Stack Size with Malloc): Update.
3908
3909 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
3910 other entries some.
3911
32f19b6b
JD
39122007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
3913
3914 For the XML output's terminal element, rename @number to @token-number,
3915 and add @symbol-number. In the nonterminal element, rename @number to
3916 @symbol-number. Discussed starting at
3917 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
3918 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
3919 renames.
3920 (xsl:template match="nonterminal"): Likewise.
3921 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
3922 (xsl:template match="nonterminal"): Likewise.
3923 * src/print-xml.c (print_grammar): Implement.
3924
255a6b90
JD
39252007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
3926
3927 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
3928 2007-10-11 change, the child elements here are items not rules.
408476bc 3929 (xsl:template match="item"): New.
255a6b90
JD
3930 (xsl:template match="rule"): Update for new reduced itemset.
3931 (xsl:template match="point"): Remove.
3932 (xsl:template match="empty"): For consistency with --graph, don't
3933 output "/* empty */".
3934 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
3935 line-wrap, don't pass a negative value as first-line-length since this
3936 won't work with the following changes.
3937 (xsl:template name="line-wrap"): Simplify slightly.
3938 (xsl:template name="ws-search"): Eliminate recursion.
3939 * src/print_graph.c (print_core): Don't print a reduction's lookahead
3940 set next to an item whose dot is not at the end of the RHS even if it
3941 happens to be associated with the same rule.
3942
88c78747
JD
39432007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3944
31984206
JD
3945 Add %define lr.keep_unreachable_states.
3946 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
3947 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
3948 * src/main.c (main): Implement it.
3949 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3950 Extend to test it, and fix a typo.
3951
39522007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
3953
3954 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
3955 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
3956 the example .output text.
3957 * tests/regression.at (Extra lookahead sets in report): Improve wording
3958 of comments.
3959
b7a70162
WP
39602007-10-17 Wojciech Polak <polak@gnu.org>
3961
3962 * src/print-xml.c (print_grammar): Renamed
3963 <terminal> and <nonterminal> attributes:
3964 "type" to "number" and "symbol" to "name".
3965 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
3966 Use new attribute names.
3967 (xsl:template match="nonterminal"): Likewise.
3968 * data/xslt/xml2xhtml.xsl: Likewise.
3969
a0de5091
JD
39702007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
3971
3972 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
3973 (Option Cross Key): Likewise.
3974
3975 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
3976 next to an item whose dot is not at the end of the RHS even if it
3977 happens to be associated with the same rule.
3978 * src/print.c (print_core): Likewise.
3979 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
3980 (Resolved SR Conflicts): Update output.
3981 * tests/regression.at (Extra lookahead sets in report): New test case.
3982
4c20d18d
WP
39832007-10-11 Wojciech Polak <polak@gnu.org>
3984
3985 * src/print-xml.c (print_core): Remove item set
3986 redundancy.
3987 * data/xslt/bison.xsl (bison:ruleNumber): New key.
3988 Improve processing time. Suggested by Joel E. Denny.
3989 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
3990 Write xsl:param "required" attribute as comment.
3991 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
3992 (xsl:template match="rule"): Support new reduced itemset.
3993 (xsl:template match="point"): Remove.
3994 * data/xslt/xml2xhtml.xsl: Likewise.
3995
f506ad1c
JD
39962007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
3997
3998 * src/getargs.c (version): Update copyright year.
3999
21f1b063
JD
40002007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4001
4002 Make xml2dot.xsl and --graph produce the same output.
4003 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4004 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4005 escaped later.
4006 (xsl:template name="output-node"): Use the new escape template instead
4007 of the string-replace template directly.
4008 (xsl:template name="output-edge"): Likewise.
4009 (xsl:template name="escape"): New, escapes backslashes and newlines in
4010 addition to quotation marks.
4011 * src/graphviz.c (start_graph, output_node, output_edge): Add
4012 whitespace to output for legibility.
4013
4014 Make xml2text.xsl and --report produce the same output, and remove the
4015 XML "conflicts" element since a conflict summary is easily extracted
4016 from the automaton.
4017 * data/xslt/bison.xsl: New.
4018 (xsl:template match="state" mode="bison:count-conflicts): New.
4019 * data/xslt/xml2text.xsl: Import bison.xsl.
4020 (xsl:template match="bison-xml-report"): Instead of styling the
4021 "conflicts" element, style the "automaton" element with mode
4022 "conflicts". Unlike the former, the latter lists S/R and R/R
4023 conflicts for a state on the same line.
4024 (xsl:template match="conflicts"): Remove.
4025 (xsl:template match="conflict"): Remove.
4026 (xsl:template match="terminal"): Line-wrap the list of rules in which
4027 the terminal is used.
4028 (xsl:template match="nonterminal"): Likewise for nonterminals.
4029 (xsl:template match="automaton" mode="conflicts"): New.
4030 (xsl:template match="state" mode="conflicts"): New.
4031 (xsl:template name="line-wrap"): New.
4032 (xsl:template name="ws-search"): New.
4033 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4034 (xsl:template match="bison-xml-report"): Instead of styling the
4035 "conflicts" element, style the "automaton" element with mode
4036 "conflicts."
4037 (xsl:template match="conflicts"): Remove.
4038 (xsl:template match="conflict"): Remove.
4039 (xsl:template match="automaton" mode="conflicts"): New.
4040 (xsl:template match="state" mode="conflicts): New.
4041 * src/conflicts.c (conflicts_output_xml): Remove.
4042 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4043 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4044 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4045 the corresponding XSLT is easier. Also, never wrap between a word and
4046 the comma that follows it.
4047
793fbca5
JD
40482007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4049
4050 Improve C++ namespace support. Discussed starting at
4051 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4052 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4053 b4_namespace_close): New macros that interpret the %define variable
4054 "namespace" so its value can contain "::" to indicate nested
4055 namespaces.
4056 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4057 the above macros.
4058 * data/lalr1.cc (b4_namespace): Likewise.
4059 * data/location.cc (b4_namespace): Likewise.
4060 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4061 inside a new table in the general %define entry. Document `%define
4062 namespace' there as well. Point the %name-prefix entry to it since it
4063 explains it more completely in the case of C++.
4064 (C++ Bison Interface): Mention `%define namespace' instead of
4065 %name-prefix.
4066 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4067 entry suffices.
4068 * tests/c++.at (Relative namespace references): New test case.
4069 (Absolute namespace references): New test case.
4070 (Syntactically invalid namespace references): New test case.
4071 * tests/input.at (C++ namespace reference errors): New test case.
4072
35b8730d
JD
40732007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4074
4075 Add syncline support and location accessor to internal %define
4076 interfaces.
4077 * data/bison.m4 (b4_percent_define_get_loc): New.
4078 (b4_percent_define_get_syncline): New.
4079 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4080 (b4_percent_define_default): Record defining location as line 1 rather
4081 than 0 for the sake of synchronizing #line's, and define
4082 b4_percent_define_syncline(VARIABLE).
4083 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4084 * src/muscle_tab.c (muscle_syncline_grow): New.
4085 (muscle_code_grow): Use muscle_syncline_grow.
4086 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4087 define b4_percent_define_syncline(VARIABLE).
4088 (muscle_percent_define_get_loc): New.
4089 (muscle_percent_define_get_syncline): New.
4090 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4091 remove some unused variables.
4092 (muscle_percent_define_default): Record defining location as line 1
4093 rather than 0 for the sake of synchronizing #line's, and define
4094 b4_percent_define_syncline(VARIABLE).
4095 (muscle_percent_define_check_values): Use
4096 muscle_percent_define_get_loc.
4097 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4098 (muscle_percent_define_get_syncline): Prototype.
4099 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4100 defaults): Update output for location change.
4101 (Complaining during macro argument expansion): Extend to test
4102 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4103
7dc4a694
JD
41042007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4105
4106 Fix some error-reporting macro bugs.
4107 * data/bison.m4 (b4_cat): New.
4108 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4109 to stdout so they don't become arguments to other macros. Update
4110 comments and add examples.
4111 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4112 add examples.
4113 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4114 after printing the error directive so that M4 doesn't report subsequent
4115 problems that are induced by this problem.
4116 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4117 instead of just in them. Recognize @\n in both places. Both expand to
4118 the empty string. Needed by b4_cat.
4119 * tests/skeletons.at (Complaining during macro argument expansion):
4120 New test case.
4121 (Fatal errors make M4 exit immediately): New test case.
4122
d4bd2295
JD
41232007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4124
4125 Implement --print-datadir.
4126 * src/getargs.c (usage): Mention.
4127 (PRINT_DATADIR_OPTION): New anonymous enum member.
4128 (long_options): Add entry for it.
4129 (getargs): Add case for it calling compute_pkgdatadir.
4130 * src/output.c (output_skeleton): Encapsulate data directory
4131 computation from here...
4132 (prepare): ... and from here...
4133 (compute_pkgdatadir): ... into this new function.
4134 * src/output.h (compute_pkgdatadir): Prototype.
4135
34cdeddf
JD
41362007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4137
4138 * src/print-xml.c (escape_bufs): New static global variable
4139 replacing...
4140 (xml_escape_n): ... the static local variable buf here.
4141 (print_xml): Free memory for escape_bufs.
4142 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4143
d782395d
JD
41442007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4145
4146 Replace `%push-parser' and `%push-pull-parser' with
4147 `%define push_pull "push"' and `%define push_pull "both"'.
4148 `%define push_pull "pull"' is the default.
4149 * doc/bison.texinfo (Push Decl, Push Parser Function,
4150 Pull Parser Function, Parser Create Function, Parser Delete Function):
4151 Update declarations.
4152 (Decl Summary, Table of Symbols): Replace %push-parser and
4153 %push-pull-parser entries with a %define push_pull entry.
4154 * data/bison.m4 (b4_percent_define_check_values): New macro.
4155 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4156 definitions...
4157 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4158 definitions...
4159 * data/push.c: ... to here and compute them from the value of the
4160 %define variable push_pull.
4161 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4162 parsing requests here...
4163 * data/yacc.c: ... hack this to switch to push.c any time
4164 b4_use_push_pull_flag or the %define variable push_pull is set. This
4165 will go away when we mv push.c yacc.c.
4166 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4167 push parsing is not supported since unused %define variables are
4168 reported anyway.
4169 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4170 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4171 comments for consistency with b4_percent_define_check_values.
4172 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4173 muscles.
4174 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4175 Remove.
4176 (prologue_declaration): Remove %push-parser and %push-pull-parser
4177 rules.
4178 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4179 * tests/calc.at: Update declarations.
4180 * tests/input.at (%define enum variables): New test case.
4181 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4182 declaration.
4183 (Push Parsing: Multiple impure instances): Update declaration.
4184 (Push Parsing: Unsupported Skeletons): New test case.
4185 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4186 declaration.
4187 (Exploding the Stack Size with Malloc): Update declaration.
4188
3f999f78
WP
41892007-09-24 Wojciech Polak <polak@gnu.org>
4190
4191 Add XSLT transformations.
4192
4193 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4194 * data/xslt/xml2text.xsl: Transform XML into plain text.
4195 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4196 * data/Makefile.am (xsltdir): New variable.
4197 (dist_xslt_DATA): Add xslt/*.xsl files.
4198
a4f75309
PE
41992007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4200
4201 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4202 Problem reported by Wojciech Polak.
4203 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4204 (xml_printf): Undo change I made on 21 September; that is,
4205 indent 2 spaces, not 1.
4206
ad5feac4
JD
42072007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4208
4209 Pacify ./configure --enable-gcc-warnings.
4210 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4211 `char const *' instead of `char *'.
4212 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4213 local variable `sep'.
4214
41d7a5f2
PE
42152007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4216
4217 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4218 elsewhere.
4219 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4220 (xml_printf): Indent just 1 space for level.
4221 (e_char, xlate_char): Remove.
4222 (xml_escape_string): Rewrite to avoid undefined behavior (used
4223 storage that was freed from the stack).
4224 (xml_escape_n): Don't bother checking for subscript error.
4225
3f999f78
WP
42262007-09-21 Wojciech Polak <polak@gnu.org>
4227
4228 Add Bison XML Automaton Report.
41d7a5f2
PE
4229
4230 Add support for an -x option to generate an XML report.
4231 It is not documented yet.
4232 * src/print-xml.c: New file.
4233 * src/print-xml.h: Likewise.
4234 * lib/timevar.def (TV_XML): New var.
4235 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4236 * src/conflicts.c: Include print-xml.h.
4237 (solved_conflicts_xml_obstack): New var.
4238 (log_resolution, conflicts_solve, conflicts_free):
4239 Add support for XML report.
4240 (conflicts_output_val): New function.
4241 * src/conflicts.h (conflicts_output_val): New decl.
4242 * src/files.c (spec_xml_file): New var.
4243 (compute_output_file_names, output_file_names_free): Add XML support.
4244 * src/files.h (spec_xml_file): New decl.
4245 * src/getargs.c (xml_flag): New var.
4246 (usage, short_options, long_options, getargs): Add XML support.
4247 * src/getargs.h (xml_flag): New decl.
4248 * src/gram.c: Include print-xml.h.
4249 (rule_lhs_print_xml, rule_rhs_print_xml):
4250 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4251 New functions.
4252 * src/gram.h: Declare external ones.
4253 * src/main.c: Include print-xml.h.
4254 (main): Add XML support.
4255 * src/reduce.c: Include print-xml.h.
4256 (reduce_xml): New function.
4257 * src/reduce.h: Declare it.
4258 * src/state.c: Include print-xml.h.
4259 (state_new): Add XML support.
4260 (state_rule_lookahead_tokens_print_xml): New function.
4261 * src/state.h: Declare it.
4262 (struct state): New member solved_conflicts_xml.
4263 * src/symtab.c (symbol_class_get_string): New function.
4264 * src/symtab.h: Declare it.
4265
6d8e724d
PE
42662007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4267
4268 * GNUmakefile: Switch to coreutils's version.
4269 * bootstrap: Likewise.
4270 * Makefile.cfg: Adjust to new GNUmakefile.
4271 * README-hacking: Likewise.
4272
4273 Import from gnulib:
4274
4275 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4276 Bruno Haible <bruno@clisp.org>
4277
4278 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4279 and is a script that invokes bison. Tighten the code. Add comments.
4280
922bdd7f
JD
42812007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4282
4283 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4284 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4285 * doc/bison.texinfo (Decl Summary): Fix.
4286 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4287 * tests/input.at (Boolean %define variables): Update output.
4288 * tests/skeletons.at (%define boolean variables: invalid skeleton
4289 defaults): Rename to...
4290 (%define Boolean variables: invalid skeleton defaults): ... this and
4291 update output.
4292
1b17b01d
JD
42932007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4294
4295 In impure push mode, don't allow more than one yypstate to be allocated
4296 since multiple impure parsers would corrupt yynerrs.
4297 * data/push.c (yypstate_allocated): New static global variable
4298 initialized to 0.
4299 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4300 exhaustion if yypstate_allocated is 1, but still return 2.
4301 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4302 already 1. Otherwise, set it to 1.
4303 (yypstate_delete): Set it to 0.
4304 * tests/push.at (Push Parsing: Multiple impure instances): New test
4305 case.
4306
9987d1b3
JD
43072007-08-17 Bob Rossi <bob@brasko.net>
4308
4309 * doc/bison.texinfo (Push Decl): Document the push parser.
4310 (Table of Symbols): Ditto.
4311 (Pure Decl): Ditto.
4312 (Decl Summary): Ditto.
4313 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4314 Parser Create Function, Parser Delete Function):
4315 Add new push parser symbols.
4316 (Table of Symbols): Document push-parser, push-pull-parser,
4317 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4318
f16b0819
PE
43192007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4320
4321 Update to GPLv3.
4322 * doc/gpl-3.0.texi: New file.
4323 * doc/gpl.texi: Remove.
4324 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4325 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4326 * README-hacking, TODO, bootstrap, bootstrap.conf:
4327 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4328 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4329 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4330 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4331 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4332 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4333 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4334 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4335 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4336 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4337 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4338 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4339 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4340 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4341 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4342 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4343 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4344 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4345 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4346 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4347 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4348 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4349 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4350 * src/complain.c, src/complain.h, src/conflicts.c:
4351 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4352 * src/files.h, src/flex-scanner.h, src/getargs.c:
4353 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4354 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4355 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4356 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4357 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4358 * src/print.c, src/print.h, src/print_graph.c:
4359 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4360 * src/reduce.h, src/relation.c, src/relation.h:
4361 * src/revision.h, src/scan-code.h, src/scan-code.l:
4362 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4363 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4364 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4365 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4366 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4367 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4368 * tests/existing.at, tests/glr-regression.at:
4369 * tests/headers.at, tests/input.at, tests/java.at:
4370 * tests/local.at, tests/output.at, tests/push.at:
4371 * tests/reduce.at, tests/regression.at, tests/sets.at:
4372 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4373 * tests/torture.at:
4374 Update to GPLv3.
4375
728c4be2
JD
43762007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4377
4378 Get rid of broken %no-parser, -n, and --no-parser implementation and
4379 documentation.
4380 * TODO: Don't mention them.
4381 * doc/bison.1: Likewise.
4382 * doc/bison.texinfo (Decl Summary): Likewise.
4383 (Bison Options): Likewise.
4384 (Option Cross Key): Likewise.
4385 * src/getargs.c (no_parser_flag): Remove global variable.
4386 (usage): Don't print description of -n and --no-parser.
4387 (long_options): Remove --no-parser entry here.
4388 (getargs): Remove -n case in the switch here.
4389 * src/getargs.h (no_parser_flag): Remove extern.
4390 * tests/regression.at (Web2c Actions): Remove comment that mentions
4391 --no-parser.
4392
5d31a216
JD
43932007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4394
4395 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4396 name user variables starting with `yy'. Just pass NULL instead of a
4397 dummy local &yylval to yypush_parse.
4398 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4399 starting with `yy'.
4400
a2ea208d
JD
44012007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4402
4403 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4404 true since it's then always used regardless of whether yyoverflow is
4405 defined. Reported by Christian Burger at
4406 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4407 * THANKS: Add Christian Burger.
4408
91661ebb
JD
4409 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4410 node names: say "Decl Summary" not "Bison Declaration Summary".
4411
cbd50549
JD
44122007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4413
4414 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4415 determine whether this function has already complained about an invalid
4416 value for a %define boolean variable, don't check whether Bison has
4417 ever examined the value. As written, the check was a tautology.
4418 Instead, record and check for this complaint using a separate muscle.
4419
eb1b0740
JD
44202007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4421
4422 Fix push parsing memory leak reported by Brandon Lucia at
4423 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4424 * THANKS: Add Brandon Lucia.
4425 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4426 but the parse never completed and thus freed it.
4427 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4428 * tests/testsuite.at: Include push.at.
4429 * test/push.at: New.
4430 (Push Parsing: Memory Leak for Early Deletion): New test case.
4431
9d774aff
JD
44322007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4433
4434 Improve handling of multiple S/R conflicts in the same state and of S/R
4435 conflicts involving multiple reductions.
4436 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4437 set for a state here or Bison will abort if it is reassigned on a
4438 later conflicted reduction in the same state.
4439 Similarly, don't finalize and assign the solved conflicts report here
4440 or it will be lost if it is reassigned on a later conflicted reduction
4441 in the same state.
4442 (set_conflicts): Instead, assign them both here after all S/R conflicts
4443 in the state have been fully examined.
4444 * src/print.c (shift_set): Rename to...
4445 (no_reduce_set): ... this.
4446 (print_reductions): Update for rename, and add %nonassoc error action
4447 tokens to no_reduce_set so that, when printing the first remaining
4448 reduction on an error action token, the reduction is enclosed in
4449 brackets.
4450 (print_results): Update for rename.
4451 * tests/conflicts.at (Solved conflicts report for multiple reductions
4452 in a state): New test case.
4453 (%nonassoc error actions for multiple reductions in a state): New test
4454 case.
4455
4456 * src/main.c (main): Don't depend on C99 features.
4457
10159d2a
JD
44582007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4459
4460 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
4461 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4462 uniwidth.
10159d2a 4463
953b3935
JD
44642007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4465
4466 * bootstrap (slurp): Create target directories that don't exist.
4467 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4468
6ce2d93a
JD
44692007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4470
4471 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4472 than item number.
4473 * closure.c (closure): Likewise.
4474 * state.h (reductions): Comment sorting of rules.
4475 (state): Comment sorting of items.
4476
ce3448d5
JD
44772007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4478
4479 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4480 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4481 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4482 definition in order to avoid Gnulib headers since we don't use config.h
4483 here.
4484 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4485 rather than AT_DATA so that config.h is included.
4486
8a86eef0
JD
44872007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4488
4489 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4490 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4491 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4492 and so that YYFPRINTF is guaranteed to be defined here.
4493
b1a81613
JD
44942007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4495
4496 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4497 with...
4498 (muscle_percent_define_check_values): ... this more helpful function.
4499 Again, it's not used yet, but it will be.
4500 * src/muscle_tab.h: Likewise.
4501
71b61d4d
JD
4502 Improve some comments in parser table construction.
4503 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4504 (generate_states): Don't mention ruleset, which is internal to closure.
4505 * src/closure.c (closure): Explain sorting of core and itemset, which
4506 is required for this function to behave correctly.
4507 * src/closure.h (closure): Mention sorting.
4508
2a6b783d
JD
45092007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4510
4511 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4512 move the check for disabled transitions to an aver since conflict
4513 resolution hasn't happened yet.
4514
4515 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4516 labels a state as inconsistent just because it has error transitions.
4517 The original form of this check appeared in revision 1.1 of lalr.c,
4518 which was committed on 1991-12-21. Now (at least), changing the
4519 consistency label on such a state appears to have no useful effect in
4520 any of the places it is examined, which I enumerate below. The key
4521 point to understanding each item in this enumeration is that a state
4522 with an error transition is labelled consistent in the first place only
4523 if it has no rules, so the check cannot matter for states that have
4524 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4525 to try to identify its conflicts, and a state must have *rules* to have
4526 conflicts. (2) Labelling a state as inconsistent will affect how
4527 action_row sets the default *rule* for the state. (3) Labelling a
4528 state as inconsistent will cause build_relations to add lookback edges
4529 to *rules* in that state.
4530 * src/state.h (struct state): Word the comment for member consistent
4531 more carefully.
4532
14462c2b
JD
45332007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4534
4535 Don't depend on C99 features.
4536 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4537 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4538 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4539 * src/state.c (state_mark_reachable_states): Fix for-loop.
4540 (state_remove_unreachable_states): Fix for-loop.
4541
4542 Don't widen struct state with member reachable just to temporarily
4543 record reachability. Instead, use a local bitset.
4544 * src/state.h (struct state): Remove member.
4545 * src/state.c (state_new): Don't initialize it.
4546 (state_mark_reachable_states): Rename to...
4547 (state_record_reachable_states): ... this, and use bitset.
4548 (state_remove_unreachable_states): Use bitset.
4549
5a43d418
JD
45502007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4551
4552 * src/Makefile.am (yacc): Quote target action commands properly so
4553 that the yacc script isn't corrupt. Reported by Hans Aberg at
4554 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4555
0c650a20
JD
4556 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4557 the case of pure parsers. Reported by Frans Englich at
4558 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4559 * THANKS: Add Frans Englich.
4560
61fee93e
JD
4561 * NEWS (2.3a+): In the %code entry, reference section `Bison
4562 Declaration Summary' from the manual now since the %code summary has
4563 moved there.
4564 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4565 in the rules section must be terminated by semicolons.
4566
f124d423
JD
45672007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4568
4569 Extend the front-end API for %define variables to more completely
4570 mirror the back-end. This will be useful in the future.
4571 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4572 Update comments to mention the new front-end counterparts of these
4573 macros.
4574 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4575 for muscle_string_decode and muscle_location_decode.
4576 (muscle_string_decode): New static function.
4577 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4578 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4579 functions.
4580 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4581 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4582 implementation more closely.
4583 (muscle_percent_define_invalid_value): New function.
4584 * src/muscle_tab.h (muscle_percent_define_get,
4585 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4586 Prototype.
4587
75ad86ee
JD
45882007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4589
4590 * NEWS (2.3a+): Mention yesterday's state-removal change.
4591 (2.3a): Remove the %language entry, which was added after 2.3a.
4592 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4593 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4594 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4595 tests/existing.at: Update copyright date.
4596
5967f0cf
JD
45972007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4598
4599 If conflict resolution makes states unreachable, remove those states,
4600 report rules that are then unused, and don't report conflicts in those
4601 states.
4602 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4603 New global function.
4604 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4605 function.
4606 * src/main.c (main): After conflict resolution, remove the unreachable
4607 states and update all data structures that reference states by number.
4608 * src/state.c (state_new): Initialize each state's reachable member to
4609 false.
4610 (state_mark_reachable_states): New static function.
4611 (state_remove_unreachable_states): New global function.
4612 * src/state.h (struct state): Add member bool reachable.
4613 (state_remove_unreachable_states): Prototype.
4614 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4615 New test case.
4616 * tests/existing.at (GNU pic Grammar): Update test case output now that
4617 an unused rule is discovered.
4618
b09f4f48
JD
46192007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4620
4621 Minor code cleanup in parser table construction.
4622 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4623 (new_itemsets, save_reductions): Update for rename to nitemset.
4624 * src/closure.c (nritemset): Rename to...
4625 (nitemset): ... this since the "r" appears to meaningless and isn't
4626 used in the comments.
4627 (closure): Update for rename.
4628 * src/closure.h (nritemset): Update extern to...
4629 (nitemset): ... this.
4630 * src/lalr.c (LA): Fix a typo in comments.
4631 * src/print.c (print_core): Update for rename to nitemset.
4632 * src/print_graph.c (print_graph): Likewise.
4633 * src/state.h: Fix some typos in header comments.
4634
bbb44d83
PE
46352007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4636
9b33de72
PE
4637 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4638 still sticks to ASCII. Sorry!
4639
bbb44d83
PE
4640 * README-hacking: New file, taken mostly from coreutils, with changes
4641 for Bison. Contains much of the contents of:
4642 * README-cvs: Remove.
4643 * bootstrap: Sync from gnulib.
4644 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4645 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4646
29553547
JD
46472007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4648
4649 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4650 Setzer.
4651 (Java Differences): Fix some typos.
4652 * THANKS: Add Sebastian Setzer.
4653
01b477c6
PB
46542007-03-07 Paolo Bonzini <bonzini@gnu.org>
4655
730739e4
AD
4656 * data/java.m4 (b4_single_class_if): Remove.
4657 (b4_abstract_if): Look at "%define abstract".
4658 (b4_lexer_if): New.
4659 (b4_union_name): Rename...
4660 (b4_yystype): ... to this. Map to "%define stype".
4661 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4662 b4_maybe_throws): Fix quoting.
4663 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4664 * data/lalr1.java (Lexer interface): Always define.
4665 (Lexer interface within parser class): Remove.
4666 (YYLexer class): New, used when "%code lexer" is present.
4667 (constructor): When "%code lexer" is used, pass %lex-param
4668 to the lexer constructor.
4669 (yylex, yyparse): Remove %lex-param from method invocations
4670 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4671
4672 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4673 abstract". Rename "%define union_name" to "%define stype".
4674 Rename method names according to previous patch.
4675 (Java Scanner Interface): Describe "%code lexer" instead of
4676 "%pure-parser" and "%define single_class".
4677 (Java Differences): Mention "%code lexer".
4678
4679 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4680 Include scanner here, using macros from tests/local.at.
4681 (AT_DATA_CALC_Y): Remove final argument.
4682 (_AT_CHECK_JAVA_CALC): Likewise.
4683 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4684 of %locations and %error-verbose.
4685 (main): Test with and without %lex-param.
4686 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4687 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 4688
122bea3a
JMG
46892007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4690
4691 DJGPP spefic issue. Inhibit the use of disallowed characters for
4692 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4693 and concern testsuite case 46.
4694 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4695 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4696 * djgpp/config.bat: Inhibit the use of disallowed characters.
4697
9611cfa2
JD
46982007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4699
4700 Miscellaneous %define and %code cleanup.
4701 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4702 values are interpreted.
4703 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4704 documentation a little more.
4705 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4706 muscle_percent_define_insert, muscle_percent_code_grow): New
4707 functions/macros.
4708 * src/muscle_tab.h (muscle_percent_define_insert,
4709 muscle_percent_code_grow): Prototype.
4710 * src/parse-gram.y (prologue_declaration): Use
4711 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4712 %define and %code directives.
4713
4714 Make it easy to share %define boolean variables between the front-end
4715 and back-end. Though not used yet, this will be useful in the future.
4716 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
4717 Bison uses of names rather than just skeleton uses of names.
4718 (b4_percent_define_get, b4_percent_define_ifdef): Rename
4719 b4_percent_define_skeleton_variables(VARIABLE) to
4720 b4_percent_define_bison_variables(VARIABLE).
4721 (b4_percent_code_get, b4_percent_code_ifdef): Rename
4722 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
4723 b4_percent_code_bison_qualifiers(QUALIFIER).
4724 (b4_check_user_names_wrap): Update for renames.
4725 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
4726 muscle_percent_define_default): New functions mimicking
4727 b4_percent_define_flag_if and b4_percent_define_default.
4728
4729 For %define variables, report locations for invalid values and
bbb44d83 4730 redefinitions.
9611cfa2
JD
4731 * data/bison.m4 (b4_percent_define_flag_if): Read
4732 b4_percent_define_loc(VARIABLE) to report the location of an invalid
4733 value for VARIABLE.
4734 (b4_percent_define_default): Save a special location in
4735 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
4736 must later be reported as invalid.
4737 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
4738 functions.
4739 (muscle_percent_define_insert): Record the location of VARIABLE in
4740 muscle percent_define_loc(VARIABLE), and use it to report the previous
4741 location for a redefinition.
4742 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
4743 (muscle_percent_define_default): Update like b4_percent_define_default.
4744 (muscle_grow_user_name_list): Rename to...
4745 (muscle_user_name_list_grow): ... this for consistency and use
4746 muscle_location_grow.
4747 * src/muscle_tab.h (muscle_location_grow): Prototype.
4748 * tests/input.at (%define errors): Update expected output.
4749 * tests/skeletons.at (%define boolean variables: invalid skeleton
4750 defaults): New test case.
4751
0bf92491
JD
47522007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
4753
4754 * src/print.c (lookahead_set, state_default_rule): Remove.
4755 (print_reductions): Replace state_default_rule invocation with
4756 equivalent use of yydefact, which was computed in token_actions in
4757 tables.c.
4758 (print_results): Don't allocate lookahead_set.
4759
d3b12988
PB
47602007-02-27 Paolo Bonzini <bonzini@gnu.org>
4761
4762 * data/lalr1.java: Prefix all private members with yy.
4763
f57a7536
JD
47642007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
4765
4766 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 4767 Sebastien Fricker at
f57a7536 4768 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 4769 * THANKS: Add Sebastien Fricker.
f57a7536
JD
4770 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
4771 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
4772 accept a variable number of arguments.
4773
6404a5bf
JD
47742007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4775
4776 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
4777
e4e09639
JMG
47782007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4779
4780 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
4781 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
4782 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
4783
d7e0a1a7
PE
47842007-02-11 Paul Eggert <eggert@cs.ucla.edu>
4785
4786 Undo my 2007-02-07 change, switching back to the c-strcase module
4787 introduced in the 2007-02-03 change. Bruno Haible reported that
4788 the 2007-02-07 change would be dangerous in Turkish if we add a
4789 language whose name contains "i", since "i" is not lowercase "I"
4790 in Turkish.
4791 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
4792 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
4793 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
4794 * m4/.cvsignore: Remove strcase.m4.
4795 * src/getargs.c: Revert 2007-02-07 change, as follows.
4796 Include c-strcase.h.
4797 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
4798
deee93a1
JD
47992007-02-11 Bruno Haible <bruno@clisp.org>
4800
4801 Enable the Java related testsuite tests when the only Java compiler
4802 found is a gcj < 4.3. Discussed at
4803 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
4804 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
4805
574add85
JD
48062007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
4807
4808 * data/Makefile.am: Update copyright date.
4809 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
4810 yypstate_new returns NULL.
4811 (yypstate_new): Return NULL if malloc does.
4812 * src/reader.c (packgram): Move translation of rule actions from the
4813 beginning of packgram to...
4814 (check_and_convert_grammar): ... here right before packgram is invoked
4815 so it's easier to write more complete comments, and remove redundant
4816 code.
4817
e785ccf7
JD
48182007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
4819
4820 As in semantic actions, make @$ in %initial-action, %destructor, and
4821 %printer imply %locations.
4822 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
4823 scanning @$.
4824 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
4825 (@$ in %initial-action implies %locations,
4826 @$ in %destructor implies %locations,
4827 @$ in %printer implies %locations): ... these new test cases.
4828
1cfe1ed7
PE
48292007-02-07 Paul Eggert <eggert@cs.ucla.edu>
4830
4831 Undo most of the 2007-02-03 change, switching to the strcase module
4832 now that gnulib strcase has been fixed.
4833 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
4834 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
4835 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
4836 * m4/.cvsignore: Add strcase.m4.
4837 * src/getargs.c: Revert 2007-02-03 change, as follows.
4838 Don't include c-strcase.h.
4839 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
4840 strcasecmp has "unspecified behavior" outside the POSIX locale,
4841 but it works fine in practice if at least one argument is ASCII,
4842 as is the case in Bison.
4843
0049ec86
PB
48442007-02-07 Paolo Bonzini <bonzini@gnu.org>
4845
4846 * tests/java.at: Skip tests if only one of javac/java is present.
4847 Reported by Joel E. Denny.
4848 * tests/atlocal.in: Adjust copyright years.
4849
48502007-02-05 Paolo Bonzini <bonzini@gnu.org>
4851
4852 * data/lalr1.java (Stack): Work around old verifiers that disallow
4853 access to the private fields of an inner class, from the outer class.
4854 We can make Stack's fields public because user code doesn't have access
4855 to the instance of Stack used by parse(). Reported by Paul Eggert.
4856
2c2b7220
PE
48572007-02-03 Paul Eggert <eggert@cs.ucla.edu>
4858
4859 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
4860 the right spot for these files?
4861 * bootstrap.conf (gnulib_modules): Add c-strcase.
4862 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
4863 c-strncasecmp.c.
4864 * src/getargs.c: Include c-strcase.h.
4865 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
4866 to avoid unspecified behavior.
4867
b2b81dae
JD
48682007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
4869
4870 * doc/bison.texinfo (Decl Summary): Correct typo.
4871
c1d19e10
PB
48722007-01-30 Paolo Bonzini <bonzini@gnu.org>
4873
4874 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
4875 Complain if the value does not match empty, "true" or "false".
4876 * data/c++.m4: Adjust default definitions of %define variables.
4877 * data/java.m4: Adjust default definitions of %define variables.
4878 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
4879 to above behavior.
4880 * tests/input.at (Boolean %define variables): Test new behavior.
4881
8405b70c
PB
48822007-01-29 Paolo Bonzini <bonzini@gnu.org>
4883
4884 * NEWS: Mention java.
4885 * TODO: Remove things that are done.
4886 * bootstrap.conf: Add javacomp-script and javaexec-script.
4887 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
4888
4889 * data/Makefile.am: Add new files.
4890 * data/java-skel.m4: New.
4891 * data/java.m4: New.
4892 * data/lalr1.java: New.
4893
4894 * doc/bison.texinfo: Put "A Complete C++ Example" under
4895 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
4896 under Other Languages.
4897
4898 * src/getargs.c (valid_languages): Add Java.
4899 * src/getargs.h (struct bison_language): Update size of string fields.
4900
4901 * tests/Makefile.am: Add java.at.
4902 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
4903 * tests/java.at: New.
4904 * tests/testsuite.at: Include it.
4905
3eb82471
JD
49062007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
4907
4908 Clean up.
4909 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
4910 at_directive_argv arguments so these no longer have to be global
4911 variables. Also, update the implementation for the following changes.
4912 (fail_for_at_directive_too_many_args,
4913 fail_for_at_directive_too_few_args): Add at_directive_name argument.
4914 (at_directive_name): Remove as at_directive_argv[0] will be used for
4915 this now.
4916 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
4917 for the directive name.
4918 (at_directive_argc, at_directive_argv): Make these local within
4919 skel_lex instead of global.
4920 (INITIAL): Update directive start action for above changes.
4921 (SC_AT_DIRECTIVE_ARG): Rename to...
4922 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
4923 (SC_AT_DIRECTIVE_SKIP_WS): Update.
4924 (scan_skel): Move yylex_destroy to...
4925 (skel_scanner_free): ... here.
4926 * tests/skeletons.at (installed skeleton file name): Rename to...
4927 (installed skeleton file names): ... this.
4928
148d66d8
JD
49292007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
4930
4931 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4932 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
4933 Summary" not "Directives".
4934 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
4935 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
4936 since the former is now the more complete one.
4937 (Prologue Alternatives): Likewise and do the same for %defines.
4938 (Table of Symbols): Add summary of %code, add summary of %define, and
4939 move full %code documentation to...
4940 (Decl Summary): ... here for consistency with other entries in these
4941 sections.
4942 Move %define entry in order to keep this list alphabetized.
4943 Reword %define entry a little to put less emphasis on the skeleton
4944 concept, which most users shouldn't have to think about.
4945
665f0c24
PE
49462007-01-26 Paul Eggert <eggert@cs.ucla.edu>
4947
4948 Adjust to recent gnulib changes.
4949 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
4950 Add string.h, string_.h, unistd_.h, wchar_.h.
4951 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
4952 * src/system.h: Don't include <stpcpy.h>; this is now done by
4953 <string.h>.
4954
592d0b1e
PB
49552007-01-23 Paolo Bonzini <bonzini@gnu.org>
4956
4957 Simplify implementation of unqualified %code, implement macros for
4958 uniform treatment of boolean %define flags. Document %define.
4959 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
4960 b4_percent_code_ifdef): New.
4961 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
4962 * data/c++.m4: Define default value for global_tokens_and_yystype.
4963 * data/glr.cc: Likewise.
4964 * data/location.cc: Use b4_percent_define_flag_if.
4965
148d66d8 4966 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
4967
4968 * src/parse-gram.y (Unqualified %code): Change muscle name to
4969 b4_percent_code().
4970 (content.opt): Default to empty.
4971
a7867f53
JD
49722007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
4973
4974 Implement support for relative and absolute skeleton file names.
4975 Discussed starting at
4976 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
4977 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
4978 (Bison Options): Document in --skeleton entry.
4979 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
4980 full_skeleton can't necessarily hold all of pkgdatadir.
4981 If the specified skeleton file name contains a `/', don't prepend
4982 pkgdatadir.
4983 * src/parse-gram.y (prologue_declaration): If the specified skeleton
4984 file name contains a `/', prepend the grammar file directory.
4985 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
4986 * skeletons.at: New file.
4987 (relative skeleton file names): New test case.
4988 (installed skeleton file names): New test case.
4989 * tests/testsuite.at: Include skeletons.at.
4990
4991 * bootstrap: Update copyright to 2007.
4992
830c9b18
PB
49932007-01-17 Paolo Bonzini <bonzini@gnu.org>
4994
4995 * bootstrap: Remove occurrences of .#bootmp from the files.
4996
a8c2e813
AD
49972007-01-17 Akim Demaille <akim@epita.fr>
4998
4999 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5000 nonterminals.
5001 Use per-type %printer.
5002
279cabb6
JD
50032007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5004
5005 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5006 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5007 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5008 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5009 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5010 tests/glr-regression.at, tests/input.at, tests/local.at,
5011 tests/output.at, tests/torture.at: Update copyright to 2007.
5012
bb32f4f2
AD
50132007-01-16 Akim Demaille <akim@epita.fr>
5014
5015 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5016 error code.
5017 (Calc++ Scanner): Exit with failure if we can't open the input
5018 file.
5019 Accept "-" standing for stdin.
5020 (Calc++ Top Level): Print the result only if the parsing was
5021 successful.
5022
7cff04b5
AD
50232007-01-16 Akim Demaille <akim@epita.fr>
5024
5025 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5026
a4e25e1d
JD
50272007-01-15 Paolo Bonzini <bonzini@gnu.org>
5028 and Joel E. Denny <jdenny@ces.clemson.edu>
5029
5030 Clean up %define and %code implementation in M4 some. Most
5031 importantly, rename all related macros to be in the b4_percent_define
5032 and b4_percent_code namespaces. Also, complete support for `.' in
5033 %define variable names and %code qualifiers.
5034 * data/bison.m4 (b4_check_user_names): Check for special
5035 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5036 m4_foreach loops.
5037 (b4_get_percent_define, b4_get_percent_code): Rename to...
5038 (b4_percent_define_get, b4_percent_code_get): ... these.
5039 Extend documentation with examples.
5040 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5041 b4_percent_define_skeleton_variables and
5042 b4_percent_code_skeleton_qualifiers.
5043 Expect any value for the %define variable `foo' to be stored in the
5044 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5045 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5046 expect any unqualified %code blocks to be stored in a macro named
5047 `b4_percent_code_unqualified'.
5048 Use m4_indir so that %define variable names and %code qualifiers can
5049 contain `.', which is allowed by the grammar parser.
5050 (b4_percent_define_default): New macro to set a default value for a
5051 %define variable.
5052 (m4_wrap): Update wrapped code, and fix some underquoting.
5053 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5054 Expect grammar uses of %define variables and %code qualifiers to be
5055 defined in b4_percent_define_user_variables and
5056 b4_percent_code_user_qualifiers.
5057 * data/c++.m4: Use b4_percent_define_default rather than
5058 m4_define_default. Fix some underquoting. Skeleton usage of %define
5059 variable define_location_comparison now implies skeleton usage of
5060 %define variable filename_type.
5061 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5062 data/push.c, data/yacc.c: Update macro names.
5063 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5064 muscle names.
5065
e37c665c
JMG
50662007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5067
5068 DJGPP specific issues.
5069
5070 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5071 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5072
7d2d521f
JD
50732007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5074
5075 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5076 run parsers in all tests so that Valgrind is invoked during
5077 maintainer-check-valgrind.
5078 (Duplicate representation of merged trees): Free all semantic values.
5079 (Duplicated user destructor for lookahead): Likewise.
5080
e0ac9b4b
JD
50812007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5082
5083 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5084 command-line prefix.
5085 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5086 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5087 miss Valgrind messages.
5088 (Exploding the Stack Size with Malloc): Likewise.
5089
78143faa
JD
50902007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5091
5092 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5093 locals. Reported by Juan Manuel Guerrero at
5094 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5095 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5096 Fix some indentation also.
5097 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5098 explaining this issue.
5099
7ecec4dd
JD
51002007-01-09 Paolo Bonzini <bonzini@gnu.org>
5101 and Joel E. Denny <jdenny@ces.clemson.edu>
5102
5103 Simplify union and prologue handling, and escape union and lex/parse
5104 params with digraphs.
5105 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5106 values to the empty string since these are no longer guaranteed
5107 initialized by the front-end.
5108 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5109 braces around b4_user_stype since this is no longer done by the
5110 front-end.
5111 * src/files.c, src/files.h (pre_prologue_obstack,
5112 post_prologue_obstack): Remove.
5113 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5114 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5115 with digraphs. This fixes lex params and parse params.
5116 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5117 * src/output.c (prepare): Remove muscle insertion of the prologues.
5118 (output): Remove freeing of pre_prologue_obstack and
5119 post_prologue_obstack.
5120 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5121 than prologue_augment for prologue parsing so you don't need prologue
5122 obstacks.
5c80250c
JD
5123 (grammar_declaration): For %union RHS, use `braceless' instead of
5124 "{...}" so that braces are already stripped and code is escaped with
5125 digraphs.
7ecec4dd
JD
5126 * src/reader.c (prologue_augment): Remove.
5127 (reader): Remove initialization of pre_prologue_obstack and
5128 post_prologue_obstack.
5129 * src/reader.h (prologue_augment): Remove.
5130
5131 * data/c.m4: Remove stray parenthesis.
5132
16dc6a9e
JD
51332007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5134
5135 Remove quotes from variables names in %define directives and from
5136 qualifiers in %code directives, and restrict the characters that are
5137 allowed in them to M4-friendly ones. For %define, continue to support
5138 the quoted form as a deprecated feature. Discussed starting at
5139 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5140 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5141 %code.
5142 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
5143 (Decl Summary): In %defines entry, update mention of `%code requires'
5144 and `%code provides'.
16dc6a9e
JD
5145 (C++ Location Values): Update %define uses.
5146 (Calc++ Parser Interface): Likewise.
5147 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 5148 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5149 * src/parse-gram.y (prologue_declaration): For %define variables, use
5150 `variable' instead of `STRING'.
5151 (grammar_declaration): For %code qualifiers, use `ID' instead of
5152 `STRING'.
5153 (variable): New nonterminal that takes an `ID' or a `STRING'.
5154 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5155 and %define uses.
5156 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5157 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5158 (%define errors): Update %define uses.
5159
e9813cd4
JD
51602007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5161
5162 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5163 instead of muscle_insert for %define values so that M4-special
5164 characters are replaced with digraphs.
5165 * tests/input.at (%define errors): Extend to check weird values.
5166
6afc30cc
JD
51672007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5168
5169 Instead of having skeletons declare all valid %define variables and
5170 %code qualifiers, provide macros that retrieve the associated values
5171 and build these lists automatically. Thus Bison will now warn when a
5172 variable or qualifier is not used by the skeleton in the current
5173 invocation regardless of whether it might sometimes be used by that
5174 skeleton in other invocations. Also, move all %define value macros to
5175 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5176 form, which is replaced by %code.
5177 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5178 (b4_check_user_names): ... this, and change the series of valid name
5179 arguments to a single list argument for names used in the skeleton
5180 similar to the existing list argument for names used in the grammar.
5181 Warn instead of complaining.
5182 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5183 values and %code code, to format %code code properly, and to build
5184 lists of all %define variables and %code qualifiers used in the
5185 skeleton: b4_skeleton_percent_define_variables and
5186 b4_skeleton_percent_code_qualifiers.
5187 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5188 Remove, and...
5189 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5190 the skeleton names lists can finish building first. In place of
5191 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5192 expect the lists b4_user_percent_define_variables and
5193 b4_user_percent_code_qualifiers.
5194 * data/c++.m4: Where setting default values for b4_parser_class_name,
5195 b4_location_type, b4_filename_type, b4_namespace, and
5196 b4_define_location_comparison, update their names to the
5197 b4_percent_define_ namespace.
5198 * data/glr.c: Don't use b4_check_percent_define_variables and
5199 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5200 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5201 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5202 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5203 * data/location.cc: Use b4_get_percent_define.
5204 * data/push.c: Don't use b4_check_percent_define_variables and
5205 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5206 * data/yacc.c: Likewise, and don't call m4_exit in
5207 b4_use_push_for_pull_if or m4_wrap code will never execute.
5208 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5209 Rename to...
5210 (muscle_grow_user_name_list): ... this for consistency with the
5211 terminology used in bison.m4.
5212 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5213 %define variable names, and rename muscle used_percent_define_variables
5214 to user_percent_define_variables.
5215 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5216 user_percent_code_qualifiers.
5217 (content): Remove.
5218 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5219 {CODE} form is no longer accepted.
5220 * tests/input.at (Reject bad %code qualifiers): Rename to...
5221 (Reject unused %code qualifiers): ... this, and update test output.
5222 (%define error): Update test output.
5223
7eb8a0bc
JD
52242007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5225
5226 Check for unrecognized %define variables similar to checking for
5227 unrecognized %code qualifiers. Check for redefined %define variables.
5228 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5229 generalizes...
5230 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5231 (b4_check_percent_define_variables): New, also wraps it.
5232 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5233 variables using b4_check_percent_define_variables.
5234 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5235 all those exercised in the test suite and all those listed in the
5236 `Default values' section of c++.m4. Are there others?
5237 * data/push.c, data/yacc.c: Declare no valid %define variables.
5238 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5239 similar to muscle_find, but it works even when the muscle stores a
5240 const value.
5241 (muscle_grow_used_name_list): New function for constructing the used
5242 name list muscles that b4_check_for_unrecognized_names requires.
5243 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5244 %define'd more than once. Define the b4_used_percent_define_variables
5245 muscle with muscle_grow_used_name_list.
5246 (grammar_declaration): Abbreviate %code code with
5247 muscle_grow_used_name_list.
5248 * tests/input.at (%define errors): New.
5249
3fc65ead
JD
52502007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5251
5252 Provide warn_at, complain_at, and fatal_at function callbacks to the
5253 skeletons, and use this for %code qualifier complaints.
5254 * data/bison.m4 (b4_error_at): New, invoked by...
5255 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5256 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5257 @fatal_at(...@) directives.
5258 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5259 qualifiers in b4_used_percent_code_qualifiers and to use
5260 b4_complain_at.
5261 * src/location.c, src/location.h (boundary_set_from_string): New global
5262 function.
5263 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5264 function.
5265 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5266 to b4_used_percent_code_qualifiers.
5267 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5268 function.
5269 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5270 (lineno): Rename to...
5271 (out_lineno): ... this so I don't misunderstand it again.
5272 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5273 here; these newlines are in the input but not the output file.
5274 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5275 (at_directive_perform): ... this new static function, and add handling
5276 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5277 directives.
5278 * tests/input.at (Reject bad %code qualifiers): Update test output with
5279 locations and extend.
5280
5281 * tests/output.at (Output file name: [, Output file name: ]): Remove
5282 bogus comment about these tests failing.
5283
1c7b7e1d
JD
52842007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5285
5286 Clean up b4_check_percent_code_qualifiers a little.
5287 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5288 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5289 documentation and add examples.
5290 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5291 qualifiers here.
5292
08af01c2
JD
52932007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5294
5295 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5296 unreliable -- especially when they're hidden inside another macro.
5297 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5298 data/c.m4: Remove m4_divert(-1).
5299 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5300 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5301 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5302 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5303 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5304 pushed and popped by m4sugar, should be first on the stack.
5305
5306 Provide warn, complain, and fatal function callbacks to the skeletons.
5307 This provides more flexibility than m4_fatal, improves the error
5308 message format, and captures messages for translation. Discussed
5309 starting at
5310 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5311 * data/bison.m4 (b4_error): New, invoked by...
5312 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5313 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5314 directives. Because these M4 macros might be called when the current
5315 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5316 the previous removal of uses of m4_divert, which caused trouble.
5317 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5318 m4_fatal to report unrecognized %code qualifiers.
5319 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5320 push parser requests.
5321 * data/glr.c: Use b4_complain instead of m4_fatal to report
5322 non-deterministic push parser requests.
5323 Update @output usage to @output(...@) form.
5324 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5325 report missing %defines. Update @output usage to @output(...@) form.
5326 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5327 @output(...@) form.
5328 * src/main.c (main): Invoke skel_scanner_free.
5329 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5330 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5331 obstack_for_string from flex-scanner.h.
5332 (YY_DECL): Use to declare skel_lex static.
5333 (decode_at_digraphs): Remove; now handled in the new
5334 SC_AT_DIRECTIVE_ARG start condition.
5335 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5336 functions.
5337 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5338 at_directive_argv): New static globals.
5339 (INITIAL): Use fail_for_invalid_at.
5340 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5341 recognize the start of a generalized `@directive(...@)' form and
5342 start...
5343 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5344 directive args (using the new obstack_for_string), to decode the
5345 contained @ diagraphs, and to perform the directive. It recognizes
5346 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5347 @output(...@).
5348 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5349 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5350 `@,'.
5351 (scan_skel): Initialize obstack_for_string on the first call.
5352 (skel_scanner_free): New function to free obstack_for_string.
5353 * tests/input.at (Reject bad %code qualifiers): Update test output.
5354
8e0a5e9e
JD
53552007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5356
5357 Consolidate the 4 prologue alternative directives (%code, %requires,
5358 %provides, and %code-top) into a single %code directive with an
5359 optional qualifier field. Discussed at
5360 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5361 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5362 alternatives.
5363 * doc/bison.texinfo (Prologue Alternatives): Update.
5364 (Decl Summary): Update to %code "requires" and %code "provides".
5365 (Calc++ Parser): Update to %code "requires".
148d66d8 5366 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
5367 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5368 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5369 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5370 which are skeleton-specific.
5371 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5372 declare what %code qualifiers it supports and to complain if any other
5373 qualifiers were used in the grammar.
5374 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5375 and b4_user_code([b4_percent_code_provides]) in place of
5376 b4_user_requires and b4_user_provides.
5377 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5378 Add b4_user_code([b4_percent_code_top]) and
5379 b4_user_code([b4_percent_code]).
5380 Invoke b4_check_percent_code_qualifiers.
5381 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5382 PERCENT_REQUIRES): Remove.
5383 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5384 %requires. Rewrite the %code RHS as the unqualified form defining the
5385 muscle b4_percent_code. Add another RHS for the qualified %code form,
5386 which defines muscles of the form b4_percent_code_QUALIFIER and the
5387 b4_used_percent_code_qualifiers muscle.
5388 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5389 PERCENT_REQUIRES): Remove.
5390 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5391 %code "requires" and %code "provides".
5392 * tests/input.at (Reject bad %code qualifiers): New.
5393
95021767
JD
53942007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5395
5396 Use the new code_props interface for destructors and printers.
5397 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5398 printer_location members, and change the type of the destructor and
5399 printer members to code_props.
5400 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5401 symbol_printer_get, semantic_type_destructor_set,
5402 semantic_type_printer_set, default_tagged_destructor_set,
5403 default_tagless_destructor_set, default_tagged_printer_set,
5404 default_tagless_printer_set): Use code_props in arguments and return
5405 types in place of char const * and location.
5406 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5407 since the locations are now contained in the return of
5408 symbol_destructor_get and symbol_printer_get.
5409 * src/output.c (symbol_destructors_output, symbol_printers_output):
5410 Replace with...
5411 (symbol_code_props_output): ... this to eliminate duplicate code.
5412 (output_skeleton): Update to use symbol_code_props_output.
5413 * src/reader.c (symbol_should_be_used): Update use of
5414 symbol_destructor_get.
5415 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5416 Update uses of the various _destructor_set and _printer_set functions.
5417 * src/symtab.c: (default_tagged_destructor_location,
5418 default_tagless_destructor_location, default_tagged_printer_location,
5419 default_tagless_printer_location): Remove since we...
5420 (default_tagged_destructor, default_tagless_destructor,
5421 default_tagged_printer, default_tagless_printer): ... change the type
5422 of these to code_props.
5423 (symbol_new, semantic_type_new, symbol_destructor_set,
5424 semantic_type_destructor_set, symbol_destructor_get,
5425 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5426 symbol_check_alias_consistency, default_tagged_destructor_set,
5427 default_tagless_destructor_set, default_tagged_printer_set,
5428 default_tagless_printer_set): Update.
5429 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5430 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5431 code_props members.
5432 (symbol_print): Use SYMBOL_CODE_PRINT.
5433
f6857bbf
JD
54342007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5435
5436 Use the new code_props interface for rule actions.
5437 * src/symlist.h (symbol_list): Replace action, action_location, and
5438 used members with a code_props action_props member.
5439 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5440 grammar_midrule_action, grammar_current_rule_merge_set,
5441 grammar_current_rule_symbol_append, packgram): Update.
5442 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5443 * src/scan-code.l (handle_action_dollar): Update.
5444 (translate_rule_action): Remove, no longer used.
5445 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5446
7c0c6181
JD
54472007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5448
5449 Use the new code_props interface in parse-gram.y.
5450 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5451 Update all uses of translate_* functions to use the new code_props
5452 interface and to use gram_scanner_last_string_free and
5453 code_scanner_last_string_free where possible.
5454 (grammar_declaration): symbol_list_destructor_set and
5455 symbol_list_printer_set now perform the translation, so don't do it
5456 here. Use gram_scanner_last_string_free where possible.
5457 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5458 translate_code): Remove, no longer used.
5459 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5460 symbol_list_printer_set): Perform code translation here rather than
5461 depending on the caller to do so.
5462
5463 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5464 * src/scan-gram.h (gram_last_string): Remove declaration.
5465 * src/scan-gram.l (last_string): Declare it static.
5466
28e52c0d
JD
54672007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5468
5469 Encapsulate code properties and related functionality for the various
5470 destructors, printers, and actions into a code_props structure and
5471 interface. This patch merely implements code_props in scan-code.h and
5472 scan-code.l. Future patches will rewrite other modules to use it.
5473 Discussed starting at
5474 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5475 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5476 consistently initialize const structs that have an empty location
5477 field.
5478 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5479 to ensure consistency.
5480 * src/scan-code.h (code_props): New structure.
5481 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5482 function, macro, and const global variable for initializing a
5483 code_props with no code.
5484 (code_props_plain_init, code_props_symbol_action_init,
5485 code_props_rule_action_init, code_props_translate_code): The rest of
5486 the new code_props functional interface. Among other things, the init
5487 functions set the code_props kind field so that
5488 code_props_translate_code will know whether to behave like
5489 translate_symbol_action, translate_rule_action, or translate_code.
5490 These old translate functions must remain until all other modules are
5491 updated to use the new code_props interface.
5492 (code_scanner_last_string_free): New function similar to
5493 gram_scanner_last_string_free.
5494 (code_scanner_free): Add documentation.
5495 * src/scan-code.l: Implement the new interface.
5496 (code_lex): Make it static, add a code_props* argument, and remove the
5497 rule argument.
5498 (last_string): New static global similar to the one in scan-gram.l.
5499 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5500 instead of rule.
5501 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5502 code_props since Bison may one day use this information for destructors
5503 and printers.
5504 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5505 (handle_action_dollar): Use symbol_list_n_get and set used flag
5506 directly since symbol_list_n_used_set is removed.
5507 (translate_action): Add a code_props* argument and remove the rule,
5508 action, and location arguments. Pass the code_props* on to code_lex.
5509 (translate_rule_action, translate_symbol_action, translate_code):
5510 Rewrite as wrappers around the new code_props interface.
5511 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5512 it would eventually need to break the encapsulation of code_props.
5513
96034983
JD
55142007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5515
5516 * etc/.cvsignore: New.
5517
945e396c
JD
55182007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5519
5520 Add maintainer-push-check to run maintainer-check using push parsing in
5521 place of pull parsing where available.
5522 * Makefile.am (maintainer-push-check): New.
5523 * data/bison.m4 (b4_use_push_for_pull_if): New.
5524 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5525 appropriately based on their existing values.
5526 (yypush_parse): Don't print push-parser-specific diagnostics if push
5527 parsing is being used in place of pull parsing.
5528 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5529 push.c.
5530 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5531 variable, and insert b4_use_push_for_pull_flag into muscles.
5532 * tests/Makefile.am (maintainer-push-check): New.
5533
7d596384
JD
55342006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5535
5536 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5537 (whether successful or failed) so that yypush_parse can be invoked
5538 again to start a new parse using the same yypstate.
5539 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5540 check multiple yypull_parse invocations on the same yypstate. For pull
5541 mode, extend to check multiple yyparse invocations.
5542 (Exploding the Stack Size with Alloca): Extend to try with
5543 %push-pull-parser.
5544 (Exploding the Stack Size with Malloc): Likewise.
5545
5546 * tests/calc.at (Simple LALR Calculator): Don't specify
5547 %skeleton "push.c" since %push-pull-parser implies that now.
5548 * tests/headers.at (export YYLTYPE): Don't check for the push
5549 declarations. Otherwise, this test case can't be used to see if push
5550 mode can truly emulate pull mode.
5551 * tests/input.at (Torturing the Scanner): Likewise.
5552 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5553 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5554 AT_YACC_IF, which now includes the case of push mode since %skeleton
5555 need not be used for push mode. This will be more intuitive once
5556 push.c is renamed to yacc.c.
5557
7172e23e
JD
55582006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5559
5560 For push mode, convert yyparse from a macro to a function, invoke yylex
5561 instead of passing a yylexp argument to yypull_parse, and don't
5562 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5563 Discussed starting at
5564 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5565 * data/bison.m4 (b4_pull_if): New.
5566 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5567 * data/push.c: Improve M4 quoting a little.
5568 (b4_generate_macro_args, b4_parenthesize): Remove.
5569 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5570 any time a pull parser is requested.
5571 Don't #define this as a wrapper around yypull_parse. Instead, when
5572 both push and pull are requested, make it a function that does that
5573 same thing.
5574 (yypull_parse): If there's a b4_prefix, #define this to
5575 b4_prefix[pull_parse] when both push and pull are requested.
5576 Don't define this as a function unless both push and pull are
5577 requested.
5578 Remove the yylexp argument and hard-code yylex invocation instead.
5579 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5580 %push-parser.
5581 * src/getargs.c (pull_parser): New global initialized to true.
5582 * getargs.h (pull_parser): extern it.
5583 * src/output.c (prepare): Insert pull_flag muscle.
5584 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5585 (prologue_declaration): Set both push_parser and pull_parser = true for
5586 %push-pull-parser. Set push_parser = true and pull_parser = false for
5587 %push-parser.
5588 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5589 %push-parser since there's no backward-compatibility concern here.
5590 Scan %push-pull-parser.
5591 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5592 instead of %push-parser.
5593 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5594 prototype it in the module that calls yyparse.
5595 * tests/input.at (Torturing the Scanner): Likewise.
5596 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5597
2e7944cb
JD
55982006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5599
5600 Update etc/bench.pl. Optimize push mode a little (the yyn change
5601 deserves most of the credit).
5602 * Makefile.am (SUBDIRS): Add etc subdirectory.
5603 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5604 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5605 yytoken, yyval, and yyloc declarations to...
5606 (yyparse or yypush_parse): ... here to improve performance. For
5607 yypush_parse invocations after the first, be sure to assign yyn its old
5608 value again.
5609 (yypstate_new): Don't bother initializing the yyresult field since the
5610 initial value isn't used.
5611 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5612 remove the #define that, in push mode, set it to yyps->NAME.
5613 * etc/Makefile.am: New.
5614 * etc/bench.pl: Remove and build it instead from...
5615 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5616 "tests/bison" from the build directory by default rather than just
5617 invoking "bison" from $PATH.
5618 (calc_grammar): Update push parser code: don't declare yylval globally,
5619 don't define yyparse_wrapper, and don't #define yyparse.
5620 (bench_grammar): Update to check all working combinations of yacc.c,
5621 push.c, impure, pure, pull, and push.
5622
c3d50342
JD
56232006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5624
5625 For push mode, add pull wrappers around yypush_parse.
5626 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5627 (yypull_parse): New function wrapping yypush_parse.
5628 (yyparse): New #define wrapping yypull_parse.
5629 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5630 is declared.
5631 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5632 prototype yylex in the module that calls yyparse, and don't prototype
5633 yyparse there. Otherwise, the yyparse expansion won't compile.
5634 * tests/input.at (Torturing the Scanner): Likewise.
5635
94ebeba5
JD
56362006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5637
5638 Enable push parsers to operate in impure mode. Thus, %push-parser no
5639 longer implies %pure-parser. The point of this change is to move
5640 towards being able to test the push parser code by running the entire
5641 test suite as if %push-parser had been declared.
5642 * data/push.c (yypush_parse): For impure mode, remove the
5643 yypushed_char, yypushed_val, and yypushed_loc arguments.
5644 Instead, declare these as local variables initialized to the global
5645 yychar, yylval, and yylloc.
5646 For the first yypush_parse invocation only, restore the initial values
5647 of these global variables when it's time to read a token since they
5648 have been overwritten.
5649 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5650 %push-parser.
5651 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5652 %pure-parser along with %push-parser since this test case was designed
5653 for pure push parsers.
5654 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5655 (AT_YACC_OR_PUSH_IF): New.
5656 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5657 add a note that it's still wrong for some cases (as it has been for a
5658 while).
5659 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5660 %push-parser no longer implies %pure-parser.
5661
a0633178
JD
56622006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5663
5664 Remove some unnecessary differences between the pull parser code and
5665 the push parser code. This patch enables yynerrs in push mode.
5666 * data/push.c: Reformat M4 a little.
5667 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5668 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5669 because push mode is on. Instead, if pure mode is on, move yynerrs
5670 to...
5671 (b4_declare_parser_state_variables): ... here.
5672 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5673 to yyps->NAME so it can be used in yypush_parse.
5674 (yypush_parse): Don't omit uses of yynerrs in push mode.
5675
8646b6a3
JD
56762006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5677
5678 Fix bug such that the first pushed token's value and location are
5679 sometimes overwritten (sometimes by %initial-action) before being used.
5680 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5681 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5682 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5683 more closely mimic the pull parser logic.
5684 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5685 time to read a token, which is after any initialization of yylval and
5686 yylloc.
5687 (gottoken): Rename label to...
5688 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5689 user namespace.
5690
9baf4d74
JD
56912006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5692
5693 Rearrange initialization of the parser state variables so that the
5694 skeleton doesn't have to have a copy for pull mode and another for push
5695 mode. This patch also fixes at least a bug such that yylloc was not
5696 initialized (with b4_location_initial_line and
5697 b4_location_initial_column) upon calling yypush_parse. However, that
5698 initialization now overwrites the first token's location;
5699 %initial-action assigning @$ already did the same thing, and both bugs
5700 will be fixed in a later patch.
5701 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5702 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5703 yyss, yyvs, yyls, and yystacksize.
5704 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5705 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5706 yylsp.
5707 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5708 yyps->NAME so it can be used in yypush_parse.
5709 (yyparse or yypush_parse): For yypush_parse, don't print the
5710 "Starting parse" diagnostic for invocations after the first.
5711 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5712 yypush_parse, only do it for the first invocation.
5713 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5714 initialization to occur in yypush_parse but only on the first
5715 invocation.
5716
23522164
JD
57172006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5718
5719 * data/push.c: Add CPP guards around push parser declarations in both
5720 the header and the code file.
5721 In the code file, move the push parser declarations to the same place
5722 they appear in the header file.
5723 Clean up the M4 some, especially the inconsistent underquoting in
5724 some b4_c_function_def and b4_c_function_decl uses.
5725
bb010fe5
JD
57262006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5727
5728 Encapsulate the push parser state variables into an M4 macro so the
5729 push skeleton doesn't have to list them again for pull mode's yyparse.
5730 For push mode, remove yypush_parse's local equivalents of these
5731 variables to eliminate unnecessary copying between the two sets at
5732 run-time. This patch also fixes at least a bug related to multiple
5733 %initial-action invocations in push mode.
5734 * data/push.c (b4_declare_parser_variables): Rename to...
5735 (b4_declare_scanner_communication_variables): ... this for clarity and
5736 update both uses.
5737 (b4_declare_yyparse_variables): Remove and move its contents to the one
5738 spot where it was invoked.
5739 (b4_declare_parser_state_variables): New macro containing the parser
5740 state variables required by push mode.
5741 (struct yypstate): Replace all fields but yynew with
5742 b4_declare_parser_state_variables.
5743 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
5744 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
5745 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
5746 (yyparse or yypush_parse): For yyparse in pull mode, replace local
5747 parser state variable declarations with
5748 b4_declare_parser_state_variables.
5749 Don't initialize parser state variables when calling yypush_parse since
5750 yypstate_new already does that.
5751 Invoke the user's initial action only upon the first yypush_parse
5752 invocation.
5753 Remove all code that copies between the local parser state variables
5754 and the yypstate.
5755
2d212f8c
JD
57562006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
5757
5758 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
5759 prevent a name collision in a future patch where these names will
5760 sometimes be #define'd.
5761 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
5762 since it no longer has the same name as the existing argument.
5763 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
5764
e6e704dc
JD
57652006-12-19 Paolo Bonzini <bonzini@gnu.org>
5766 and Joel E. Denny <jdenny@ces.clemson.edu>
5767
5768 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
5769 that the argument is case-insensitive, and there's no `=' here.
5770 For the %skeleton entry, mention that %language is better.
5771 (Bison Options): Likewise for --language and --skeleton. Move the
5772 --skeleton entry so that the `Tuning the parser' section is sorted
5773 alphabetically on long options.
5774 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
5775 %language directive in detail here; cross-reference the %language
5776 documentation instead.
5777 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
5778 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 5779 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
5780 * examples/extexi (normalize): Instead of replacing every %require
5781 argument with the current Bison version, just substitute for
5782 `@value{VERSION}'. This guarantees that we're testing what actually
5783 appears in the documentation.
5784 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
5785 rather than `@VERSION@'.
5786
0e021770
PE
57872006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5788
fd575f05
PE
5789 * NEWS: Reword the %language news a bit, and put it earlier.
5790
0e021770
PE
5791 * src/getargs.c (skeleton_arg): Last arg is now location const *.
5792 Rewrite to simplify the logic.
5793 (language_argmatch): Likewise.
fd575f05
PE
5794 (program_name): We now own this var.
5795 * src/getargs.h (struct bison_language): Use char[] rather than
5796 const char *.
0e021770
PE
5797
5798 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
5799 Java is supported.
5800 * src/complain.c (program_name): Remove decl; no longer needed.
5801 * src/main.c (program_name): Remove; now belongs to getargs.
5802
58032006-12-18 Paolo Bonzini <bonzini@gnu.org>
5804
5805 * NEWS: Document %language.
5806
5807 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
5808
5809 * data/c-skel.m4, data/c++-skel.m4: New files.
5810 * data/glr.c: Complain on push parsers.
5811
5812 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
5813 over %skeleton.
148d66d8 5814 (Decl Summary): Document %language and %skeleton.
0e021770
PE
5815 (Command line): Document -L.
5816
5817 * examples/extexi: Rewrite %require directive.
5818 * examples/calc++/Makefile.am: Pass VERSION to extexi.
5819
5820 * src/files.c (compute_exts_from_gc): Look in language structure
5821 for .y extension.
5822 (compute_file_name_parts): Check whether .tab should be added.
5823 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
5824 (language, skeleton_arg, language_argmatch): New.
5825 (long_options): Add --language.
5826 (getargs): Use skeleton_arg, add -L/--language.
5827 * src/getargs.h: Include location.h.
5828 (struct bison_language, language, skeleton_arg, language_argmatch): New.
5829 * src/output.c (prepare): Pick default skeleton from struct language.
5830 Don't dispatch C skeletons here.
5831 * src/parse-gram.y (PERCENT_LANGUAGE): New.
5832 (prologue_declaration): Add "%language" rule, use skeleton_arg.
5833 * src/scan-gram.l ("%language"): New rule.
5834
5835 * tests/calc.at: Test %skeleton and %language.
5836 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
5837 (AT_GLR_IF): Look for %skeleton "glr.cc".
5838 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
5839 (AT_YACC_IF): Reject %language.
5840
5691bf57
PE
58412006-12-18 Paul Eggert <eggert@cs.ucla.edu>
5842
db06f0ce
PE
5843 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
5844 since it wasn't used; only the typedef name 'semantic_type' is needed.
5845 Also, omit trailing white space.
5846
5691bf57
PE
5847 * bootstrap: Sync from coreutils.
5848 (gnulib_extra_files): Add build-aux/announce.gen.
5849 (slurp): Adjust .gitignore files like .cvsignore files.
5850 * build-aux/announce-gen: Remove from CVS, since bootstrap
5851 now creates this.
5852
791934e4
JD
58532006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
5854
5855 Make %push-parser imply %pure-parser. This fixes several bugs; see
5856 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
5857 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
5858 pure_parser = true.
5859 * data/push.c: Don't bother testing b4_push_if when deciding whether
5860 to expand b4_declare_parser_variables globally.
5861 (yypush_parse): Likewise in here.
5862
5863 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
5864 (yy_reduce_print): Reformat M4 for readability.
5865
ee5abb37
JD
58662006-12-15 Bob Rossi <bob@brasko.net>
5867 and Joel Denny <jdenny@ces.clemson.edu>
5868
5869 * data/push.c (yypstate): Add typedef, and update all uses of
5870 struct yypstate to just yypstate.
5871 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
5872
16ca01f9
JD
58732006-12-14 Bob Rossi <bob@brasko.net>
5874
5875 * data/push.c (yypush_parse): Declare prototype regardless of
5876 %locations option.
5877
ab8e7e1a
JD
58782006-12-14 Bob Rossi <bob@brasko.net>
5879
5880 * data/push.c (yyparse): Remove the prototype and the #define when in
5881 push-parser mode.
5882
9bf32be3
JD
58832006-12-13 Bob Rossi <bob@brasko.net>
5884
5885 * data/push.c (yypstate_init): Rename to...
5886 (yypstate_new): ... this and use b4_c_function_def.
5887 (yypstate_delete): New.
5888 (yypush_parse): Change parameters yynval and yynlloc to be const.
5889 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
5890 yypstate_delete functions.
5891
f02e2948
JD
58922006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
5893
5894 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
5895 strange test case titles. Reported by Bob Rossi.
5896
38eb7751
PE
58972006-12-13 Paul Eggert <eggert@cs.ucla.edu>
5898
5899 * TODO: Add pointer to Sylvain Schmitz's work on static detection
5900 of potential ambiguities in GLR grammers.
5901
bd9d212b
JD
59022006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
5903
5904 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
5905 `bison ', use m4_index instead of m4_substr since chopping up a string
5906 containing M4-special characters causes problems here.
5907
5908 Fix a couple of bugs related to special characters in user-specified
5909 file names, and make it easier for skeletons to compute output file
5910 names with the same file name prefix as Bison-computed output file
5911 names.
5912 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
5913 b4_parser_file_name and b4_spec_defines_file instead of
5914 @output_parser_name@ and @output_header_name@, which are now redundant.
5915 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
5916 b4_parser_file_name, b4_spec_defines_file, and the new
5917 @basename(FILENAME@) instead of @output_parser_name@ and
5918 @output_header_name@, which inappropriately escaped the file names as
5919 C string literals.
5920 * src/files.c (all_but_ext): Remove static qualifier.
5921 (compute_output_file_names): Move `free (all_but_ext)' to...
5922 (output_file_names_free): ... here since all_but_ext is needed later.
5923 * src/files.h (all_but_ext): Extern.
5924 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
5925 exactly what MUSCLE_INSERT_STRING used to do.
5926 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
5927 characters are escaped properly.
5928 * src/output.c (prepare): Define muscle file_name_all_but_ext as
5929 all_but_ext.
5930 For pkgdatadir muscle, maintain previous functionality by using
5931 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
5932 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
5933 digraphs would never be expanded. Hopefully no one has M4-special
5934 characters in his Bison installation path.
5935 * src/scan-skel.l: Don't parse @output_header_name@ and
5936 @output_parser_name@ anymore since they're now redundant.
5937 In @output, use decode_at_digraphs.
5938 Parse a new @basename command that invokes last_component.
5939 (decode_at_digraphs): New.
5940 (BASE_QPUTS): Remove unused.
5941 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
5942 (Output file name): New tests.
5943
3f7ca628
JD
59442006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
5945
5946 Warn about output files that are generated by the skeletons and that
5947 conflict with other output files.
5948 * data/glr.c: Don't generate the header file here when glr.cc does.
5949 * src/files.c (file_names, file_names_count): New static globals.
5950 (compute_output_file_names): Invoke output_file_name_check for files
5951 not generated by the skeletons and remove existing checks.
5952 (output_file_name_check): New function that warns about conflicting
5953 output file names.
5954 (output_file_names_free): Free file_names.
5955 * src/files.h (output_file_name_check): Declare.
5956 * src/scan-skel.l: Invoke output_file_name_check for files generated by
5957 the skeletons.
5958 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
5959 (Conflicting output files): New tests.
5960
178e123e
PE
59612006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5962
5963 * doc/bison.texinfo: Fix a couple of typos.
5964
59652006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
5966
5967 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
5968 Rename to...
5969 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
5970 update all uses.
5971 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
5972 (yypush_parse): Rename yypvars argument to yyps and remove redundant
5973 local pv.
5974 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
5975 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
5976
ea17f233
JD
59772006-12-07 Bob Rossi <bob@brasko.net>
5978 and Joel Denny <jdenny@ces.clemson.edu>
5979
5980 * data/push.c (yypvarsinit): Change return type from void* to struct
5981 yypvars*. No longer cast to void* on return.
5982 (struct yypvars): Remove yylen since it need not be remembered between
5983 yypushparse invocations.
5984 (yypushparse): Don't copy between yylen and pv->yylen.
5985
55a30bda
JD
59862006-12-05 Bob Rossi <bob@brasko.net>
5987
5988 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
5989 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
5990 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
5991 (struct yypvars): Remove b4_declare_parser_variables.
5992 (yypvarsinit): Remove init code for removed variables.
5993 (global scope): Do not declare b4_declare_parser_variables if
5994 push or pure mode.
5995 (yypushparse): Add b4_declare_parser_variables.
5996 Init new local variables, and remove init code for removed
5997 yypvars variables.
5998 (yyparse): Delete.
5999 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6000 and yyparse for other modes.
6001 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6002 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6003 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6004 (AT_PURE_LEX_IF): True if pure or push parser.
6005
85894313
JD
60062006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6007
6008 Document Yacc prologue alternatives and default %destructor's and
6009 %printer's as experimental. Don't mention Java yet. Discussed at
6010 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6011 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6012 (2.3a): Annotate this entry to say the old forms of these features were
6013 also experimental.
6014 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 6015 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
6016 of Java (we'll want this back eventually).
6017
02975b9a
JD
60182006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6019
6020 Support a file name argument to %defines. Deprecate `=' in
6021 %file-prefix, %name-prefix, and %output. Discussed at
6022 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6023 * NEWS (2.3a+): Mention.
148d66d8 6024 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
6025 form of %defines, and remove `=' from entries for %file-prefix,
6026 %name-prefix, and %output.
6027 * src/parse-gram.y (prologue_declaration): Implement.
6028 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6029 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6030 all but one occurrence of %name-prefix.
6031 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6032 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6033 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6034 occurrence of each of %file-prefix and %output. Add check for %defines
6035 with argument.
6036 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6037 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6038 Remove the `=' from %output.
6039
287b314e
JD
60402006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6041
6042 Don't escape $ in test case titles since Autoconf 2.61 now does that
6043 correctly.
6044 * tests/actions.at (Default %printer and %destructor are not for error
6045 or $undefined): Here.
6046 (Default %printer and %destructor are not for $accept): Here.
6047 * tests/input.at (Invalid $n and @n): Here.
6048
3ebecc24
JD
60492006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6050
6051 Rename <!> to <>. Discussed starting at
6052 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6053 * NEWS (2.3a+): Update.
148d66d8 6054 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
6055 Update.
6056 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6057 * src/scan-gram.l (INITIAL): Implement.
6058 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6059 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6060 comment.
6061 * tests/actions.at (Default tagless %printer and %destructor,
6062 Default tagged and per-type %printer and %destructor,
6063 Default %printer and %destructor are not for error or $undefined,
6064 Default %printer and %destructor are not for $accept,
6065 Default %printer and %destructor for mid-rule values): Update.
6066 * tests/input.at (Default %printer and %destructor redeclared,
6067 Unused values with default %destructor): Update.
6068
26b8a438
JD
60692006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6070
6071 Don't let %prec take a nonterminal.
6072 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6073 token.
6074 * tests/input.at (%prec takes a token): New test checking that %prec
6075 won't take a nonterminal.
6076
07c39ae9
JD
60772006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6078
405d53b7
JD
6079 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6080 it was double-quoted.
07c39ae9
JD
6081 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6082 grammar is maintained with Bison's highest standards.
6083 * src/getargs.c: Fix some typos in Doxygen comments.
6084
580b8926
JD
60852006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6086
6087 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6088 later. Reported by Paul Eggert in
6089 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6090 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6091 * src/scan-code.l (translate_action): Don't bother invoking
6092 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6093 (code_scanner_free): Instead of invoking
6094 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6095 which frees more.
6096 * src/scan-gram.l (gram_scanner_free): Likewise.
6097 * src/scan-skel.l (scan_skel): Likewise.
6098
4502eadc
JD
60992006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6100
6101 * src/files.c (tr): Change return type to void.
6102 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6103 has been called previously for the same key.
6104 (muscle_find): Return storage instead of value so that
6105 --enable-gcc-warnings doesn't produce warnings that the return discards
6106 const. aver that the value and storage are the same since storage
6107 could potentially be NULL when value is not.
6108 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6109 same as 0.
6110
7746c8f6
PE
61112006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6112
6113 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6114 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6115 us a slightly cleaner distribution, and also works.
6116 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6117 gnulib changes.
6118
eb095650
PE
61192006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6120 and Paul Eggert <eggert@cs.ucla.edu>
6121
6122 Don't let Bison leak memory except when it complains.
6123 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6124 (spec_defines_file, dir_prefix): Now char *, not const char *,
6125 since they are freed.
6126 * src/files.c: Likewise.
6127 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6128 Likewise.
6129 (tr): Now operates in-place. All uses changed.
6130 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6131 values.
6132 (compute_file_name_parts, compute_output_file_names): Don't store
6133 read-only data in variables that will be freed.
6134 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6135 src_extension, and header_extension.
6136 (output_file_names_free): New public function to free
6137 spec_verbose_file, spec_graph_file, spec_defines_file,
6138 parser_file_name, and dir_prefix.
6139 * src/getargs.c (getargs): Don't store read-only data in variables that
6140 will be freed.
6141 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6142 (which previously existed but was unused), and quotearg_free.
6143 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6144 * src/muscle_tab.c: Likewise.
6145 (muscle_entry): Make the value char const *,
6146 and add a new storage member that is char * and can be freed.
6147 (muscle_entry_free): New private function.
6148 (muscle_init): Use it instead of free.
6149 (muscle_insert, muscle_grow): Update and use new storage member.
6150 (muscle_code_grow): Free the string passed to muscle_grow
6151 since it's not needed anymore.
6152 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6153 add a new `char *code' member.
6154 ("{...}"): Declare semantic type as code.
6155 * src/scan-code.h (translate_rule_action):
6156 (translate_symbol_action, translate_code, translate_action): Return
6157 `char const *' rather than `char *' since external code should not free
6158 these strings.
6159 * src/scan-code.l: Likewise.
6160 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6161 which is "{...}" in the parser.
6162 * tests/Makefile.am (maintainer-check-valgrind): Set
6163 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6164 Valgrind.
6165 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6166 complain.
6167 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6168 expecting a non-zero exit status sets --leak-check=summary and
6169 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6170 this case, and we don't want to hear about it.
6171
ac564be4
PE
61722006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6173
6174 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6175 instead of from the template, to simplify configuration a bit.
6176 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6177 and m4/wint_t.m4, as they are needed with the latest gnulib.
6178
17bd8a73
JD
61792006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6180
6181 Disable unset/unused mid-rule value warnings by default, and recognize
6182 --warnings=midrule-values to enable them. Discussed starting at
6183 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6184 * NEWS (2.3a+): Mention.
6185 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6186 warnings): Add entry for midrule-values subargument.
6187 * src/reader.c (symbol_should_be_used): Don't return true just because
6188 the value is a set/used mid-rule value unless
6189 --warnings=midrule-values was specified.
6190 * tests/input.at (Unused values, Unused values before symbol
6191 declarations): Run tests with and without --warnings=midrule-values.
6192
6193 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6194 than LIST_FREE directly.
6195
89eb3c76
JD
61962006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6197
6198 Finish implementing --warnings=error, which should not be implied by
6199 --warnings=all (or by its synonyms -W and --warnings without
6200 subarguments).
6201 * src/complain.c (set_warning_issued): New function to report that
6202 warnings are being treated as errors and to record an error if so.
6203 Invoke...
6204 (warn_at, warn): ... here.
6205 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6206 "error - warnings are errors" does not appear above "all - all of the
6207 above".
6208 (getargs): For -W and --warnings without subarguments, don't let
6209 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6210 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6211
ba7560e2
JD
62122006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6213
6214 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6215 empty subargument list. For example: `bison --warnings= parser.y'.
6216
31283fc3
JD
62172006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6218
6219 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6220 the parser header file so that gcc doesn't warn.
6221
12e35840
JD
62222006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6223
6224 Split the default %destructor/%printer into two kinds: <*> and <!>.
6225 Discussed starting at
6226 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6227 * NEWS (2.3a+): Mention.
6228 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6229 previous change today related to mid-rules.
148d66d8 6230 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6231 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6232 (TYPE_TAG_ANY): Add as <*>.
6233 (TYPE_TAG_NONE): Add as <!>.
6234 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6235 for <*> and <!>.
6236 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6237 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6238 * src/symlist.c (symbol_list_default_new): Split into tagged and
6239 tagless versions.
6240 (symbol_list_destructor_set, symbol_list_printer_set): Split
6241 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6242 SYMLIST_DEFAULT_TAGLESS.
6243 * src/symlist.h: Update symbol_list_default*_new prototypes.
6244 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6245 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6246 * src/symtab.c (default_destructor, default_destructor_location,
6247 default_printer, default_printer_location): Split each into tagged and
6248 tagless versions.
6249 (symbol_destructor_get, symbol_destructor_location_get,
6250 symbol_printer_get, symbol_printer_location_get): Implement tagged
6251 default and tagless default cases.
6252 (default_destructor_set, default_printer_set): Split each into tagged
6253 and tagless versions.
6254 * src/symtab.h: Update prototypes.
6255 * tests/actions.at (Default %printer and %destructor): Rename to...
6256 (Default tagless %printer and %destructor): ... this, and extend.
6257 (Per-type %printer and %destructor): Rename to...
6258 (Default tagged and per-type %printer and %destructor): ... this, and
6259 extend.
6260 (Default %printer and %destructor for user-defined end token): Extend.
6261 (Default %printer and %destructor are not for error or $undefined):
6262 Update.
6263 (Default %printer and %destructor are not for $accept): Update.
6264 (Default %printer and %destructor for mid-rule values): Extend.
6265 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6266 (Unused values with default %destructor): Extend.
6267
f91b1629
JD
62682006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6269
6270 Don't apply the default %destructor/%printer to an unreferenced midrule
6271 value. Mentioned at
6272 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6273 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6274 like $@n instead of just @n so that the default %destructor/%printer
6275 logic doesn't see them as user-defined symbols.
6276 (symbol_is_dummy): Check for both forms of the name.
6277 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6278 name for which the midrule value is referenced in any action.
6279 * tests/actions.at (Default %printer and %destructor for mid-rule
6280 values): New test.
6281 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6282 for change to dummy symbol names.
6283
519d0004
JD
62842006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6285
6286 Warn about unset midrule $$ if the corresponding $n is used.
6287 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6288 $n usage.
6289 (packgram): Before invoking grammar_rule_check on any rule, make sure
6290 all actions have already been scanned in order to set `used' flags.
6291 Otherwise, checking that a midrule's $$ is set will not always work
6292 properly because the midrule check must forward-reference the midrule's
6293 parent rule.
6294 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6295 warning.
6296
a501eca9
JD
62972006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6298
6299 More improvements to the documentation of the prologue alternatives:
6300 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6301 Bison manual.
6302 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6303 some text to clarify the relative importance of the new directives and
6304 to show how these directives may be viewed as code labels.
6305
2cbe6b7f
JD
63062006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6307
6308 Similar to the recently removed %before-header, add %code-top as the
6309 alternative to the pre-prologue. Mentioned at
6310 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6311 Also, let the prologue alternatives appear in the grammar section.
6312 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6313 (prologue_declaration): Move the existing prologue alternatives to...
6314 (grammar_declaration): ... here and add %code-top.
6315 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6316
6317 Clean up and extend documentation for the prologue alternatives.
6318 * NEWS (2.3a+): Describe prologue alternatives.
6319 * doc/bison.texinfo (Prologue): Move discussion of prologue
6320 alternatives to...
6321 (Prologue Alternatives): ... this new section, and extend it to discuss
6322 all 4 directives in detail.
148d66d8
JD
6323 (Table of Symbols): Clean up discussion of prologue alternatives and
6324 add %code-top.
2cbe6b7f 6325
e557d3ea
JMG
63262006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6327
6328 DJGPP specific issues.
6329
6330 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6331 config.bat accordingly.
6332 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6333 * djgpp/config.site: Likewise.
6334
136a0f76
PB
63352006-10-16 Paolo Bonzini <bonzini@gnu.org>
6336
27bd5d67
PB
6337 Replace %*-header with %provides, %requires, %code. See discussion at
6338 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6339
136a0f76
PB
6340 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6341 (b4_user_start_header): Remove.
6342 * data/glr.c: Use new macros instead of b4_*start_header
6343 and b4_*end_header.
6344 * data/glr.cc: Likewise.
6345 * data/lalr1.cc: Likewise.
6346 * data/push.c: Likewise.
6347 * data/yacc.c: Likewise.
6348
6349 * doc/bison.texinfo: Remove %before-header, rename
6350 %{start,end,after}-header to %requires, %provides, %code.
6351
6352 * src/parse-gram.y: Likewise (also rename token names accordingly).
6353 * src/scan-gram.l: Likewise.
6354 * tests/actions.at: Likewise.
6355
10f429ef
PE
63562006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6357
6358 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6359 Problem reported by Joel E. Denny.
6360
63612006-10-14 Jim Meyering <jim@meyering.net>
6362
6363 (Sync from coreutils.)
6364 Work also when the working directory (with e.g. coreutils sources)
6365 is version controlled with git, rather than CVS.
6366 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6367 rather than CVS.
6368 In messages and comments, say e.g., "checked-out sources",
6369 rather than "CVS sources".
6370 (version_controlled_file): New function. Work for git as well as
6371 for CVS. Don't use grep's -q option.
6372 (slurp): Call it here, in place of CVS-specific code.
6373
c4bd5bf7
JD
63742006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6375
6376 Fix testsuite for ./configure --enable-gcc-warnings:
6377 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6378 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6379 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6380 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6381 * test/regression.at (Diagnostic that expects two alternatives):
6382 Likewise.
6383
46356ea4
PE
63842006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6385
231ed89a
PE
6386 * bootstrap.conf (gnulib_modules): Add config-h.
6387 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6388 worry about HAVE_CONFIG_H.
6389 * lib/abitset.c: Likewise.
6390 * lib/bitset.c: Likewise.
6391 * lib/bitset_stats.c: Likewise.
6392 * lib/bitsetv-print.c: Likewise.
6393 * lib/bitsetv.c: Likewise.
6394 * lib/ebitset.c: Likewise.
6395 * lib/get-errno.c: Likewise.
6396 * lib/lbitset.c: Likewise.
6397 * lib/subpipe.c: Likewise.
6398 * lib/timevar.c: Likewise.
6399 * lib/vbitset.c: Likewise.
6400 * lib/bitset.c: Include "bitset.h" first, to test interface.
6401 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6402 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6403 * lib/bitsetv.c: Include "bitsetv.h" first.
6404 * lib/get-errno.c: Include "get-errno.h" first.
6405 * m4/.cvsignore: Add config-h.m4.
6406 * tests/actions.at (Default %printer and %destructor for ...):
6407 Adjust expected line numbers in output to reflect removal of #if
6408 HAVE_CONFIG_H lines.
6409 * tests/glr-regression.at (Missed %merge type warnings when ...):
6410 Likewise.
6411 * tests/regression.at (Braced code in declaration in rules section):
6412 Likewise.
6413 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6414 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6415 Include <config.h> unconditionally.
6416
46356ea4
PE
6417 * bootstrap: Sync from coreutils, as follows:
6418
6419 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6420
6421 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6422 variable was sometimes used without being initialized. This
6423 messed up the installation of the INSTALL file in some cases.
6424
6425 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6426
6427 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6428 --copy. Inspired by a suggestion from Bruno Haible.
6429
6430 2006-10-03 Jim Meyering <jim@meyering.net>
6431
6432 * bootstrap: Undo last change to this file, since now gnulib-tool
6433 sticks with the automake default in generating dependencies.
6434
dd4bf078
PE
64352006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6436
cf2a5f7c
PE
6437 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6438 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6439
6440 * doc/bison.1: Add copyright notice.
6441
6442 * data/glr.c: Don't include <stdarg.h>; not used.
6443
35fe0834
PE
6444 * NEWS: The -g and --graph options now output graphs in Graphviz
6445 DOT format, not VCG format.
6446 * doc/bison.1: Likewise.
6447 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
6448 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6449 of this change in
6450 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
6451 * TODO: Remove Graphviz entry.
6452 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6453 remove vcg.c, vcg.h, vcg_defaults.h.
6454 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6455 * src/graphviz.c, src/graphviz.h: New files.
6456 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6457 * src/files.h: Make comment more generic.
6458 * src/main.c (main): Likewise.
6459 * src/print_graph.h: Likewise.
6460 * src/getargs.c (usage): Make usage description more generic.
6461 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6462 (static_graph, fgraph): Remove. All uses changed to pass
6463 arguments instead of sharing a static var.
6464 (print_core, print_actions, print_state, print_graph):
6465 Output graphviz format rather than VCG format.
6466 * tests/.cvsignore: Remove *.vcg; add *.dot.
6467 * tests/output.at: Expect *.dot files, not *.vcg files.
6468
dd4bf078
PE
6469 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6470 accommodates the 2006-10-08 change.
6471
efdd7421
PE
64722006-10-11 Bob Rossi <bob@brasko.net>
6473
6474 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6475 (b4_yyssa, b4_yyerror_range): New macros.
6476 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6477 (yypvarsinit): Remove init of removed fields.
6478 (yypushparse): Remove use of removed fields; use new macros instead.
6479
96a1981a
PE
64802006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6481
6482 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6483 in a push parser. Reindent slightly to match yacc.c better.
6484
64852006-10-11 Bob Rossi <bob@brasko.net>
6486
46356ea4
PE
6487 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6488 yymsg_alloc fields.
6489 (yypvarsinit, yypushparse): Remove init of removed fields.
6490 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 6491
c1630a8b
PE
64922006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6493
6494 * THANKS: Add Paolo Bonzini and Bob Rossi.
6495
90b9908d
PB
64962006-10-08 Paolo Bonzini <bonzini@gnu.org>
6497
6498 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6499 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6500 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6501 b4_define_user_cde and uses): Remove.
6502 (b4_comment, b4_prefix, b4_sync_start): New.
6503 * data/bison.m4: New file, with most of the content removed from c.m4.
6504 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6505 * src/output.c (output_skeleton): Pass bison.m4.
6506 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6507 only if specified.
6508
cf806753
PE
65092006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6510
6511 Fix test failure reported by Tom Lane in
6512 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6513 and try to make such failures easier to catch in the future.
6514 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6515 that's now the caller's responsibility.
6516 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6517 Set yychar = YYEOF if it's negative.
6518 * tests/actions.at (yylex): Abort if asked to read past EOF.
6519 * tests/conflicts.at (yylex): Likewise.
6520 * tests/cxx-type.at (yylex): Likewise.
6521 * tests/glr-regression.at (yylex): Likewise.
6522 * tests/input.at (yylex): Likewise.
6523 * tests/regression.at (yylex): Likewise.
6524 * tests/torture.at (yylex): Likewise.
6525
0e2f006a
PE
65262006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6527
6528 Fix problems with translating English-language diagnostics.
6529 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6530 respect to bison-runtime pot generation. The YY_ stuff
6531 wasn't being captured.
6532 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6533 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6534 * runtime-po/POTFILES.in: Add data/push.c.
6535
e3ddc1e3
PE
65362006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6537
6538 Merge bootstrap changes from coreutils.
6539
6540 2006-09-28 Jim Meyering <jim@meyering.net>
6541
6542 Automatically generated dependencies are important even
6543 when all of the sources in a directory come from gnulib.
6544 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6545 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6546
6547 2006-09-23 Jim Meyering <jim@meyering.net>
6548
6549 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6550
6551 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6552
6553 * bootstrap: Add support for --force.
6554 (usage): New function. Describe usage less tersely.
6555 (CVS_only_file): New var.
6556
01e972b3
PE
65572006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6558
6559 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6560 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6561 Adjust white space and comments to match GNU style better.
6562
c63d3e90
PE
65632006-09-20 Bob Rossi <bob@brasko.net>
6564
6565 * data/push.c (yyresult_get): Remove function.
6566 (YYPUSH_MORE): Add #define.
6567 (yypushparse): Modify return value.
6568
e70f46d1
PE
65692006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6570
6571 * stamp-h.in: Remove; no longer needed.
6572 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6573 Remove config.h, config.hin, intl (no longer created).
6574 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6575 stamp-h1.
6576
6577 Sync bootstrap from coreutils, as follows:
6578
6579 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6580
6581 * bootstrap (symlink_to_gnulib): New function.
6582 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6583 to copies-of-gnulib.
6584 (cp_mark_as_generated, slurp, gnulib_files):
6585 Avoid making a copy if it's the same as the old version.
6586 (gnulib_files): Add support for this variable (used by Bison).
6587
a92be413
PE
65882006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6589
6590 * src/getargs.c (usage): Rework to use conventions similar to
6591 coreutils, to make translation a bit easier and the code a bit
6592 smaller. Problem reported by Tim Van Holder.
6593
4f82b42a
PE
65942006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6595
3b2942e6
PE
6596 Use some of gnulib's new modules, taken from coreutils.
6597
6598 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6599 * bootstrap.conf: New file.
6600 (gnulib_modules): Add configmake, inttypes, unistd.
6601 (XGETTEXT_OPTIONS): Add complain, complain_at,
6602 fatal, fatal_at, warn, warn_at, unexpected_end.
6603 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6604 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6605 (gl_EARLY): Add.
6606 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6607 (gl_INIT): Add
6608 (GNULIB_AUTOCONF_SNIPPET): Remove.
6609 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6610 the pickiest.
6611 * lib/.cvsignore: Add inttypes_.h.
6612 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6613 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6614 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6615 no-longer-necessary initializations.
6616 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6617 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6618 use the unistd module.
6619 * src/system.h: Likewise.
6620 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6621 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6622 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6623 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6624 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6625 * src/system.h: Include inttypes.h unconditionally, now that we
6626 use the inttypes module. Don't bother to include stdint.h, since
6627 inttypes.h now does that for us.
6628 (LOCALEDIR): Remove, now that we use the configmake module.
6629 * src/getargs.c: Include configmake.h.
6630 * src/main.c: Likewise.
6631 * src/output.c: Likewise.
6632 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6633 not from $abs_top_builddir, since config.h moved.
6634
6635
4f82b42a
PE
6636 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6637 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6638
6639 * src/parse-gram.y (symbol_declaration): Don't put statements
6640 before declarations; it's not portable to C89.
6641 * src/scan-code.l (handle_action_at): Likewise.
6642
6643 * src/scan-code.l: Always initialize braces_level; the old code
6644 left it uninitialized and therefore had undefined behavior.
6645
6646 Don't attempt to redefine 'assert', since it runs afoul of
6647 systems where standard headers (mistakenly) include <assert.h>.
6648 Instead, define and use our own alternative, called 'aver'.
6649 * src/reader.c: Don't include assert.h, since we no longer
6650 use assert.
6651 * src/scan-code.l: Likewise.
6652 * src/system.h (assert): Remove, replacing with....
6653 (aver): New function, taking a bool arg. All uses changed.
6654 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6655 not merely an integer.
6656
31c10e38
PE
66572006-09-15 Bob Rossi <bob@brasko.net>
6658
6659 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6660 * data/c.m4 (YYPUSH): New.
6661 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6662 * src/getargs.c (push_parser): New var.
6663 * src/getargs.h (push_parser): New declaration.
6664 * src/output.c (prepare): Add macro insertion of `push_flag'.
6665 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6666 (prologue_declaration): Parse %push-parser.
6667 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6668 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6669 list of removed lines from the traces observed.
6670 (AT_CHECK_CALC_LALR): Added push parser tests.
6671
fa7b79c0
PE
66722006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6673
21fe08ca
PE
6674 * NEWS: Version 2.3a.
6675 * configure.ac (AC_INIT): Likewise.
6676
e8ec4d9b
PE
6677 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6678 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6679 due to header ordering dependencies. I don't know why the #define
6680 was there.
6681
fa7b79c0
PE
6682 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6683 runtime cost when YYDEBUG is not defined, and so that some tests
6684 that used to fail now work. Problem and initial suggestion by
6685 Paolo Bonzini.
6686 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6687 * data/glr.cc (b4_parser_class_name):
6688 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6689 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6690 (yydebug_) [YYDEBUG]: New member.
6691 (yycdebug_): Now defined only if YYDEBUG.
6692 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6693 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6694 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6695 if YYYDEBUG.
6696 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6697 Define only if YYDEBUG.
6698 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6699 set_debug_level.
6700 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6701 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6702 AT_CHECK_CALC_GLR_CC that are working now.
6703
4ec13d60
PE
67042006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6707 We don't need them in glr.cc, and glr.c defines them.
6708 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6709 assumes that defining it to anything is the same as defining
6710 it to 1. Problem reported by Paolo Bonzini.
6711
8e1687ae
PE
67122006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6713
6714 * data/c.m4 (b4_null, b4_case): Define.
6715 * src/output.c (prepare_symbols): Use b4_null.
6716 (user_actions_output): Use b4_case.
6717
3dc5e96b
PE
67182006-09-11 Paul Eggert <eggert@cs.ucla.edu>
6719
aef3da86
PE
6720 * data/glr.c (b4_shared_declarations): Put start-header first,
6721 before any #includes that we generate, so that feature-test
6722 macros work. Problem reported by Michael Deutschmann in
6723 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
6724 * data/lalr1.cc: Likewise.
6725 * doc/bison.texinfo (Prologue): Document that feature-test macros
6726 should be defined before any Bison declarations.
6727 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
6728 that depend on location.hh after, not before, Bison decls, since
6729 we now include location.hh after the first user prologue.
6730
3dc5e96b
PE
6731 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
6732 Sander Brandenburg in
6733 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
6734 Also, fix minor white space and comment issues.
aef3da86
PE
6735 (Prologue): Mention that it's better to define feature-test macros
6736 before Bison declarations. Problem reported by Michael Deutschmann.
6737
6738 * README-cvs: Fix typo: "&" should be "&&". Problem reported
6739 by Jim Meyering.
6740 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
6741 This adjusts to recent gnulib changes.
3dc5e96b 6742
b2a0b7ca
JD
67432006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6744
6745 Finish implementation of per-type %destructor/%printer. Discussed
6746 starting at
6747 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
6748 and
6749 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
6750 * NEWS (2.3+): Add a description of this feature to the default
6751 %destructor/%printer description.
6752 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
6753 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6754 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
6755 list node contains a semantic type.
6756 * src/symtab.c, src/symtab.h: Extend with a table that associates
6757 semantic types with their %destructor's and %printer's.
6758 (semantic_type_from_uniqstr, semantic_type_get,
6759 semantic_type_destructor_set, semantic_type_printer_set): New functions
6760 composing the public interface of that table.
6761 (symbol_destructor_get, symbol_destructor_location_get,
6762 symbol_printer_get, symbol_printer_location_get): If there's no
6763 per-symbol %destructor/%printer, look up the per-type before trying
6764 the default.
6765 * tests/actions.at (Per-type %printer and %destructor): New test case.
6766 * tests/input.at (Default %printer and %destructor redeclared):
6767 Extend to check that multiple occurrences of %symbol-default in a
6768 single %destructor/%printer declaration is an error.
6769 (Per-type %printer and %destructor redeclared, Unused values with
6770 per-type %destructor): New test cases.
6771
3be03b13
JD
67722006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
6773
6774 Require default %destructor/%printer to be declared using
6775 %symbol-default instead of an empty symbol list, and start working on
6776 new per-type %destructor/%printer. Discussed at
6777 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
6778 * NEWS (2.3+): Add %symbol-default to example.
6779 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 6780 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
6781 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
6782 (generic_symlist, generic_symlist_item): New nonterminals for creating
6783 a list in which each item is a symbol, semantic type, or
6784 %symbol-default.
6785 (grammar_declaration): Use generic_symlist in %destructor and %printer
6786 declarations instead of symbols.1 or an empty list.
6787 (symbol_declaration, precedence_declaration, symbols.1): Update actions
6788 for changes to symbol_list.
6789 * src/reader.c: Update for changes to symbol_list.
6790 * src/scan-code.l: Likewise.
6791 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
6792 * src/symlist.c, src/symlist.h: Extend such that a list node may
6793 represent a semantic type or a %symbol-default in addition to just an
6794 ordinary symbol. Add switched functions for setting %destructor's and
6795 %printer's.
6796 * tests/actions.at, tests/input.at: Add %symbol-default to all default
6797 %destructor/%printer declarations.
6798
3508ce36
JD
67992006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
6800
6801 Whether the default %destructor/%printer applies to a particular symbol
6802 isn't a question of whether the user *declares* that symbol (in %token,
6803 for example). It's a question of whether the user by any means
6804 *defines* the symbol at all (by simply using a char token, for
6805 example). $end is defined by Bison whereas any other token with token
6806 number 0 is defined by the user. The error token is always defined by
6807 Bison regardless of whether the user declares it with %token, but we
6808 may one day let the user define error as a nonterminal instead.
6809 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
6810 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
6811 the meaning of "user-defined".
6812 * tests/actions.at (Default %printer and %destructor for user-declared
6813 end token): Rename to...
6814 (Default %printer and %destructor for user-defined end token): ...
6815 this.
6816
6817 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
6818 computation of whether to apply the default, don't maintain a list of
6819 every Bison-defined symbol. Instead, just check for a first character
6820 of '$', which a user symbol cannot have, and check for the error token.
6821
9350499c
JD
68222006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
6823
6824 Don't apply the default %destructor or %printer to the error token,
6825 $undefined, or $accept. This change fits the general rule that the
6826 default %destructor and %printer are only for user-declared symbols,
6827 and it solves several difficulties that are described in the new test
6828 cases listed below.
6829 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
6830 * tests/actions.at (Default %printer and %destructor are not for error
6831 or $undefined, Default %printer and %destructor are not for $accept):
6832 New test cases.
6833
4d7370cb
JD
68342006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
6835
6836 Allow %start after the first rule.
6837 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
6838 when parsing the first rule.
6839 (check_and_convert_grammar): Search for it here after all grammar
6840 declarations have been parsed. Skip midrules, which have dummy LHS
6841 nonterminals.
6842 * src/symtab.c (symbol_is_dummy): New function.
6843 * src/symtab.h (symbol_is_dummy): Declare it.
6844 * tests/input.at (%start after first rule): New test.
6845
6d0ef4ec
JD
68462006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6847
6848 Redo some of the previous commit: add back the ability to use
6849 non-aliased/undeclared string literals since it might be useful to
6850 those declaring %token-table.
6851 * src/reader.c (check_and_convert_grammar): Undo changes in previous
6852 commit: don't worry about complaints from symbols_pack.
6853 * src/symtab.c (symbol_new, symbol_class_set,
6854 symbol_check_alias_consistency): Undo changes in previous commit: count
6855 each string literal as a new symbol and token, assign it a symbol
6856 number, and don't complain about non-aliased string literals.
6857 (symbols_pack): Since symbol_make_alias still does not decrement symbol
6858 and token counts but does still set aliased tokens to the same number,
6859 symbol_pack_processor now leaves empty slots in the symbols array.
6860 Remove those slots.
6861 * tests/regression.at (Undeclared string literal): Remove test case
6862 added in previous commit since non-aliased string literals are allowed
6863 again.
6864 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
6865 remove unnecessary string literal declarations.
6866 * tests/sets.at (Firsts): Likewise.
6867
965537bc
JD
68682006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
6869
6870 Don't allow an undeclared string literal, but allow a string literal to
6871 be used before its declaration.
6872 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
6873 symbols_pack complained.
6874 * src/symtab.c (symbol_new): Don't count a string literal as a new
6875 symbol.
6876 (symbol_class_set): Don't count a string literal as a new token, and
6877 don't assign it a symbol number since symbol_make_alias does that.
6878 (symbol_make_alias): It's not necessary to decrement the symbol and
6879 token counts anymore. Don't assume that an alias declaration occurs
6880 before any uses of the identifier or string, and thus don't assert that
6881 one of them has the highest symbol number so far.
6882 (symbol_check_alias_consistency): Complain if there's a string literal
6883 that wasn't declared as an alias.
6884 (symbols_pack): Bail if symbol_check_alias_consistency failed since
6885 symbol_pack asserts that every token has been assigned a symbol number
6886 although undeclared string literals have not.
6887 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 6888 string literal): New test cases.
965537bc
JD
6889 (Characters Escapes, Web2c Actions): Declare string literals as
6890 aliases.
6891 * tests/sets.at (Firsts): Likewise.
6892
47aee066
JD
68932006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
6894
6895 In the grammar scanner, STRING_FINISH unclosed constructs and return
6896 them to the parser in order to improve error messages.
6897 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
6898 SC_BRACED_CODE, SC_PROLOGUE): Implement.
6899 * tests/input.at (Unclosed constructs): New test case.
6900 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
6901 seen.
6902
6903 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
6904 unused global.
6905
1f6b3679
JD
69062006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
6907
6908 Handle string aliases for character tokens correctly.
6909 * src/symtab.c (symbol_user_token_number_set): If the token has an
6910 alias, check and set its alias's user token number instead of its own,
6911 which is set to indicate the alias. Previously, every occurrence of
6912 the character token in the grammar overwrote that alias indicator with
6913 the character code.
6914 * tests/input.at (String aliases for character tokens): New test.
6915
219741d8
JD
69162006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
6917
6918 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
6919
11daa4e7
PE
69202006-08-11 Paul Eggert <eggert@cs.ucla.edu>
6921
6922 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
6923 to prevent failures when building on older platforms.
6924 Check for autopoint failure.
6925 Set XGETTEXT_OPTIONS to values that check for C format strings,
6926 so that translators are warned about them (this also helps
6927 prevent core dumps).
6928
6929 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
6930 function, since it simplifies our code a bit.
6931
6932 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
6933 rather than -W, so we don't get bogus warnings about sign comparisons.
6934 Add -Wpointer-arith, since that warning is useful (it reports code
6935 that does not conform to C89 and that some compilers reject).
6936 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
6937 since it's no longer needed.
6938
f9bfc42a
JD
69392006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
6940
6941 Clean up scanners a bit.
6942 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
6943 definitions so gcc won't warn when obstack_for_string is unused.
6944 * src/scan-code.l: config.h and system.h are already #include'd by
6945 scan-code-c.c, so get rid of them here.
6946 * src/scan-gram.l: Likewise.
6947 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
6948 definitions rather than duplicating the rest of it.
6949 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
6950
06e8700a
JD
69512006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
6952
6953 Suppress signed/unsigned comparison warnings for yycheck.
6954 * data/c.m4 (b4_safest_int_type): New macro.
6955 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
6956 a signed int type, cast it to b4_safest_int_type first.
6957 * data/yacc.c: Likewise.
6958 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
6959 also overwritten.
6960
9c437126
PE
69612006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
6962
6963 * doc/bison.texinfo: Fix some typos.
6964
284d8a13
PE
69652006-08-02 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
6968 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
6969
6970 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
6971 the latest gnulib does this a different way.
6972 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
6973 translation was patched, so stop omitting it.
6974
ec5479ce
JD
69752006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
6976
6977 Enable declaration of default %printer/%destructor. Make the parser
6978 use these for all user-declared grammar symbols for which the user does
6979 not declare a specific %printer/%destructor. Thus, the parser uses it
6980 for token 0 if the user declares it but not if Bison generates it as
6981 $end. Discussed starting at
6982 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
6983 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
6984 and
6985 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
6986 * NEWS (2.3+): Mention.
6987 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
6988 declare a %destructor for a mid-rule's semantic value. It's just
6989 impossible to declare one specific to it.
6990 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
6991 code. Describe default %destructor form.
6992 * src/parse-gram.y (grammar_declaration): Parse default
6993 %printer/%destructor declarations.
6994 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
6995 and symbol_destructor_location_get rather than accessing the destructor
6996 and destructor_location members of struct symbol.
6997 (symbol_printers_output): Likewise but for %printer's.
6998 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
6999 again.
7000 * src/symtab.c (default_destructor, default_destructor_location,
7001 default_printer, default_printer_location): New static global
7002 variables to record the default %destructor and %printer.
7003 (symbol_destructor_get, symbol_destructor_location_get,
7004 symbol_printer_get, symbol_printer_location_get): New functions to
7005 compute the appropriate %destructor and %printer for a symbol.
7006 (default_destructor_set, default_printer_set): New functions to set the
7007 default %destructor and %printer.
7008 * src/symtab.h: Prototype all those new functions.
7009 * tests/actions.at (Default %printer and %destructor): New test to
7010 check that the right %printer and %destructor are called, that they're
7011 not called for $end, and that $$ and @$ work correctly.
7012 (Default %printer and %destructor for user-declared end token): New
7013 test to check that the default %printer and %destructor are called for
7014 a user-declared end token.
7015 * tests/input.at (Default %printer and %destructor redeclared, Unused
7016 values with default %destructor): New tests to check related grammar
7017 warnings and errors.
7018
868d2d96
JD
70192006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7020
7021 Clean up handling of %destructor for the end token (token 0).
7022 Discussed starting at
7023 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7024 and
7025 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7026
7027 Make the skeletons consistent in how they pop the end token and invoke
7028 its %destructor.
7029 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7030 state, which has token number 0, since this would invoke the
7031 %destructor for the end token.
7032 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7033 until after shifting the end token, or else it won't be popped.
7034 * data/yacc.c (yyparse): Likewise.
7035
7036 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7037 it's the end token. Upon termination, destroy an unshifted lookahead
7038 even when it's the end token.
7039 * data/lalr1.cc (yy::parser::parse): Likewise.
7040 * data/yacc.c (yyparse): Likewise.
7041
7042 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7043 value warnings for the end token when the user gives the end token a
7044 %destructor.
7045
7046 * tests/actions.at (Printers and Destructors): Test all the above.
7047
62a9592d
PE
70482006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7049
7050 Update to latest gnulib and gettext versions.
7051 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7052 Add fopen-safer.
7053 (gnulib_files): Add m4/warning.m4. Don't worry about files
7054 overwritten by autopoint.
7055 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7056 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7057 rejects them.
7058 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7059 so that we can remove the intl files at a better time.
7060 (intl_files_to_remove): Remove aclocal.m4, since it gets
7061 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7062 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7063 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7064 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7065 Remove datarootdir hack; no longer needed.
7066 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7067 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7068 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7069 strdup.h.
7070 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7071 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7072
10d6970f
PE
70732006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7074
7075 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7076 it with --assume-autoconf='latest-stable'.
7077
50a33993
JD
70782006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7079
7080 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7081 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7082 YYSTYPE' and `{'.
7083 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7084 those from muscle_tab.c since the old ones are misleading.
7085
2ce4ed68
AD
70862006-07-13 Akim Demaille <akim@epita.fr>
7087
7088 Support %define "KEY" {VALUE}.
7089 * src/scan-code.h, src/scan-code.l (translate_action)
7090 (translate_rule_action, translate_symbol_action, translate_code):
7091 Return char *, not const char *.
7092 * src/parse-gram.y (declaration): Rename as...
7093 (prologue_declaration): this.
7094 (string_content): Remove this nonterminal, use STRING.
7095 (braceless, content, content.opt): New nonterminal.
7096 Use them.
7097 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7098 as value.
7099 * src/scan-gram.l (getargs.h): Don't include it.
7100
db7e5eb5
PE
71012006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7102
7103 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7104 rather than a for-loop that declares a local bool variable. This
7105 should work around a compatibility problem with a Cray x1e C++
7106 compiler reported by Hung Nguyen in
7107 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7108 The for-loop was introduced in the 2004-11-17 change but I don't
7109 know why it was needed.
7110
a5d80ba5
AD
71112006-07-12 Akim Demaille <akim@epita.fr>
7112
7113 * data/c.m4: Comment changes.
7114
23eb2a69
AD
71152006-07-10 Akim Demaille <akim@lrde.epita.fr>
7116
7117 * src/complain.c (error_message, ERROR_MESSAGE): New.
7118 To factor...
7119 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7120 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7121
ddc8ede1
PE
71222006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7123
7124 * NEWS: Instead of %union, you can define and use your own union type
7125 YYSTYPE if your grammar contains at least one <type> tag.
7126 Your YYSTYPE need not be a macro; it can be a typedef.
7127 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7128 (Union Decl, Decl Summary): Document this.
7129 * data/glr.c (YYSTYPE): Implement this.
7130 * data/glr.cc (YYSTYPE): Likewise.
7131 * data/lalr1.cc (YYSTYPE): Likewise.
7132 * data/yacc.c (YYSTYPE): Likewise.
7133 * src/output.c (prepare): Output tag_seen_flag.
7134 * src/parse-gram.y (declaration, grammar_declaration):
7135 Use 'union_seen' rather than 'typed' to determine whether
7136 %union has been seen, since grammars can now be typed without
7137 %union.
7138 (symbol_declaration, type.opt, symbol_def):
7139 Keep track of whether a tag has been seen.
7140 * src/reader.c (union_seen, tag_seen): New vars.
7141 (typed): remove.
7142 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7143 * src/scan-code.l (untyped_var_seen): New variable.
7144 (handle_action_dollar): Adjust to above changes.
7145 (handle_action_dollar, handle_action_at):
7146 Improve overflow checking for outlandish numbers.
7147 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7148 avoid new diagnostics generated by above changes.
7149 * tests/regression.at (YYSTYPE typedef): Add test to check
7150 for type tags without %union.
7151
7152 * src/symlist.c (symbol_list_length): Return int, not unsigned
7153 int, since callers expect int. This may need to get revisited
7154 once we have proper integer overflow checking.
7155
7156 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7157 object is now static.
7158
7159 * src/getargs.c (flags_argmatch): Return void, not int,
7160 to pacify ./configure --enable-gcc-warnings.
7161
7162 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7163 since last_string is already defined to FLEX_PREFIX (last_string).
7164
7b42569e
AD
71652006-07-09 Akim Demaille <akim@lrde.epita.fr>
7166
7167 Implement --warnings/-W.
7168 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7169 replaced by...
7170 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7171 Adjust callers.
7172 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7173 (warnings_args, warnings_types): New.
7174 (getargs, short_options, long_options): Accept -W/--warnings.
7175 Sort the options by alphabetical order, upper case letter right
7176 before its lower case.
7177
3b452f4e
JD
71782006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7179
7180 Change %merge result type clash warnings to errors. Discussed at
7181 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7182 * src/reader.c (record_merge_function_type): Use complain_at.
7183 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7184 declared later): Update test case results.
7185
b8a41559
AD
71862006-07-09 Akim Demaille <akim@lrde.epita.fr>
7187
7188 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7189 to be in alphabetical order.
7190 (trace_args): Spelling fixes.
7191
cd9e1ba2
PE
71922006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7193
7194 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7195 so they don't collide with user-defined macros.
7196 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7197 this was never guaranteed, and now that we're using gnulib stdint,
7198 which defines int_fast16_t to long int, the problem is exposed.
7199
cb48f191
PE
72002006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7201
b8445a15
PE
7202 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7203 need the full POSIX semantics (and weren't implementing them
7204 anyway).
7205
cb48f191
PE
7206 Adjust to Autoconf 2.60 and today's gnulib.
7207 * bootstrap (gnulib_modules): Add stdint.
7208 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7209 no longer copies it.
7210 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7211 since stdint needs the former and wcwidth (which is now required
7212 by mbswidth) needs the latter.
7213 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7214 work around a compatibility glitch between gettext 0.14.6 and
7215 Autoconf 2.60.
7216 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7217 Do not check for uintptr_t, since new stdint module does the right
7218 thing.
7219 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7220 Add stdint.h, stdint_.h, wcwidth.h.
7221 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7222 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7223 stdint.m4, wchar_t.m4, wcwidth.m4.
7224 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7225 usual order for ../lib/*.h files.
7226 (file_name_split): Use last_component, not base_name, to adjust
7227 to gnulib changes.
7228 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7229 for ../lib/*.h files.
7230 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7231 Define unconditionally, since we now assume the stdint module.
7232 * src/scan-skel.l: Include <dirname.h>.
7233 (BASE_QPUTS): Use last_component, not base_name.
7234 * src/system.h: Include <unlocked-io.h> in the usual order
7235 for ../lib/*.h files. Include <stdint.h> unconditionally,
7236 since we now use the stdint module.
7237 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7238 HAVE_UINTPTR_T, since we now use the stdint module.
7239 (base_name): Remove decl, since files now include <dirname.h>
7240 to get the decl.
7241
cd48d21d
AD
72422006-07-08 Akim Demaille <akim@lrde.epita.fr>
7243
7244 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7245 New, default to 1.
7246 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7247 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7248 default.
7249 * tests/calc.at: Adjust.
7250
8ec0a172
AD
72512006-07-08 Akim Demaille <akim@lrde.epita.fr>
7252
b8445a15 7253 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7254 (b4_syncline): Also output the location of its invocation (from
7255 the skeleton).
7256 (b4_user_action, b4_define_user_action, b4_user_actions)
7257 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7258 (b4_user_stype): New.
7259 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7260
4a678af8
JD
72612006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7262
7263 In the grammar file, the first column is 1 not 0 on the first line as
7264 on every other line.
7265 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7266 * tests/input.at (Torturing the Scanner): Update output.
7267
7268 * src/scan-gram.l (scanner_cursor): Declare it static.
7269
dd60572a
JD
72702006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7271
7272 In warnings, say "previous declaration" rather than "first
7273 declaration".
7274 * src/symtab.c (redeclaration): Do that here.
7275 * src/reader.c (record_merge_function_type): In the case of a result
7276 type clash, report the previous declaration rather than the very first
7277 one in the grammar file.
7278 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7279 declared later): Add a third declaration to check this behavior.
7280 * tests/input.at (Incompatible Aliases): Update output.
7281
2073e1b6
AD
72822006-06-27 Akim Demaille <akim@epita.fr>
7283
7284 * doc/Doxyfile.in: New.
7285 * doc/Makefile.am: Use it.
7286 * src/lalr.h, src/symtab.h: Initial doxygenation.
7287
8ee5b538
JD
72882006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7289
7290 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7291 declared after the %merge. This continues the effort of the previous
7292 patch.
8ee5b538
JD
7293 * src/reader.c (get_merge_function): Don't set the merger type yet.
7294 (record_merge_function_type): New function for setting the merger type
7295 and checking for clashes.
7296 (grammar_current_rule_merge_set): Set the location of the %merge for
7297 the current rule.
7298 (packgram): Invoke record_merge_function_type for each rule now that
7299 all symbol type declarations have been parsed.
7300 * src/reader.h (merger_list.type_declaration_location): New member
7301 storing the location of the first %merge from which the type for this
7302 merging function was derived.
7303 * src/symlist.h (symbol_list.merger_declaration_location): New member
7304 storing the location of a rule's %merge, if any.
7305 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7306 declared later): New test to catch the error fixed by the above patch.
7307
ffa4ba3a
JD
73082006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7309
7310 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7311 declarations appear after the rules. Discussed at
7312 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7313 and
7314 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7315 Don't mistake the type of $$ in a midrule to be that of its parent
7316 rule's $$.
ffa4ba3a
JD
7317 * src/reader.c (grammar_current_rule_end): Don't invoke
7318 grammar_rule_check yet since not all symbol declarations may have been
7319 parsed yet.
7320 (grammar_midrule_action): Likewise.
7321 Don't record whether the midrule's $$ has been used yet since actions
7322 haven't been translated yet.
7323 Record the midrule's parent rule and its RHS index within the parent
7324 rule.
7325 (grammar_current_rule_action_append): Don't translate the action yet
7326 since not all symbol declarations may have been parsed yet and, thus,
7327 warnings about types for $$, $n, @$, and @n can't be reported yet.
7328 (packgram): Translate the action and invoke grammar_rule_check now that
7329 all symbol declarations have been parsed.
7330 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7331 after parsing the entire grammar file, the symbol list here in the case
7332 of a midrule is actually the midrule's empty RHS, so reference its
7333 parent rule's RHS where necessary.
7334 On the other hand, now that you can already know it's a midrule, you
7335 aren't forced to think $$ has the same type as its parent rule's $$.
7336 (handle_action_at): In the case of a midrule, reference the parent rule
7337 where necessary.
7338 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7339 members.
7340 (symbol_list_length): Now that this is invoked after all rules have
7341 been parsed, a NULL symbol (rather than a NULL symbol list node)
7342 terminates a rule. symbol_list_print already does this correctly.
7343 * src/symlist.h (symbol_list.midrule_parent_rule,
7344 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7345 remember their relationships with their parents.
7346 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7347 fixed by the above patch.
7348 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7349 implementing...
7350 (Unused values): ... this old test case and...
7351 (Unused values before symbol declarations): ... this new test case.
7352 This one is the same as `Unused values' except that all symbol
7353 declarations appear after the rules in order to catch the rest of the
7354 errors fixed by the above patch.
7355
e256e17f
JD
73562006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7357
300a1930
JD
7358 More cleanup.
7359 * src/reader.c (current_rule): Declare it static since it's no longer
7360 used outside this file.
7361 (grammar_current_rule_action_append): Remove redundant arguments from
7362 translate_rule_action invocation.
7363 * src/reader.h (current_rule): Remove this unused extern.
7364 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7365 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 7366
381ecb06
JD
73672006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7368
7369 Clean up yesterday's patch.
7370 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7371 to...
7372 * src/reader.c (grammar_current_rule_action_append): ... here for
7373 consistency with grammar_current_rule_symbol_append.
7374 * tests/regression.at (Braced code in declaration in rules section):
7375 Make yyerror and yylex static as usual.
7376
4210cd0b
JD
73772006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7378
7379 Fix bug that mistakes braced code in a declaration in the rules section
7380 to be a rule action. Mentioned at
7381 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7382 * src/scan-gram.l: Move midrule action detection from the start of the
7383 scanning of any braced code to...
7384 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7385 action. For readability, use $2 and @2 rather than the equivalent
7386 global variables.
7387 * tests/regression.at (Braced code in declaration in rules section):
7388 New test to catch the error fixed by the above patch.
7389
7390 Work on code readability some.
7391 * src/scan-code.l (current_rule): Get rid of this misleading and
7392 redundant declaration: it's actually extern'ed in reader.h.
7393 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7394 translate_action): Add a rule argument and use it instead of the global
7395 current_rule.
7396 (translate_rule_action): This already receives current_rule through an
7397 argument, so pass it on to translate_action instead of assigning
7398 current_rule to current_rule.
7399 (translate_symbol_action, translate_code): Pass rule = NULL to
7400 translate_action.
7401
34f98f46
JD
74022006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7403
7404 Rename %before-definitions to %start-header and %after-definitions to
7405 %end-header. Don't use these declarations to separate pre-prologue
7406 blocks from post-prologue blocks. Add new order-independent
7407 declarations %before-header and %after-header as alternatives to the
7408 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7409 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7410 * NEWS (2.3+): Update for these changes.
7411 * data/glr.c (b4_before_definitions): Update to...
7412 (b4_start_header): ... this.
7413 (b4_after_definitions): Update to...
7414 (b4_end_header): ... this.
7415 * data/glr.cc: Likewise.
7416 * data/lalr1.cc: Likewise.
7417 * data/yacc.c: Likewise.
7418 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7419 prologue blocks with %*-header declarations.
7420 (Calc++ Parser): Likewise.
91661ebb 7421 (Decl Summary): Update names.
148d66d8 7422 (Table of Symbols): Update description.
34f98f46
JD
7423 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7424 (PERCENT_END_HEADER): ... this.
7425 (PERCENT_BEFORE_DEFINITIONS): Update to...
7426 (PERCENT_START_HEADER): ... this.
7427 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7428 (declaration): Update token names and m4 macro names.
7429 When parsing %end-header and %start-header, invoke translate_code
7430 before muscle_code_grow, and no longer set global booleans to remember
7431 whether these declarations have been seen.
7432 Parse new %after-header and %before-header.
7433 * src/reader.c (before_definitions, after_definitions): Remove.
7434 (prologue_augment): Accept a new bool argument to specify whether to
7435 augment the pre-prologue or post-prologue.
7436 * src/reader.h (before_definitions, after_definitions): Remove these
7437 extern's.
7438 (prologue_augment): Add new bool argument.
7439 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7440 (PERCENT_END_HEADER): ... this.
7441 (PERCENT_BEFORE_DEFINITIONS): Update to...
7442 (PERCENT_START_HEADER): ... this.
7443 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7444 * tests/actions.at (Printers and Destructors): Update names.
7445
31b2b07e
JD
74462006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7447
7448 Add comparison operators for C++ location classes. Discussed at
7449 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7450 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7451 declaration indicating whether filename_type has an operator==. If
7452 filename_type is `std::string', it defaults to `1', `0' otherwise.
7453 * data/location.cc: Iff b4_define_location_comparison is `1', add
7454 operator== and operator!= for class position and for class location.
7455
7456 Some minor fixes.
7457 * src/scan-action.l: Remove unused file.
7458 * src/symtab.c (symbol_printer_set): Use printer_location not
7459 destructor_location.
7460 * src/symtab.h (struct symbol): Replace incorrect source comment for
7461 printer members.
7462 * tests/input.at (Incompatible Aliases): Update output with correct
7463 printer location.
7464
9bc0dd67
JD
74652006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7466
7467 Don't put the pre-prologue in the header file. For the yacc.c code
7468 file and the glr.c header and code files, move the pre-prologue before
7469 the token definitions. Add new %before-definitions and
7470 %after-definitions to declare code that will go in both the header file
7471 and code file. Discussed at
7472 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7473 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7474 and
7475 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7476 * NEWS (2.3+): Describe these changes.
7477 * data/glr.c (b4_pre_prologue): Move from within to before...
7478 (b4_shared_declarations): ... this.
7479 Add new b4_before_definitions before b4_token_enums.
7480 Add new b4_after_definitions at the end.
7481 * data/glr.cc (b4_pre_prologue): Replace with...
7482 (b4_before_definitions): ... this in the header file.
7483 (b4_after_definitions): New near the end of the header file.
7484 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7485 code file right before including the header file.
7486 (b4_before_definitions): New in the previous position of
7487 b4_pre_prologue in the header file.
7488 (b4_after_definitions): New near the end of the header file.
7489 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7490 (b4_token_enums_defines): In the code file, move to right before
7491 YYSTYPE for consistency with the header file.
7492 (b4_before_definitions): New right before b4_token_enums_defines in
7493 both the header and code file.
7494 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7495 header and code file.
7496 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7497 of prologues for %union dependencies.
91661ebb
JD
7498 (Decl Summary): In %defines description, mention the effect of
7499 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
7500 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7501 than in the pre-prologue so that make check succeeds.
148d66d8 7502 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
7503 %after-definitions.
7504 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7505 %before-definitions.
7506 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7507 (declaration): Parse those declarations and append to
7508 b4_before_definitions and b4_after_definitions, respectively.
7509 * src/reader.c (before_definitions, after_definitions): New bools to
7510 track whether those declarations have been seen.
7511 (prologue_augment): Add to the post-prologue if %union,
7512 %before-definitions, or %after-definitions has been seen.
7513 * src/reader.h (before_definitions, after_definitions): New extern's.
7514 * src/scan-gram.l: Scan the new declarations.
7515 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7516 prologue block in a %before-definitions or a %after-definitions based
7517 on whether the %union is declared.
7518 * tests/regression.at (Early token definitions with --yacc, Early token
7519 definitions without --yacc): Move tests for token definitions into the
7520 post-prologue since token names are no longer defined in the
7521 pre-prologue.
7522
203b9274
AD
75232006-06-20 Akim Demaille <akim@epita.fr>
7524
7525 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7526 (symbol_get): Use it.
7527 * src/parse-gram.y: Use it.
7528
a7ee59cf
JD
75292006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7530
7531 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7532 build succeeds when configured with --enable-gcc-warnings.
7533
5a2baae7
PE
75342006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7535
33ad1a9c
PE
7536 * src/parse-gram.y (char_name): New function.
7537 (CHAR, STRING, string_content): For %printer, properly escape.
7538 (ID): Prefer fputs to fprintf.
7539 (id): Reindent to be consistent with other rules.
7540 Properly quote char.
7541
5a2baae7
PE
7542 The Translation Project changed its way of publishing translations
7543 to maintainers. I haven't received any responses to my request
7544 for supporting the old way, or for documenting the new way. I
7545 have modified 'bootstrap' to use screen scraping
7546 (in this case, HTML scraping). This is unreliable and inelegant,
7547 but I don't see any better way. Yuck.
7548 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7549 (get_translations): New function, which uses HTML scraping to
7550 deduce locations of latest translations.
7551 Use this function to grab both bison and bison-runtime .po files.
7552 Don't bother priming the pump for the runtime-po domain any more,
7553 as it's now translated better than bison is.
7554
58d7a1a1
AD
75552006-06-19 Akim Demaille <akim@epita.fr>
7556
7557 * src/scan-gram.l: No longer "parse" things after `%union' until
7558 `{'. Rather, return a single "%union" token.
7559 No longer make symbols: return strings, and leave the conversion
7560 to symbols to the parser.
7561 (SC_PRE_CODE, token_type): Remove.
7562 * src/parse-gram.y (%union): New field `character'.
7563 Sort tokens.
7564 (CHAR): New token.
7565 (ID, ID_COLON): Now that the scanner no longer makes them
7566 identifiers, adjust all uses to invoke symbol_get.
7567 (id_colon): New, wraps the conversion from string to symbol.
7568 (%union): Accept a possible union_name.
7569 (symbol): Now can be a char.
7570 * data/c.m4 (b4_union_name): Leave a default value.
7571 * data/glr.c, data/yacc.c: Use it.
7572
b931235e
JD
75732006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7574
7575 For associating token numbers with token names for "yacc.c", don't use
7576 #define statements unless `--yacc' is specified; always use enum
7577 yytokentype. Most important discussions start at:
7578 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7579 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7580 and
7581 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7582 * NEWS (2.3+): Mention.
7583 * data/c.m4 (b4_yacc_if): New.
7584 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7585 token #define's.
7586 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7587 on token name definitions.
7588 * src/getargs.c (usage): Capitalize `Yacc' in English.
7589 * src/output.c (prepare): Define b4_yacc_flag.
7590 * tests/regression.at (Early token definitions): Test that tokens names
7591 are defined before the pre-prologue not just before the post-prologue.
7592 Remove this test case and copy to...
7593 (Early token definitions with --yacc): ... this to test #define's.
7594 (Early token definitions without --yacc): ... and this to test enums.
7595
9e6e7ed2
PE
75962006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7597
7598 * NEWS: Reword the post-2.3 change to not be so optimistic about
7599 removing the old "look-ahead" spelling.
7600 Update previous look-ahead/lookahead change reports.
7601 * REFERENCES: look-ahead -> lookahead (since that's
7602 what he actually wrote).
7603 * doc/refcard.tex: look ahead -> lookahead,
7604 look-ahead -> lookahead
7605
742e4900
JD
76062006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7607
7608 For consistency, use `lookahead' instead of `look-ahead' or
7609 `look_ahead'. Discussed starting at
7610 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7611 and then at
7612 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7613 * NEWS: For the next release, note the change to `--report'.
7614 * TODO, doc/bison.1: Update English.
7615 * doc/bison.texinfo: Update English.
7616 (Understanding Your Parser, Bison Options): Document as
7617 `--report=lookahead' rather than `--report=look-ahead'.
7618 * src/conflicts.c: Update English in comments.
7619 (lookahead_set): Rename from look_ahead_set.
7620 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7621 (resolve_sr_conflict): Rename local look_ahead_tokens to
7622 lookahead_tokens, and update other uses.
7623 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7624 count_rr_conflicts, conflicts_free): Update uses.
7625 * src/getargs.c (report_args): Move "lookahead" before alternate
7626 spellings.
7627 (report_types): Update uses.
7628 (usage): For `--report' usage description, state `lookahead' spelling
7629 rather than `look-ahead'.
7630 * src/getargs.h (report.report_lookahead_tokens): Rename from
7631 report_look_ahead_tokens.
7632 * src/lalr.c: Update English in comments.
7633 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7634 (state_lookahead_tokens_count): Rename from
7635 state_look_ahead_tokens_count.
7636 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7637 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7638 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7639 Update other uses.
7640 Update English in output.
7641 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7642 * src/print.c: Update English in comments.
7643 (lookahead_set): Rename from look_ahead_set.
7644 (print_reduction): Rename argument lookahead_token from
7645 look_ahead_token.
7646 (print_core, state_default_rule, print_reductions, print_results):
7647 Update uses.
7648 * src/print_graph.c: Update English in comments.
7649 (print_core): Update uses.
7650 * src/state.c: Update English in comments.
7651 (reductions_new): Update uses.
7652 (state_rule_lookahead_tokens_print): Rename from
7653 state_rule_look_ahead_tokens_print, and update other uses.
7654 * src/state.h: Update English in comments.
7655 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7656 (state_rule_lookahead_tokens_print): Rename from
7657 state_rule_look_ahead_tokens_print.
7658 * src/tables.c: Update English in comments.
7659 (conflict_row, action_row): Update uses.
7660 * tests/glr-regression.at
7661 (Incorrect lookahead during deterministic GLR,
7662 Incorrect lookahead during nondeterministic GLR): Rename
7663 print_look_ahead to print_lookahead.
7664 * tests/torture.at: Update English in comments.
7665 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7666 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7667 (Many lookahead tokens): Update uses.
7668 * data/glr.c: Update English in comments.
7669 * lalr1.cc: Likewise.
7670 * yacc.c: Likewise.
7671 * src/conflicts.h: Likewise.
7672 * src/lalr.h: Likewise.
7673 * src/main.c: Likewise.
7674 * src/output.c: Likewise.
7675 * src/parse-gram.c: Likewise.
7676 * src/tables.h: Likewise.
7677 * tests/calc.at: Likewise.
7678
3c40d0b5
JD
76792006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7680
7681 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7682
5d278082
PE
76832006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7684
7685 * TODO: Add request from Nelson H. F. Beebe to be able to install
7686 Bison without installing the yacc script.
7687
9e668899
JD
76882006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7689
7690 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7691 and yytext if they're already #define'd.
7692 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7693 * src/scan-code-c.c: ... here.
7694 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7695 <config.h>.
7696
0c8e079f
JD
76972006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7698
7699 Get Bison to build again when configured with --enable-gcc-warnings.
7700 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7701 missing #include's.
7702 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7703 loc argument as it shadows a global.
7704 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7705 invocation.
7706
7707 * src/.cvsignore: Add scan-code.c.
7708
2346344a
AD
77092006-06-07 Akim Demaille <akim@epita.fr>
7710
7711 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7712 to...
7713 * src/scan-code.l: here.
7714 * tests/input.at (Torturing the Scanner): Fix another location
7715 error.
7716
4862bdfd
AD
77172006-06-07 Akim Demaille <akim@epita.fr>
7718
7719 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
7720
e9071366
AD
77212006-06-06 Akim Demaille <akim@epita.fr>
7722
7723 Extract the parsing of user actions from the grammar scanner.
7724 As a consequence, the relation between the grammar scanner and
7725 parser is much simpler. We can also split "composite tokens" back
7726 into simple tokens.
7727 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
7728 * src/scan-gram.l (add_column_width, adjust_location): Move to and
7729 rename as...
7730 * src/location.h, src/location.c (add_column_width)
7731 (location_compute): these.
7732 Fix the column count: the initial column is 0.
7733 (location_print): Be robust to ending column being 0.
7734 * src/location.h (boundary_set): New.
7735 * src/main.c: Adjust to scanner_free being renamed as
7736 gram_scanner_free.
7737 * src/output.c: Include scan-code.h.
7738 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
7739 Use boundary_set.
7740 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
7741 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
7742 which is now, again, a separate token.
7743 Adjust all dependencies.
7744 Whereever actions with $ and @ are used, use translate_code.
7745 (action): Remove this nonterminal which is now useless.
7746 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
7747 (grammar_current_rule_action_append): Use translate_code.
7748 (packgram): Bound check ruleno, itemno, and rule_length.
7749 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
7750 (last_string, last_braced_code_loc, max_left_semantic_context)
7751 (scanner_initialize, scanner_free, scanner_last_string_free)
7752 (gram_out, gram_lineno, YY_DECL_): Move to...
7753 * src/scan-gram.h: this new file.
7754 (YY_DECL): Rename as...
7755 (GRAM_DECL): this.
7756 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
7757 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7758 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7759 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7760 Move these declarations, and...
7761 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
7762 these to...
7763 * src/flex-scanner.h: this new file.
7764 * src/scan-gram.l (rule_length, rule_length_overflow)
7765 (increment_rule_length): Remove.
7766 (last_braced_code_loc): Rename as...
7767 (gram_last_braced_code_loc): this.
7768 Adjust to the changes of the parser.
7769 Move all the handling of $ and @ into...
7770 * src/scan-code.l: here.
7771 * src/scan-gram.l (handle_dollar, handle_at): Remove.
7772 (handle_action_dollar, handle_action_at): Move to...
7773 * src/scan-code.l: here.
7774 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
7775 scan-code.h, scan-code-c.c, scan-gram.h.
7776 (EXTRA_bison_SOURCES): Add scan-code.l.
7777 (BUILT_SOURCES): Add scan-code.c.
7778 (yacc): Be robust to white spaces.
7779
7780 * tests/conflicts.at, tests/input.at, tests/reduce.at,
7781 * tests/regression.at: Adjust the column numbers.
7782 * tests/regression.at: Adjust the error message.
7891a7c4 7783
184e42f0
JD
77842006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7785
7786 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7787 Use Akim's wording from
7788 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
7789
7891a7c4
JD
77902006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
7791
7792 Between Bison releases, manually append `+' to the previous Bison
7793 release number, and use that as a signal to automatically print the
7794 ChangeLog's CVS Id keyword from --version. Discussed starting at
7795 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
7796 * ChangeLog: Add Id header.
7797 * configure.ac (AC_INIT): Append `+' to `2.3'.
7798 * src/.cvsignore: Add revision.c.
7799 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
7800 (BUILT_SOURCES): Add revision.c.
7801 (revision.c): New target rule. This file defines a new global variable
7802 named revision. It initializes it with either the Id from ChangeLog
7803 or, if VERSION doesn't contain `+', with the empty string.
7804 * src/getargs.c (version): Print the value of revision.
7805 * src/revision.h: Extern revision.
7806
4ad3ed84
PE
78072006-06-05 Paul Eggert <eggert@cs.ucla.edu>
7808
7809 * NEWS: Version 2.3.
7810 * configure.ac (AC_INIT): Likewise.
7811
02103984
PE
78122006-05-30 Paul Eggert <eggert@cs.ucla.edu>
7813
7814 * data/glr.c (YYRECOVERING): Define to be a function-like macro
7815 with no arguments, not as an object-like macro. This is for
7816 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
7817 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
7818 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
7819 Document this.
7820
2c08afa5
JD
78212006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
7822
7823 * src/getargs.c (usage): Back out yesterday's modification of the
7824 --help output so that we don't have to wait for translation before
7825 releasing 2.3.
7826
6077da58
PE
78272006-05-29 Paul Eggert <eggert@cs.ucla.edu>
7828
7829 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
7830 Problem reported by Akim Demaille.
7831
2a26b6c2
JD
78322006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
7833
7834 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
7835
aefef0d6
PE
78362006-05-26 Paul Eggert <eggert@cs.ucla.edu>
7837
7838 * data/yacc.c (yy_reduce_print): Omit trailing white space in
7839 generated source code. Problem reported by Frans Englich in
7840 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
7841
fcd8e201
PE
78422006-05-22 Paul Eggert <eggert@cs.ucla.edu>
7843
7844 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
7845 shell, not within 'make', so that 'make' by an ordinary builder
7846 (using GNU make) does not worry about configuring gzip. This also
7847 works around a bug reported independently by Keith Thompson and by
7848 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
7849 stderr rather than stdout, messing up the build logs.
7850
7b5cdcbd
JD
78512006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7852
7853 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
7854 to make sure that YYID will never be unused. This fixes a 'make
7855 maintainer-check' failure caused by the recent changes to the 'Trivial
7856 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
7857 not used.
7858 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
7859
5ad0a449
JD
78602006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
7861
7862 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
7863 state before an empty RHS is always resolved here. Only the location
7864 of that state is guaranteed to be resolved, and that's enough. This
7865 fixes the remaining bug reported by Derek M. Jones in
7866 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7867 * tests/glr-regression.at (Uninitialized location when reporting
7868 ambiguity): Test the above case.
7869 Also, the embedded comments in this test case claim it checks the case
7870 of an empty RHS that has inherited the initial location. However, the
7871 corresponding LHS was already resolved, so yyresolveLocations didn't
7872 actually have reason to modify it. Fix this by forcing
7873 nondeterministic operation at the beginning of the parse.
7874
50cce58e
PE
78752006-05-20 Paul Eggert <eggert@cs.ucla.edu>
7876
7877 * data/c.m4 (b4_yy_symbol_print_generate):
7878 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
7879 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
7880 of the bugs reported today by Derek M Jones in
7881 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
7882 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
7883 defined to be a type name without parens or brackets.
7884 (Location Type): Similarly for YYLTYPE.
7885 * tests/regression.at (Trivial grammars): Put in a test for this
7886 bug that will be caught by 'make maintainer-check' (though not,
7887 alas, by 'make check' unless your compiler is picky).
7888
ab8d9dc5
PE
78892006-05-19 Paul Eggert <eggert@cs.ucla.edu>
7890
0d2c8934 7891 * NEWS: Version 2.2.
ab8d9dc5
PE
7892 * configure.ac (AC_INIT): Likewise.
7893
9138c575
JD
78942006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
7895
7896 * data/glr.c (yyreportTree): Make room in yystates for the state
7897 preceding the RHS. This fixes the segmentation fault reported by Derek
7898 M. Jones in
7899 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
7900 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
7901 to the user. Reported for yyreportTree by Derek M. Jones later in the
7902 same thread.
7903 * THANKS: Add Derek M. Jones.
7904 Update my email address.
7905 Fix typo in Steve Murphy's name.
7906
276f48df
PE
79072006-05-14 Paul Eggert <eggert@cs.ucla.edu>
7908
d6645148
PE
7909 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
7910 checking against YYLAST that caused the parser to miss a potential
7911 alternative in its diagnostic.
7912 Problem reported by Maria Jose Moron Fernandez in
7913 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
7914 * data/lalr1.cc (yysyntax_error_): Likewise.
7915 * data/yacc.c (yysyntax_error): Likewise.
7916 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
7917 tokens, in case we run into an older C compiler.
7918 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
7919 Use them to check for the off-by-one error fixed above.
7920
276f48df
PE
7921 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
7922 YYSIZE_T, not size_t.
7923 * tests/regression.at (Trivial grammars): New test, to catch
7924 the error fixed by the above patch.
7925
cd8b5791
AD
79262006-05-14 Akim Demaille <akim@lrde.epita.fr>
7927
7928 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
7929 scheme.
7930 Reported by Steve Murphy.
7931
34376418
AD
79322006-05-14 Akim Demaille <akim@lrde.epita.fr>
7933
7934 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
7935 * data/glr.cc: b4_location_flag is now b4_locations_flag.
7936
327afc7c
AD
79372006-05-14 Akim Demaille <akim@lrde.epita.fr>
7938
7939 Implement --trace=m4.
7940 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
7941 * src/output.c (output_skeleton): When set, pass -dV to m4.
7942
7943 Factor the handling of flags in m4.
7944 * src/output.c (prepare): Rename the muscle names debug, defines,
7945 error_verbose to debug_flag, defines_flag, error_verbose_flag.
7946 * data/c.m4: Adjust.
7947 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
7948 Use b4_define_flag_if to define other b4_FLAG_if macros.
7949 (b4_location_if): As a consequence, rename as...
7950 (b4_locations_if): this, for consistency.
7951 Adjust all the skeletons.
7952
ba9ecd19
AD
79532006-05-14 Akim Demaille <akim@lrde.epita.fr>
7954
7955 * etc/bench.pm: Shorten bench names.
7956
4e83ea15
AD
79572006-05-14 Akim Demaille <akim@lrde.epita.fr>
7958
7959 * src/output.h, src/output.c (error_verbose): Move to...
7960 * src/getargs.h, src/getargs.c: here.
7961 Sort the flags.
7962 Adjust dependencies.
7963
6e93d810
PE
79642006-05-13 Paul Eggert <eggert@cs.ucla.edu>
7965
7966 * data/c.m4 (b4_copyright): Put the special exception for Bison
7967 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
7968 uses changed. Suggested by Akim Demaille. Also, wrap the
7969 copyright notice, in case it is longer than 80 columns. Replace
7970 comma by newline after title.
6e93d810 7971
eaea13f5
PE
79722006-05-11 Paul Eggert <eggert@cs.ucla.edu>
7973
7974 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
7975 incompatibility, not a bug. Mention that it wasn't fixed as of
7976 flex 2.5.33.
7977
3cf084ec
AD
79782006-05-11 Akim Demaille <akim@lrde.epita.fr>
7979
7980 * examples/extexi: Enforce the precedence of concatenation over
7981 >>.
0a9f1c7d 7982 Reported by Tommy Nordgren.
3cf084ec 7983
32c96bd7
AD
79842006-05-11 Akim Demaille <akim@lrde.epita.fr>
7985
7986 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
7987 with the member "token".
f94705b2 7988 Reported by Martin Nylin.
32c96bd7 7989
eaea13f5
PE
79902006-05-08 Paul Eggert <eggert@cs.ucla.edu>
7991
7992 * data/glr.c: Switch to Bison 2.2 special-exception language in
7993 the copyright notice. Use more-regular format for titles and
7994 copyright notices.
7995 * data/glr.cc: Likewise.
7996 * data/location.cc: Likewise.
7997 * data/yacc.cc: Likewise.
7998 * doc/bison.texinfo (Conditions): Document this.
7999 * NEWS: likewise. Upgrade version to 2.2.
8000
6e2d1146
AD
80012006-04-27 Akim Demaille <akim@lrde.epita.fr>
8002
8003 * data/glr.cc: Remove dead code.
8004
47671055
PE
80052006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8006
8007 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8008 that variable and the line breaks the bootstrap. Problem reported
8009 by Juan M. Guerrero.
8010
ed2e6384
AD
80112006-04-24 Akim Demaille <akim@lrde.epita.fr>
8012
8013 * doc/bison.texinfo (Multiple start-symbols): New.
8014
3cedc2dc
AD
80152006-04-24 Akim Demaille <akim@lrde.epita.fr>
8016
8017 * etc/README, etc/bench.pl: New.
8018
b2ddc3f3
AD
80192006-04-03 Akim Demaille <akim@lrde.epita.fr>
8020
8021 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8022 rule.
8023 Reported by Mickael Labau.
8024 * tests/input.at (Torturing the Scanner): Test it.
8025
91e3ac9a
PE
80262006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8027
8028 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8029 Problem reported by Bob Rossi.
8030
80312006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8032
8033 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8034 and didn't really work.
8035 For the index, use @ifnotinfo, not @iftex.
8036 Minor cleanups of spacing and terminology.
8037
5cf61e93
AD
80382006-03-12 Akim Demaille <akim@lrde.epita.fr>
8039
8040 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8041 of AT_NAME_PREFIX when %name-prefix is not used.
8042
aa08666d
AD
80432006-03-12 Akim Demaille <akim@lrde.epita.fr>
8044
8045 Apply --prefix to C++ skeletons too: they change the namespace.
8046 The test suite already exercize these cases.
8047 * data/c++.m4 (b4_namespace): New.
8048 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8049 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8050 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8051 * doc/bison.texinfo: Document it.
8052 (Option Cross Key): Use @multitable in all formats. It looks
8053 nicer, even in TeX outputs.
8054 (Rules): Use the same code whatever the output type is.
8055 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8056 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8057 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 8058
45567173
AD
80592006-03-10 Akim Demaille <akim@lrde.epita.fr>
8060
8061 * TODO: Remove dead items.
8062
e9d8f881 80632006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
8064
8065 * doc/FAQ: Remove, merged into...
8066 * doc/bison.texinfo (FAQ): this.
8067 * doc/Makefile.am (EXTRA_DIST): Adjust.
8068
c095d689
AD
80692006-03-10 Akim Demaille <akim@lrde.epita.fr>
8070
8071 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8072 even if empty.
8073 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8074 * doc/bison.texinfo (Calc++ Scanner): Use it.
8075
6e0f8287
PE
80762006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 Fix two nits reported by twlevo, plus one more that I discovered.
8079
8080 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8081 this is the usual Bison style.
8082 * src/location.h (location_print): Likewise.
8083
8084 * src/reader.h (token_name): Likewise.
8085
d6b771c3
PE
80862006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8087
8088 Fix some nits reported by twlevo.
8089 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8090 and "POSIX". Use more-modern syntax for URLs. Mention C++
8091 and ask for Java. Don't hardwire OS version numbers. Add
8092 copyright notice.
8093 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8094 * src/conflicts.c (solved_conflicts_obstack): Now static.
8095
1e137b71
JD
80962006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8097
8098 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8099 page. Say "you can use it" not "you may use it" as on the web page;
8100 we're describing capabilities not granting permission.
8101
73f2e47e
PE
81022006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8103
6d05403d
PE
8104 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8105 shadowing warnings. Use usual patter for iterating through RHS.
8106 * tests/glr-regression.at
8107 (Uninitialized location when reporting ambiguity):
8108 Modify yylex so that it uses its argument, rather than trying
8109 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8110 const char -> char const.
8111
73f2e47e
PE
8112 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8113 Don't use tabs inside commands; it messes up 'ps'.
8114 Problem reported by twlevo.
8115
8710fc41
JD
81162006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8117
8118 * tests/glr-regression.at (Uninitialized location when reporting
8119 ambiguity): New test case.
8120 * data/glr.c (yyresolveLocations): New function, which uses
8121 YYLLOC_DEFAULT.
8122 (yyresolveValue): Invoke yyresolveLocations before reporting an
8123 ambiguity.
8124 * doc/bison.texinfo (Default Action for Locations): Note
8125 YYLLOC_DEFAULT's usage for ambiguity locations.
8126 (GLR Semantic Actions): Cross-reference those notes.
8127
ae952af2
JD
81282006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8129
8130 * tests/glr-regression.at (Leaked semantic values when reporting
8131 ambiguity): Remove unnecessary union and type declarations.
8132 (Leaked lookahead after nondeterministic parse syntax error): New test
8133 case.
8134 * data/glr.c (yyparse): Check for zero stacks remaining before
8135 attempting to shift the lookahead so that you don't lose it.
8136
35ee866a
JD
81372006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8138
8139 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8140 * tests/glr-regression.at (Leaked semantic values when reporting
8141 ambiguity): New test case.
8142 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8143 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8144 now unnecessary yystackp parameter.
8145 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8146 destructors can be called.
8147
8148 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8149 in existing testcases.
8150
520181ab
JD
81512006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8152
8153 Don't leak semantic values for parent RHS when a user action cuts the
8154 parser, and clean up related code a bit.
8155 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8156 cuts parse): Rename to...
8157 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8158 for leaked parent RHS values.
8159 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8160 between an unresolved state (non-empty chain of semantic options) and
8161 an incomplete one (signaled by an empty chain).
ae952af2 8162 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8163 successfully or unsuccessfully resolved yyGLRState to...
8164 (yyresolveValue): ... here so that yyresolveValue always leaves a
8165 yyGLRState with consistent data and thus is easier to understand.
8166 Remove the yyvalp and yylocp parameters since they are always just
8167 taken from the yys parameter. When reporting a discarded merged value
8168 in debugging output, note that it is incompletely merged. Document the
8169 interface.
8170 (yyresolveAction): If resolving any of the RHS states fails, destroy
8171 them all rather than leaking them. Thus, as long as user actions are
8172 written to clean up the RHS correctly, yyresolveAction always cleans up
8173 the RHS of a semantic option. Document the interface.
8174
18d9185c
PE
81752006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8176
8177 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8178 led to a segmentation fault in GNU Pascal. Problem reported
8179 by Waldek Hebisch.
8180
841a7737
JD
81812006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8182
8183 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8184 mid-rule action inside a nonterminal symbol in order to declare a
8185 destructor for its semantic value.
8186
fc3f467f
PE
81872006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8188
8189 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8190 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8191 __cplusplus && ! defined _STDLIB_H && !
8192 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8193 defined free))]: Include <stdlib.h> rather than rolling our own
8194 declarations of malloc and free, to avoid problems with
8195 incompatible declarations (using 'throw') C++'s stdlib.h. This
8196 should fix Debian bug 340012
8197 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8198 reported by Guillaume Melquiond.
8199
a3af26dd
PE
82002006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8201
4d7bc38c
PE
8202 * NEWS: Clarify symbols versus types in unused-value warnings.
8203
a3af26dd
PE
8204 * configure.ac (AC_INIT): Bump version number.
8205
4e26c69e
PE
82062006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8207
8208 * NEWS: Version 2.1a.
8209 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8210 since C99 requires this.
8211
498e897c
PE
82122006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8213
8214 * m4/c-working.m4: New file.
8215 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8216
57bb17ca
PE
82172006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8218
8219 * Makefile.maint: Merge from coreutils.
8220
0be105dc
PE
82212006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 More portability fixes for problems summarized by Nelson H. F. Beebe.
8224
8225 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8226 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8227 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8228 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8229 messes up because C++ code is compiled in 32-bit mode but linked
8230 in 64-bit mode.
8231
6fc0c024
PE
82322006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8233
8234 More portability fixes for problems summarized by Nelson H. F. Beebe.
8235
7870f699
PE
8236 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8237 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8238
6fc0c024
PE
8239 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8240 nodist_PROGRAMS, since we don't need to actually compile the
8241 example if we're just doing a plain 'make'. This avoids bothering
8242 the installer unnecessarily about problems due to weird C++
8243 compilers.
8244
fe6c2fde
PE
82452006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8246
8247 More portability fixes for problems summarized by Nelson H. F. Beebe.
8248
8249 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8250 than #include "...", and compile with -I'.'. The old method was
8251 not portable, according to Posix and the C standard, and it does
8252 not work with Sun C 5.7, where previous #line directives affect
8253 the working directory used in later #include "..." directives.
8254
927b425b
JMG
82552006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8256
8257 Various DJGGP specific issues in /djgpp
8258
d9735e9e
PE
82592006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8260
8261 More portability fixes for problems summarized by Nelson H. F. Beebe.
8262
8263 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8264 '#include <map>' works and that you can apply ++ to iterators.
8265
5a6755af
PE
82662006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8267
67a0dc4f
PE
8268 Work around portability problems summarized by Nelson H. F. Beebe in
8269 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8270
8c86f0ef
PE
8271 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8272 that '#include <string>' works.
8273
de35dd59
PE
8274 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8275 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8276 "warning: sorry: semantics of inline function static data `const
8277 unsigned char translate_table[262]' are wrong (you'll wind up with
8278 multiple copies)".
8279
67a0dc4f
PE
8280 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8281 or, xor to not_, and_, or_, and xor_, respectively. This works
8282 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8283 random system header somewhere that includes the equivalent of
8284 <iso646.h>.
8285
5a6755af
PE
8286 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8287 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8288 Suite Version 2.0.
5a6755af 8289
3f001415
JD
82902006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8291
8292 During deterministic GLR operation, user actions should be able to
8293 influence the parse by changing yychar. To make this easier to fix and
8294 to make glr.c easier to evolve in general, don't maintain yytoken in
8295 parallel with yychar; just compute yytoken when needed.
8296 * tests/glr-regression.at (Incorrect lookahead during deterministic
8297 GLR): Check that setting yychar in a user action has the intended
8298 effect.
8299 * data/glr.c (yyGLRStack): Remove yytokenp member.
8300 (yyclearin): Don't set *yytokenp.
8301 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8302 yychar rather than *yytokenp to determine the current lookahead.
8303 Compute yytoken locally when needed.
8304 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8305 point to.
8306
8307 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8308 after `--report' documentation.
8309
e2a8c0f5
PE
83102006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8311
8312 * src/parse-gram.y (grammar_declaration): Location of printer
8313 symbol is @1, not list->location. Bug reported by twlevo.
8314 * tests/input.at (Incompatible Aliases): Adjust to above change.
8315
6b702268
PE
83162006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8317
27622431
PE
8318 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8319 all the test at once. This makes the output easier to read in the
8320 normal case.
8321
6b702268
PE
8322 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8323 got from <http://bro-ids.org/download.html>. The bug is that
8324 when two actions appeared in succession, the second one was
8325 scanned before the first one was added to the grammar rule
8326 as a midrule action. Bison then output the incorrect warning
8327 "parse.y:905.17-906.36: warning: unused value: $3".
8328 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8329 associated with a value.
8330 (rhs): Don't invoke grammar_current_rule_action_append.
8331 (action): Invoke it here instead.
8332 * src/reader.c (grammar_midrule_action): Now extern.
8333 (grammar_current_rule_action_append): Don't invoke
8334 grammar_midrule_action; that is now the scanner's job.
8335 * src/reader.h (last_string, last_braced_code_loc):
8336 (grammar_midrule_action): New decls.
8337 * src/scan-gram.l (last_string): Now extern, sigh.
8338 (last_braced_code_loc): New extern variable.
8339 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8340 rule already has an action.
8341 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8342 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8343 Add some tests to check that the above changes fixed the bug.
8344
d40ba6c2
PE
83452006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8346
8347 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8348 All used changed. Check whether the symbol has a destructor,
8349 not whether it is typed.
8350 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8351 that the values are still reported as unused. All line numbers
8352 adjusted.
8353
401aace6
PE
83542006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8355
8356 Work around a bug in bro 0.8, which underparenthesizes its
8357 definition of YYLLOC_DEFAULT.
8358 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8359 their arguments.
8360 * data/lalr1.cc: Likewise.
8361 * data/yacc.cc: Likewise.
8362
06f01bc4
PE
83632006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8364
401aace6
PE
8365 Work around a bug in Pike 7.0, and give the Pike folks a
8366 better way to override the usual int widths.
8367 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8368 user can override the types.
8369 (short): #undef, to work around a bug in Pike 7.0.
8370 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8371 (union yyalloc.yyss): Use yytype_int16 rather than short.
8372 All uses changed.
8373 (yysigned_char): Remove.
8374 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8375 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8376 * tests/regression.at (Web2c Actions): Adjust to above changes.
8377
8378 * src/reader.c (check_and_convert_grammar): New function.
8379 (reader): Close the input file even if something went wrong during
8380 parsing. Minor file descriptor leak reported by twlevo.
8381
06f01bc4
PE
8382 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8383 to pacify gcc -Wswitch-default.
8384 * src/scan-gram.l (adjust_location): Use a default: break; case
8385 to pacify gcc -Wswitch-default.
8386 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8387 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8388 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8389 Move these decls to scan-skel.l, since they don't need to be
8390 visible elsewhere.
8391 * src/scan-skel.l: Accept the above decls.
8392 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8393 is used.
8394
02650b7f
PE
83952006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8396
8397 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8398 since we don't want to insist on a version number at the start
8399 of the changelog every time.
8400 * Makefile.maint: Sync from coreutils a bit better.
8401 (sc_trailing_blank): Renamed from sc_trailing_space.
8402 All uses changed.
8403 (sc_no_if_have_config_h, sc_require_config_h):
8404 (sc_prohibit_assert_without_use): New rules.
8405 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8406 (sc_dd_max_sym_length): Fix leading spaces in rule.
8407 (sc_system_h_headers): Prefix with @.
8408 (sc_useless_cpp_parens, m4-check): Output line numbers.
8409 (changelog-check): Allow version only in head.
8410 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8411 satisfy new Makefile.maint rule.
8412 * data/glr.c: Likewise.
8413 * data/glr.cc: Likewise.
8414 * data/lalr1.cc: Likewise.
8415 * data/yacc.c: Likewise.
8416 * lib/ebitsetv.c: Likewise.
8417 * lib/lbitset.c: Likewise.
8418 * lib/subpipe.c: Likewise.
8419 * lib/timevar.c: Likewise.
8420 * src/system.h: Likewise.
8421 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8422 * djgpp/Makefile.maint: Add copyright notice.
8423 * djgpp/README.in: Likewise.
8424 * djgpp/config.bat: Likewise.
8425 * djgpp/config.site: Likewise.
8426 * djgpp/config_h.sed: Likewise.
8427 * djgpp/djunpack.bat: Likewise.
8428 * djgpp/config.sed: Fix copyright notice to match standard format.
8429 * djgpp/subpipe.h: Likewise.
8430 * lib/bitsetv-print.c: Likewise.
8431 * lib/bitsetv.c: Likewise.
8432 * lib/subpipe.h: Likewise.
8433 * lib/timevar.c: Likewise.
8434 * lib/timevar.h: Likewise.
8435 * djgpp/subpipe.c: Use standard recipe for config.h.
8436 * lib/abitset.c: Likewise.
8437 * lib/bitset.c: Likewise.
8438 * lib/bitset_stats.c: Likewise.
8439 * lib/bitsetv-print.c: Likewise.
8440 * lib/bitsetv.c: Likewise.
8441 * lib/ebitsetv.c: Likewise.
8442 * lib/get-errno.c: Likewise.
8443 * lib/lbitset.c: Likewise.
8444 * lib/subpipe.c: Likewise.
8445 * lib/timevar.c: Likewise.
8446 * lib/vbitset.c: Likewise.
8447 * tests/local.at: Likewise.
8448 * src/scan-gram.l: Don't include verify.h, since system.h does
8449 that for us.
8450 * .x-sc_require_config_h: New file.
8451 * .x-sc_unmarked_diagnostics: New file.
8452
287c78f6
PE
84532006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8454
287c78f6
PE
8455 Be a bit more systematic about using 'abort'.
8456 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8457 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8458 Put 'default: abort ();' before some other case, to satisfy older
8459 pedantic compilers.
8460 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8461 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8462 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8463 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
8464 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8465 (get_decision_str, get_orientation_str, get_node_alignment_str):
8466 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8467 (get_linestyle_str, get_arrowstyle_str): Likewise.
8468 * src/conflicts.c (resolve_sr_conflict):
8469 Use a default case rather than one for the one remaining enum
8470 value, to catch invalid enum values as well.
8471 * src/lalr.c (set_goto_map, map_goto):
8472 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8473 * src/nullable.c (nullable_compute, token_definitions_output):
8474 Likewise.
8475 * src/reader.c (packgram, reader): Likewise.
8476 * src/state.c (transitions_to, state_new, state_reduction_find):
8477 Likewise.
8478 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8479 (symbol_pack): Likewise.
8480 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
8481 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8482 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
8483 * src/system.h: Don't include <assert.h>.
8484 (assert): New macro.
8485
8486 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8487 (Destructor Decl, Parser Function, Pure Calling):
8488 Describe rules for braces inside C code more carefully.
287c78f6 8489
c66dfadd
PE
84902006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8491
c21493b8
PE
8492 Fix some porting glitches found by Nelson H. F. Beebe.
8493 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8494 compilers that don't understand that abort () does not return.
8495 * src/state.c (transitions_to): Likewise.
8496 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8497 that '#include <cstdlib>' works.
8498 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8499 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8500 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8501 for the benefit of some pre-C99 compilers.
8502
b6e3facf
PE
8503 * bootstrap: Undo changes to gnulib files that autoreconf made.
8504
c66dfadd
PE
8505 Minor fixups to get 'make maintainer-check' to work.
8506 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8507 with the new verify.h implementation.
8508 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8509 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8510 * data/yacc.c (YYUSE): Likewise.
8511 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8512 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8513 * src/parse-gram.y (declaration): Don't pass a string constant
8514 to a function that expects char *, since GCC might complain
8515 about the constant value.
8516 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8517 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8518 before #defining them.
8519 * tests/glr-regression.at
8520 (Incorrectly initialized location for empty right-hand side in GLR):
8521 In yyerror, use the msg arg.
8522 (Corrupted semantic options if user action cuts parse):
8523 (Incorrect lookahead during deterministic GLR):
8524 (Incorrect lookahead during nondeterministic GLR):
8525 Don't name a local var 'index'; it shadows string.h's 'index'.
8526
ed94ef2a
AD
85272006-01-19 Akim Demaille <akim@epita.fr>
8528
8529 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8530 location, not just parts of it.
8531
e9ad4aec
PE
85322006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8533
d6ca7905
PE
8534 * NEWS: Document the fact that multiple %unions are now allowed.
8535 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
8536 * TODO: This feature is now implemented, so remove it from
8537 the wishlist.
d6ca7905 8538
ef1b70e0
PE
8539 * Makefile.maint: Merge with coreutils Makefile.maint.
8540 (CVS_LIST): Use build-aux version if available.
8541 (VERSION_REGEXP): New macro.
8542 (syntax-check-rules): Add sc_no_if_have_config_h,
8543 sc_prohibit_assert_without_use, sc_require_config_h,
8544 sc_useless_cpp_parens.
8545 (sc_obsolete_symbols): Check for O_NDELAY.
8546 (sc_dd_max_sym_length): Track coreutils.
8547 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8548 (sc_useless_cpp_parens): New rule.
8549 (news-date-check): Look for version or today's date.
8550 (changelog-check): Don't require version number near head.
8551 (copyright-check): Use current year instead of hardwiring 2005.
8552 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8553 (announcement): Add --gpg-key-ID.
8554
8555 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8556 with "file system".
8557
2073ce56 8558 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
8559 array. Problem reported by twlevo.
8560 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8561 * src/lalr.c (build_relations): Rely on new sentinel.
8562 * src/gram.c (gram_free): Adjust to new sentinel.
8563
b7691f15
JD
85642006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8565
8566 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8567 yylookaheadNeeds. All uses updated.
8568 (yysplitStack): Rename local yynewLookaheadStatuses to
8569 yynewLookaheadNeeds.
8570 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8571 GLR): In comments, change `lookahead status' to `lookahead need'.
8572
ddee1b06
PH
85732006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8574
8575 * data/glr.c (yysplitStack): A little stylistic rewrite.
8576
12f4614d
PH
85772006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8578
8579 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8580
32c29292
JD
85812006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8582
8583 * doc/bison.texinfo: Fix some typos.
8584 (GLR Semantic Actions): New subsection discussing special
8585 considerations because GLR semantic actions might be deferred.
8586 (Actions): Mention look-ahead usage of yylval.
8587 (Actions and Locations): Mention look-ahead usage of yylloc.
8588 (Special Features for Use in Actions): Add YYEOF entry and mention it
8589 in the yychar entry.
8590 In the yychar entry, remove mention of the local yychar case (pure
8591 parser) since this is irrelevant information when writing semantic
148d66d8 8592 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
8593 yychar is otherwise described as an external variable.
8594 In the yychar entry, don't call it the `current' look-ahead since it
8595 isn't when semantic actions are deferred.
8596 In the yychar and yyclearin entries, add note about deferred semantic
8597 actions.
8598 Add yylloc and yylval entries discussing look-ahead usage.
8599 (Look-Ahead Tokens): When discussing yychar, don't call it the
8600 `current' look-ahead, and do mention yylval and yylloc.
8601 (Error Recovery): Cross-reference `Action Features' when mentioning
8602 yyclearin.
148d66d8 8603 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
8604 look-ahead.
8605 In the yylloc and yylval entries, mention look-ahead usage.
8606
de366a2f 86072006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
8608
8609 * tests/glr-regression.at: Update copyright year to 2006.
8610
bf70fa87
JD
86112006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8612
8613 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8614 use during nondeterministic operation to track which stacks have
8615 actually needed the current lookahead.
8616 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8617 Allocate, deallocate, resize, and otherwise shuffle space for
8618 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8619 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8620 appropriately during nondeterministic operation.
8621 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8622 members to store the current lookahead to be used by the deferred
8623 user action.
8624 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8625 from which the RHS is taken. Set the lookahead members of the new
8626 yySemanticOption according to the lookahead status for stack yyk.
8627 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8628 yyaddDeferredAction.
8629 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8630 members of yySemanticOption before invoking yyuserAction, and then set
8631 them back to their current values afterward.
8632 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8633 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8634 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8635 titles for consistency.
8636 (Leaked merged semantic value if user action cuts parse): In order to
8637 suppress lint warnings, use arguments in merge function, and assign
8638 char value < 128 in main.
8639 (Incorrect lookahead during deterministic GLR): New test case.
8640 (Incorrect lookahead during nondeterministic GLR): New test case.
8641
05449a2c
JD
86422006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8643
de366a2f 8644 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
8645 !yyvaluep as signal that no semantic value is available to print.
8646 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8647 to print a semantic value.
8648
4158e0a1 86492006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 8650
4158e0a1
JD
8651 * tests/glr-regression.at: For consistency with my newer test cases,
8652 don't thank myself.
8653
d659304d
JD
86542006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8655
8656 * data/glr.c (yyresolveValue): When merging semantic options, if at
8657 least one user action succeeds but a later one cuts the parse, then
8658 destroy the semantic value before returning rather than leaking it.
8659 (yyresolveStates): If a user action cuts the parse and thus
8660 yyresolveValue fails, ignore the (unset) semantic value rather than
8661 corrupting the yyGLRState, and empty the semantic options list since
8662 the user actions should have called all necessary destructors.
8663 Simplify code with YYCHK.
8664 * tests/glr-regression.at (Corrupted semantic options if user action
8665 cuts parse): New test case.
8666 (Undesirable destructors if user action cuts parse): New test case.
8667 Before applying any of this patch, this test case never actually failed
8668 for me... but only because the corrupted semantic options usually
8669 masked this bug.
8670 (Leaked merged semantic value if user action cuts parse): New test
8671 case.
8672
6ec2c0f2
AD
86732006-01-05 Akim Demaille <akim@epita.fr>
8674
8675 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8676
1b9c21fb
PE
86772006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8678
8679 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8680 _MSC_VER. Problem reported by Cenzato Marco.
8681 (b4_c_function_def): Use it.
8682 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8683 b4_c_modern.
8684 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8685 than rolling our own.
8686
84866159
AD
86872006-01-04 Akim Demaille <akim@epita.fr>
8688
8689 Also warn about non-used mid-rule values.
8690 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8691 member.
8692 (symbol_list_new): Adjust.
8693 * src/reader.c (symbol_typed_p): New.
8694 (grammar_rule_check): Use it.
8695 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8696 Check its rule.
8697 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8698 Use it.
8699 * tests/actions.at (Exotic Dollars): Adjust.
8700
378f4bd8
AD
87012006-01-04 Akim Demaille <akim@epita.fr>
8702
8703 * src/reader.c (grammar_midrule_action): If $$ is set in a
8704 mid-rule, move the `used' bit to its lhs.
8705 * tests/input.at (Unused values): New.
8706 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8707
e2a21b6f
PE
87082006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8709
54662697
PE
8710 * doc/bison.texinfo (Bison Options): Say more accurately what
8711 --yacc does.
8712 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8713 about declarations in the grammar when in Yacc mode, as POSIX does
8714 not require a diagnostic when the grammar uses extensions.
8715
8716 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
8717
073f9288
PE
8718 Warn about dubious constructions like "%token T T".
8719 Reported by twlevo.
8720 * src/symtab.h (struct symbol.declared): New member.
8721 * src/symtab.c (symbol_new): Initialize it to false.
8722 (symbol_class_set): New arg DECLARING, specifying whether
8723 this is a declaration that we want to warn about, if there
8724 is more than one of them. All uses changed.
8725
1221b78a
PE
8726 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
8727 Allow multiple %union directives, whose contents concatenate.
8728 * src/parse-gram.y (grammar_declaration): Likewise.
8729 Use muscle_code_grow, so that we don't need stype_line any more.
8730 All uses changed.
8731
8732 * src/muscle_tab.c (muscle_grow): Fix comment.
8733
e2a21b6f
PE
8734 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
8735 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
8736 Update copyright year to 2006.
8737
8f7e3cf9
AD
87382006-01-03 Akim Demaille <akim@epita.fr>
8739
8740 Have glr.cc pass (some of) the calc.at tests.
8741 * data/glr.cc (b4_parse_param_orig): New.
8742 (b4_parse_param): Improve its definition, and bound it more
8743 clearly in the skeleton.
8744 (b4_epilogue): Append, instead of prepending, in order to keep
8745 #line consistency.
8746 Simplify the generation of auxiliary functions: locations and
8747 purity are mandated.
8748 (b4_global_tokens_and_yystype): Honor it.
8749 * data/location.cc (c++.m4): Don't include it.
8750 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
8751 and AT_SKEL_CC_IF.
8752 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
8753 AT_LALR1_CC_IF.
8754 Be sure to initialize the first position's filename.
8755 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
8756 mandated anyway.
8757 (AT_CHECK_CALC_GLR_CC): New.
8758 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
8759
3953ed88
AD
87602006-01-02 Akim Demaille <akim@epita.fr>
8761
8762 * src/output.c (output_skeleton): Don't hard wire the inclusion of
8763 c.m4.
0a96ba81 8764 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
8765 * data/glr.cc: Do not include stack.hh.
8766
9ecafbbf
AD
87672006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
8768
8769 * data/glr.c: Reformat whitespace with tabs.
8770 (b4_lpure_formals): Remove this unused m4 macro.
8771 * tests/cxx-type.at: Reformat whitespace with tabs.
8772 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
8773 since it's a member. Rename type to isNterm for clarity.
8774
c4d497a0
AD
87752005-12-29 Akim <akim@sulaco.local>
8776
8777 Let glr.cc catch up with symbol_value_print.
8778 * data/glr.cc (b4_yysymprint_generate): Replace by...
8779 (b4_yy_symbol_print_generate): this.
8780 (yy_symbol_print, yy_symbol_value_print): Declare them.
8781
4517da37
PE
87822005-12-28 Paul Eggert <eggert@cs.ucla.edu>
8783
8784 * src/location.h (boundary): Note that a line or column equal
8785 to INT_MAX indicates an overflow.
8786 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
8787 (rule_length_overflow, increment_rule_length, add_column_width):
8788 New functions.
8789 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
8790 (<SC_BRACED_CODE>"}"):
8791 Use increment_rule_length rather than incrementing it by hand.
8792 (adjust_location, handle_syncline): Diagnose overflow.
8793 (handle_action_dollar, handle_action_at):
8794 Fix bug with monstrosities like $-2147483648.
8795 Remove now-unnecessary checks.
8796 (scan_integer): Verify assumptions and remove now-unnecessary checks.
8797 (convert_ucn_to_byte): Verify assumptions.
8798 (handle_syncline): New arg LOC. All callers changed.
8799 Don't store through a value derived from char const * pointer.
8800
8801 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
8802 GCC warnings.
8803
e3233bf6
PE
88042005-12-27 Paul Eggert <eggert@cs.ucla.edu>
8805
8806 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
8807 Remove unnecessary forward static decls.
8808
8f3596a6
AD
88092005-12-27 Akim Demaille <akim@epita.fr>
8810
8811 * src/reader.c (grammar_current_rule_check): Also check that $$
8812 is used.
8813 Take the rule to check as argument, hence rename as...
8814 (grammar_rule_check): this.
8815 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
8816 Rename as...
8817 (grammar_rule_begin, grammar_rule_end): these, for consistency.
8818 (grammar_midrule_action, grammar_symbol_append): Now static.
8819 * tests/torture.at (input): Don't rely on the default action
8820 being always performed.
8821 * tests/calc.at: "Set" $$ even when the action is "cut" with
8822 YYERROR or other.
8823 * tests/actions.at (Exotic Dollars): Instead of using unused
8824 values, check that the warning is issued.
8825
721be13c
PE
88262005-12-22 Paul Eggert <eggert@cs.ucla.edu>
8827
8828 * NEWS: Improve wording for unused-value warnings.
8829
a0af42fc
AD
88302005-12-22 Akim Demaille <akim@epita.fr>
8831
8832 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
8833 (b4_yysymprint_generate): Rename as...
8834 (b4_yy_symbol_print_generate): this.
8835 Generate yy_symbol_print instead of yysymprint.
8836 Generate also yy_symbol_value_print, and use it.
8837
affac613
AD
88382005-12-22 Akim Demaille <akim@epita.fr>
8839
721be13c 8840 * NEWS: Warn about unused values.
affac613
AD
8841 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
8842 a `used' member.
8843 (symbol_list_n_get, symbol_list_n_used_set): New.
8844 (symbol_list_n_type_name_get): Use symbol_list_n_get.
8845 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
8846 * src/reader.c (grammar_current_rule_check): Check that values are
8847 used.
8848 * src/symtab.c (symbol_print): Accept 0.
8849 * tests/existing.at: Remove the type information.
8850 Empty the actions.
8851 Remove useless actions (beware of mid-rule actions: perl -000
8852 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
8853 * tests/actions.at (Exotic Dollars): Use unused values.
8854 * tests/calc.at: Likewise.
8855 * tests/glr-regression.at (No users destructors if stack 0 deleted):
8856 Likewise.
8857
8858 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
8859 rule_useful_p.
8860
9d9b8b70
PE
88612005-12-21 Paul Eggert <eggert@cs.ucla.edu>
8862
8bb4c753
PE
8863 Undo 2005-12-01 tentative license wording change. The wording is
8864 still being reviewed by the lawyers, and we don't want to wait for
8865 them before publishing a test release. For now, revert to the
8866 previous wording.
8867 * NEWS: Undo 2005-12-01 change.
8868 * data/glr.c: Revert to previous license wording.
8869 * data/glr.cc: Likewise.
8870 * data/lalr1.cc: Likewise.
8871 * data/location.cc: Likewise.
8872 * data/yacc.c: Likewise.
8873
9d9b8b70
PE
8874 * NEWS: Reword %destructor vs YYABORT etc.
8875 * data/glr.c: Use American spacing, for consistency.
8876 * data/glr.cc: Likewise.
8877 * data/lalr1.cc: Likewise.
8878 * data/yacc.c: Likewise.
8879 * data/yacc.c: Reformat comments slightly.
8880 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
8881 for consistency. Fix some spelling errors and reword recently-included
8882 text slightly.
8883 * tests/cxx-type.at: Cast results of malloc, for C++.
8884
2c3b392a
AD
88852005-12-21 Joel E. Denny <address@hidden>
8886
8887 * tests/cxx-type.at: Construct a tree, count the parents of shared
8888 nodes, and free each node once and only once. Previously, the memory
8889 for semantic values was leaked instead.
8890
d6cff4dc
AD
88912005-12-21 Joel E. Denny <address@hidden>
8892
8893 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
8894 (yylval, yylloc): If pure, #define to yystackp->yyval and
8895 yystackp->yyloc similar to yychar and yynerrs.
8896 (yyparse): If pure, remove local yylval and yylloc. Add local
8897 yystackp to accommodate pure definitions of yylval and yylloc.
8898 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
8899 yylvalp and yyllocp to &yylval and &yylloc.
8900 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
8901 namespace. Previously, nerrs and char were missing, but lval and lloc
8902 weren't necessary.
8903 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
8904 yylvalp and yyllocp parameters since, if pure, these are now always
8905 accessible through yystackp. If not pure, they are still accessible
8906 globally.
8907 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
8908 `if (YYID (N))' to pacify lint.
8909
a85284cf
AD
89102005-12-21 Akim Demaille <akim@epita.fr>
8911
8912 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
8913 destroy the RHS symbols of a rule.
8914 * data/yacc.c (yylen): Initialize to 0.
8915 Keep its value to the number of items to possibly shift.
8916 In particular, a regular successful parse that ends on YYFINAL by
8917 a (internal) YYACCEPT must not have yylen != 0.
8918 (yyerrorlab, yyreturn): Pop the RHS.
8919 Reorder a bit to emphasize the `shifting' bits of code.
8920 (YYPOPSTACK): Now accept a number of items to pop.
8921 * data/lalr1.cc: Likewise.
8922 * data/glr.c: Formatting changes.
8923 Use goto instead of fall through.
8924 * doc/bison.texinfo (Destructor Decl): Complete.
8925
d508c281
JMG
89262005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8927
8928 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8929 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
8930 * djgpp/config.bat: Replace every occurence of the file name
8931 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8932 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8933 * djgpp/config.sed: Replace every occurence of the file name
8934 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
8935 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
8936 * djgpp/djunpack.bat: DJGPP specific file.
8937 * djgpp/fnchange.lst: DJGPP specific file.
8938 * djgpp/README.in: Add new information about how to unpack the bison
8939 source on MSDOS and other systems which have 8.3 file name restrictions
8940 using djunpack.bat and fnchange.lst.
8941
3e7a2cd9
PE
89422005-12-12 Paul Eggert <eggert@cs.ucla.edu>
8943
8944 * bootstrap (build_cvs_prefix): Remove; unused.
8945 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
8946 when getting gnulib.
8947
89482005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
8949
8950 * data/glr.c: Reorder typedef declarations for structs to match order
8951 of struct declarations.
8952 Rename yystack everywhere to yystackp except in yyparse where it's not
8953 a pointer.
8954 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
8955 consistency.
8956 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
8957 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
8958 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
8959 lint.
8960
877519f8
PE
89612005-12-09 Paul Eggert <eggert@cs.ucla.edu>
8962
0eca5a39
PE
8963 * tests/sets.at (Accept): Fix typos in regular expression used to
8964 sed out the final state number.
8965
2cec9080
PE
8966 Work around portability problem on Solaris 10: flex-generated
8967 files include <stdio.h> before <config.h>, which messes up
8968 because the latter defines __EXTENSIONS__. Address the problem
8969 by creating two new little files that include <config.h> first,
8970 then include the flex-generated files. Rewrite everyone else
8971 to include <config.h> first, as well.
8972 * lib/timevar.c: Always include "config.h".
8973 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
8974 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
8975 (EXTRA_bison_SOURCES): New macro.
8976 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
8977 * src/system.h: Don't include config.h.
8978 * src/LR0.c: Include <config.h> first.
8979 * src/assoc.c: Likewise.
8980 * src/closure.c: Likewise.
8981 * src/complain.c: Likewise.
8982 * src/conflicts.c: Likewise.
8983 * src/derives.c: Likewise.
8984 * src/files.c: Likewise.
8985 * src/getargs.c: Likewise.
8986 * src/gram.c: Likewise.
8987 * src/lalr.c: Likewise.
8988 * src/location.c: Likewise.
8989 * src/main.c: Likewise.
8990 * src/muscle_tab.c: Likewise.
8991 * src/nullable.c: Likewise.
8992 * src/output.c: Likewise.
8993 * src/parse-gram.y: Likewise.
8994 * src/print.c: Likewise.
8995 * src/print_graph.c: Likewise.
8996 * src/reader.c: Likewise.
8997 * src/reduce.c: Likewise.
8998 * src/relation.c: Likewise.
8999 * src/state.c: Likewise.
9000 * src/symlist.c: Likewise.
9001 * src/symtab.c: Likewise.
9002 * src/tables.c: Likewise.
9003 * src/uniqstr.c: Likewise.
9004 * src/vcg.c: Likewise.
9005
877519f8
PE
9006 * src/parse-gram.y: Fix minor problems uncovered by lint.
9007 (current_lhs, current_lhs_location): Now static.
9008 (current_assoc): Remove unused variable.
9009
9010 Cleanups so that Bison-generated parsers have less lint.
9011 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9012 Prepend /*ARGSUSED*/, for lint's sake.
9013 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9014 definition if 'lint' is defined.
9015 (YYID): New macro (or function, if lint).
9016 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9017 * data/yacc.c: Likewise.
9018 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9019 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9020 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9021 is C++ only.
9022 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9023 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9024 Use YYID(0) rather than 0, for lint.
9025 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9026 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9027
f5228370
PE
90282005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9029
9030 * tests/glr-regression.at
9031 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9032 Close memory leak reported by twlevo.
9033
69ce078b
PE
90342005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9035
6ff99711
PE
9036 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9037 all stacks.
9038 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
9039 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9040 New test case.
9041 (Duplicated user destructor for lookahead): This test now is expected
9042 to succeed.
9043
af3412cd
PE
90442005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9045
32b5b719 9046 * NEWS: Document the following change.
af3412cd
PE
9047 * data/yacc.c: Say "parser skeleton" rather than "file", since
9048 it's no longer just a file.
9049 * data/glr.c: Grant a special exception for C GLR parsers, that
9050 reads like the already-existing exception for C LALR(1) parsers.
9051 * data/glr.cc: Likewise.
9052 * data/lalr1.cc: Likewise.
9053 * data/location.cc: Likewise.
9054 * data/yacc.c: Reword the "written by" statement to clarify that
9055 it was the parser skeleton, not the entire output file.
9056 * data/glr.c: Written by Paul Hilfinger.
9057 * data/glr.cc: Written by Akim Demaille.
9058 * data/lalr1.cc: Likewise.
9059
035aa4a0
PE
90602005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9061
d9963c85
PE
9062 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9063 Fix typos in previous change that broke 'make check'.
9064 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9065 supported in C.
9066 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9067 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9068 We can revert this once things settle down.
9069
035aa4a0
PE
9070 * src/conflicts.c (conflicts_print): Don't print file name twice
9071 when %expect fails because there were no conflicts.
9072 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9073 change.
9074 * tests/conflicts.at (%expect not enough, %expect too much):
9075 (%expect with reduce conflicts): Adjust to new behavior.
9076
90772005-11-18 Akim Demaille <akim@epita.fr>
9078
9079 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9080 errors.
9081 * NEWS: Document this.
9082 * doc/bison.texinfo (Expect Decl): Likewise.
9083
d1ff7a7c
AD
90842005-11-16 Akim Demaille <akim@epita.fr>
9085
9086 Generalize the display of semantic values and locations in traces.
9087 * data/glr.c (yy_reduce_print): Fix indices (again).
9088 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9089 literal integers.
9090 * data/lalr1.cc (yyreduce_print): Rename as...
9091 (yy_reduce_print): this.
9092 Display values and locations.
9093 * data/yacc.c (yy_reduce_print): Likewise.
9094 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9095 (yysymprint): Move higher to be visible from yy_reduce_print).
9096 (yyparse): Adjust.
9097 * tests/calc.at: Adjust the expected length of the traces.
9098
6de5398d
AD
90992005-11-14 Akim Demaille <akim@epita.fr>
9100
9101 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9102 from 1 to N, while values and location start at 0.
9103 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9104
a1373f55
AD
91052005-11-14 Akim Demaille <akim@epita.fr>
9106
9107 * data/glr.c (yy_reduce_print): Fix the $ number.
9108
613d8952
AD
91092005-11-14 Akim Demaille <akim@epita.fr>
9110
9111 "Use" parse parameters.
9112 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9113 * data/glr.c, data/glr.cc: Use them.
9114 * data/glr.c (YYUSE): Have a C++ definition that supports
9115 non-pointer types.
9116
b2741627
AD
91172005-11-14 Akim Demaille <akim@epita.fr>
9118
9119 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9120
5059b5c8
AD
91212005-11-14 Akim Demaille <akim@epita.fr>
9122
42249483
AD
9123 * data/glr.cc: New.
9124 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 9125
4626a15d
AD
91262005-11-12 Akim Demaille <akim@epita.fr>
9127
9128 Let position and location be PODs.
9129 * data/location.cc (position::initialize, location::initialize): New.
9130 (position::position, location::location): Define only if
9131 b4_location_constructors is defined.
9132 * data/lalr1.cc (b4_location_constructors): Define it for backward
9133 compatibility.
9134 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9135
91362005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
9137
9138 * data/lalr1.cc: Move the body of the ctor and dtor into the
9139 parser file (instead of the header).
9140 Wrap the implementations in a "namespace yy".
9141
91422005-11-12 Akim Demaille <akim@epita.fr>
9143
9144 Have glr.c include its header file when created.
9145 * data/glr.c (b4_shared_declarations): New.
9146 Output them verbatim in the parser if !%defines, otherwise
9147 output then in the header file, and include it instead.
9148
1989d947
AD
91492005-11-11 Akim Demaille <akim@epita.fr>
9150
9151 * data/glr.c: Comment changes.
9152
91532005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9154
9155 When yydebug, report semantic and location values for reductions.
9156 * data/glr.c (yy_reduce_print): Report the semantic values and the
9157 locations.
9158 (YY_REDUCE_PRINT): Adjust.
9159 (yyglrReduce): Use them.
9160 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9161 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9162 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9163 traces.
9164
02998094
AD
91652005-11-10 Akim Demaille <akim@epita.fr>
9166
9167 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9168 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9169 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9170
5210672f
PE
91712005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9172
9173 * m4/cxx.m4, examples/Makefile.am: Don't build
9174 examples/calc++ if no C++ compiler is available. (trivial change)
9175
a8991a1d
AD
91762005-11-09 Akim Demaille <akim@epita.fr>
9177
9178 * src/scan-skel.l: Use a couple of asserts.
9179
36b5e963
AD
91802005-11-03 Akim Demaille <akim@epita.fr>
9181
9182 In some (weird) cases, the final state number is incorrect.
9183 Reported by Alexandre Duret-Lutz.
9184 * src/LR0.c (state_list_append): Remove the computation of
9185 final_state.
9186 (save_reductions): Do it here.
9187 (get_state): Alpha conversion.
9188 (generate_states): Use a for loop.
9189 * src/gram.h (item_number_is_rule_number)
9190 (item_number_is_symbol_number): New.
9191 * src/state.c: Use assert.
9192 * src/system.h: Include assert.h.
9193 * tests/sets.at (Accept): New.
9194
44e7ead1
PH
91952005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9196
9197 * data/glr.c (yyfill): Adjust comment.
36b5e963 9198 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9199 for empty right-hand sides.
9200 (yydoAction): Ditto.
9201 Add comment explaining apparently dead code.
36b5e963
AD
9202 * tests/glr-regression.at
9203 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9204 New test.
36b5e963 9205
e10a80ee
PE
92062005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9207
9208 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9209 gnulib when interrupted. This fixes some race conditions and
9210 works around some portability problems (one noted by Paul
9211 Hilfinger).
9212
067b32ee
AD
92132005-10-22 Akim <akim@epita.fr>
9214
9215 * Makefile.cfg: Adjust to config -> build-aux.
9216 Reported by twledo.
9217
4b367315
AD
92182005-10-21 Akim Demaille <akim@epita.fr>
9219
9220 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9221 the %parse-params.
9222 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9223 * data/yacc.c (b4_Pure_if): Rename as...
9224 (b4_yacc_pure_if): this.
9225 (YY_SYMBOL_PRINT, yyparse): Adjust.
9226 * doc/bison.texinfo: Formatting changes.
9227
24cc23d9
AD
92282005-10-21 Akim Demaille <akim@epita.fr>
9229
9230 Finish the transition config -> build-aux.
9231 * configure.ac, Makefile.am: Use build-aux.
9232 * config/prev-version, config/announce-gen, config/Makefile.am:
9233 Move to...
9234 * build-aux/prev-version, build-aux/announce-gen,
9235 * build-aux/Makefile.am: here.
9236
d4476375
AD
92372005-10-14 Akim Demaille <akim@epita.fr>
9238
9239 * examples/calc++/test: Use set -x only when VERBOSE.
9240
302c0aee
PE
92412005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9242
9243 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9244 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9245
7625ec2c
AD
92462005-10-13 Akim Demaille <akim@epita.fr>
9247
9248 * src/scan-skel.l: Output the base name parts of the parser and
9249 header file names.
302c0aee 9250 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9251 additional checks.
9252 Use this to exercise C++ outputs in subdirs.
9253 Reported by Oleg Smolsky.
9254
ba0fe3c7
PE
92552005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9256
9257 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9258 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9259 Problem reported by John P. Hartmann.
9260 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9261 already defined it.
9262
9b8a5ce0
AD
92632005-10-12 Akim Demaille <akim@epita.fr>
9264
9265 * src/parse-gram.y (version_check): Exit 63 to please missing
9266 (stands for "version mismatch).
9267 * tests/input.at, doc/bison.texinfo: Adjust.
9268
4f6e011e
PE
92692005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9270
9271 Work around portability problems with Visual Age C compiler
9272 (xlc and xlC_r) reported by John P. Hartmann.
9273 * data/location.cc (initial_column, initial_line): Remove.
9274 All uses replaced by 0 and 1.
9275 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9276 that xlc complains about.
9277 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9278 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9279 as __STDC__.
4d7aa45e
PE
9280 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9281 __STDC_VERSION__. Use it everywhere instead of looking at
9282 __STDC__ and __cplusplus.
4f6e011e 9283
a1b3bf8c
AD
92842005-10-10 Akim Demaille <akim@epita.fr>
9285
9286 * examples/calc++/test: Be quiet unless VERBOSE.
9287
412e44aa
PE
92882005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9289
2a4647a3
PE
9290 * data/c.m4 (yydestruct, yysymprint):
9291 Use YYUSE instead of casting to void.
9292 * data/glr.c (YYUSE): New macro.
9293 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9294 Use it instead of rolling our own.
9295 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9296 (YYCHK1):
9297 Use /*CONSTCOND*/ to suppress lint warnings.
9298 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9299 (YY_STACK_PRINT): Use 'false' not '0'.
9300 (YYUSE): New macro.
9301 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9302 * data/yacc.c (YYUSE): New macro.
9303 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9304 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9305 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9306
9307
412e44aa
PE
9308 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9309 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9310
88c6637f
PE
93112005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9312
2f4f028d
PE
9313 Undo the parts of the unlocked-I/O change that substituted
9314 putc or puts for printf. This might hurt performance a bit,
9315 but some people prefer the printf style.
9316 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9317 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9318 All uses replaced by YYFPRINTF and YYDPRINTF.
9319 * data/yacc.c: Likewise.
9320 * lib/bitset.c (bitset_print): Likewise.
9321 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9322 putc and puts.
9323 * lib/lbitset.c (debug_lbitset): Likewise.
9324 * src/closure.c (print_firsts, print_fderives): Likewise.
9325 * src/gram.c (grammar_dump): Likewise.
9326 * src/lalr.c (look_ahead_tokens_print): Likewise.
9327 * src/output.c (escaped_output): Likewise.
9328 (user_actions_output): Break apart two printfs.
9329 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9330 * src/reduce.c (reduce_print): Likewise.
9331 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9332 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9333
88c6637f
PE
9334 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9335 Use assignments rather than casts-to-void to suppress
9336 unused-variable warnings. This pacifies 'lint'.
9337 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9338 unused-variable warnings.
9339
fb32e373
JMG
93402005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9341
9342 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9343
edb8f44f
PE
93442005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9345
fb9c0b33
PE
9346 Use unlocked I/O for a minor performance improvement on hosts like
9347 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9348 is to use the gnlib unlocked-io module, and to prefer putc and
9349 puts to printf when either will work (since the latter doesn't
9350 come in an unlocked flavor).
9351 * bootstrap (gnulib_modules): Add unlocked-io.
9352 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9353 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9354 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9355 and similarly for puts and putc and printf.
9356 * data/yacc.c: Likewise.
9357 * lib/bitset.c (bitset_print): Likewise.
9358 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9359 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9360 to printf.
9361 * lib/lbitset.c (debug_lbitset): Likewise.
9362 * src/closure.c (print_firsts, print_fderives): Likewise.
9363 * src/gram.c (grammar_dump): Likewise.
9364 * src/lalr.c (look_ahead_tokens_print): Likewise.
9365 * src/output.c (escaped_output): Likewise.
9366 (user_actions_output): Coalesce two printfs.
2f4f028d 9367 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
9368 * src/reduce.c (reduce_print): Likewise.
9369 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 9370 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 9371
edb8f44f
PE
9372 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9373 this confuses xgettext.
9374
b50d2359
AD
93752005-10-02 Akim Demaille <akim@epita.fr>
9376
9377 * bootstrap (gnulib_modules): Add strverscmp.
9378 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9379 * m4/.cvsignore: Add strverscmp.m4.
9380 * src/parse-gram.y (%require): New token, new rule.
9381 (version_check): New.
9382 * src/scan-gram.l (%require): Adjust.
9383 * tests/input.at (AT_REQUIRE): New.
9384 Use it.
9385 * doc/bison.texinfo (Require Decl): New.
9386 (Calc++ Parser): Use %require.
9387
21667f64
AD
93882005-10-02 Akim Demaille <akim@epita.fr>
9389
9390 * data/location.cc: New.
9391
2b81e969
AD
93922005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9393 Akim Demaille <akim@epita.fr>
9394
9395 Make sure -odir/foo.cc creates dir/location.hh etc.
9396 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9397 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9398 (spec_defines_file): Now const.
9399 (dir_prefix): New.
9400 (short_base_name): Remove.
9401 * src/files.c: Adjust.
9402 (dirname.h): Include.
9403 (base_name): Don't prototype it.
9404 (finput): Remove, duplicates gram_in.
9405 (full_base_name, short_base_name): Replace by...
9406 (all_but_ext, all_but_tab_ext): these.
9407 (compute_base_names): Rename as...
9408 (compute_file_name_parts): this.
9409 Update to compute the new variables, including dir_prefix.
9410 Adjust dependencies.
9411 * src/output.c (prepare): Output them.
9412 * src/reader.c: Adjust to use gram_in, not finput.
9413 * src/scan-skel.l (@dir_prefix@): New.
9414
ad6a9b97
JMG
94152005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9416
9417 * lib/subpipe.c: New function end_of_output_subpipe() added
9418 to allow support for non-posix systems. This is a no-op function
9419 for posix systems.
9420
9421 * lib/subpipe.h: New function end_of_output_subpipe() added
9422 to allow support for non-posix systems. This is a no-op function
9423 for posix systems.
9424
9425 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9426 handle the lack of pipe/fork functionality on non-posix systems.
9427
9428 * djgpp/Makefile.maint: DJGPP specific file.
9429
9430 * djgpp/README.in: DJGPP specific file.
9431
9432 * djgpp/config.bat: DJGPP specific configuration file.
9433
9434 * djgpp/config.sed: DJGPP specific configuration file.
9435
9436 * djgpp/config.site: DJGPP specific configuration file.
9437
9438 * djgpp/config_h.sed: DJGPP specific configuration file.
9439
9440 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9441
9442 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9443
fc695704
AD
94442005-10-02 Akim Demaille <akim@epita.fr>
9445
9446 * data/location.cc: New, extract from...
9447 * data/lalr1.cc: here.
9448 (location.hh): Include it after the user prologue, in case the
9449 filename type is defined by the user.
9450 Forward declation location and position before the pre-prologue.
9451 (yyresult_): Rename as...
9452 (yyresult): this, it's a local variable, not an attribute.
9453 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9454
94552005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
9456
9457 * examples/extexi: Restore the #line generation.
9458
fb9712a9
AD
94592005-09-30 Akim Demaille <akim@epita.fr>,
9460 Alexandre Duret-Lutz <adl@gnu.org>
9461
9462 Move the token type and YYSTYPE in the parser class.
9463 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9464 (parser::token): New, from the moved free definition of tokens.
9465 (parser::semantic_value): Now a full definition instead of an
9466 indirection to YYSTYPE.
9467 (b4_post_prologue): No longer included in the header file, but
9468 in the implementation file.
9469 * doc/bison.texi (C+ Language Interface): Update.
9470 * src/parse-gram.y: Support unary %define.
9471 * tests/actions.at: Define global_tokens_and_yystype for backward
9472 compatibility until we update the tests.
9473 * tests/calc.at: Idem.
9474 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9475 to simplify the code.
9476
55f0c7b1
PE
94772005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9478
9479 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9480 Ah, the good old days! Problem reported by Peter Klein.
9481 * bootstrap (gnulib_modules): Add strerror, strtoul.
9482 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9483 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9484
fb9712a9 94852005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
9486
9487 * data/c.m4 (b4_error_verbose_if): New.
9488 * data/lalr1.cc: Use it.
9489 (YYERROR_VERBOSE_IF): Remove.
9490 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9491 parser members, replaced by...
9492 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9493 local variables.
9494 (yysyntax_error_): Takes the state number as argument.
9495 (yyreduce_print_): Use the argument yyrule, not the former
9496 attribute yyn_.
9497
8a6f72f3
PE
94982005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9499
9500 * bootstrap (gnulib_modules): Add verify.
9501 * lib/.cvsignore: Add verify.h.
9502 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9503 * src/system.h (verify): Remove.
9504 Include verify.h instead.
9505 * src/tables.c (tables_generate): Use new API for 'verify'.
9506
0d50976f
PE
95072005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9508
ebc3737e
PE
9509 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9510 local variables whose names begin with 'yy'.
9511 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9512 Trivial changes from Joel E. Denny.
9513
0d50976f
PE
9514 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9515 it itself.
9516 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9517 don't use alloca any more.
9518
9519 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9520 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 9521 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
9522 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9523 to match yacc.c, to test more hosts.
9524
a05b79df
PE
95252005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9526
55289366
PE
9527 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9528 doesn't affect behavior.
9529 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9530 Solaris, AIX, MSC.
9531 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9532 This works a bit better with glibc, if user code has already included
9533 stdlib.h.
9534 * doc/bison.texinfo (Bison Parser): Document that users can't
9535 arbitrarily use malloc and free for other purposes. Document
9536 that <alloca.h> and <malloc.h> might be included.
9537 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9538 user must declare alloca.
9539
a05b79df
PE
9540 * HACKING (release): Forwarn the Translation Project about
9541 stable releses.
9542
3ab2ca22
AD
95432005-09-20 Akim Demaille <akim@epita.fr>
9544
9545 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9546
a9739e7c
PE
95472005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9548
a702593e
PE
9549 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9550 (YYSTACK_ALLOC_MAXIMUM): Use it.
9551 (yysyntax_error): New function.
9552 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9553 multiple syntax errors are reported, and alloca is being used.
9554 Instead, reallocate buffers twice as big each time, so that
9555 we waste at most half the allocated memory. Start with a small
9556 (128-byte) buffer that will suffice in most cases anyway.
9557 Use yysyntax_error to do most of the work.
9558
9559 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9560 yynerrs is the number of errors reported, not the number of
9561 errors encountered.
9562
a9739e7c
PE
9563 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9564 Mark it as expected to fail.
9565 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9566 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9567 Don't start user-code symbols with "yy", to avoid name space problems.
9568
f479c6c6
AD
95692005-09-19 Akim Demaille <akim@epita.fr>
9570
9571 Remove the traits, failed experiment.
9572 It never proved useful, and anyway because of the current
9573 definition, it was not possible to have several specialization of
9574 this traits, making it useless.
9575 * data/lalr1.cc (yy:traits): Remove.
9576 Inline its definitions in the parser class.
9577
e2586f82
AD
95782005-09-19 Akim Demaille <akim@epita.fr>
9579
9580 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9581 least Mac OSX with a /usr/local install of gettext.
9582
2e8cf949
AD
95832005-09-19 Akim Demaille <akim@epita.fr>
9584
9585 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9586 and yytoken for similarity with the other skeletons.
9587
c7fb0b90
AD
95882005-09-19 Akim Demaille <akim@epita.fr>
9589
4e26c69e 9590 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 9591
1bd0deda
PE
95922005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9593
9594 * NEWS: Version 2.1.
9595
9596 * NEWS: Remove notice of yytname change, since it was never in an
9597 official release.
9598 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9599 diagnostic.
9600 * src/output.c (prepare): Likewise.
9601 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9602 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9603 is not defined. This is an awful hack, but it's enough for now.
9604 All callers changed.
9605 * tests/glr-regression-at (make_value): Args are const pointers now,
9606 to avoid GCC warning.
9607 (Duplicated user destructor for lookahead): New test. Currently
9608 skipped. It fails on my host but I'm not sure it'll always fail.
9609
96102005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
9611
9612 * src/symtab.h (struct symbol): Declare the printer and destructor
9613 as const, to avoid accidental calls to free.
9614 (symbol_destructor_set, symbol_printer_set): Adjust.
9615 * src/symtab.c: Adjust.
9616
1bd0deda 96172005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
9618
9619 * data/c.m4 (b4_token_enums): New.
9620 (b4_token_defines): Rename as...
9621 (b4_token_enums_defines): this.
9622 (b4_token_defines): New, output only the #defines.
9623 * data/yacc.c, data/glr.c: Adjust.
9624 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9625 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9626 as default values.
9627
dbcdae2d
AD
96282005-09-16 Akim Demaille <akim@epita.fr>
9629
9630 * data/lalr1.cc (yylex_): Remove, inline its code.
9631 (yyreport_syntax_error_): Remove, replaced by...
9632 (yysyntax_error_): this which returns a string and leaves to the
9633 caller the call to the users' error function.
9634 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9635 Move from members of the parser object...
9636 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9637 to local variables of the parse function.
9638
70d8f291
AD
96392005-09-16 Akim Demaille <akim@epita.fr>
9640
9641 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9642 since it's in Bison's name space.
9643
b47dbebe
PE
96442005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9645
ae199bf1
PE
9646 * data/glr.c (yyresolveValue): Add default case to pacify
9647 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9648
b47dbebe
PE
9649 * NEWS: Document when yyparse started to return 2.
9650 * doc/bison.texinfo (Parser Function): Document when yyparse
9651 returns 2.
9652
9653 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9654 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9655 changed.
9656 (class position): file_name -> filename (reverting). All uses changed.
9657
96582005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9659
9660 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9661 do anything if $@ exists. This reverts part of the 2005-07-07
9662 patch.
9663
00292f66
PE
96642005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9665
9666 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9667 contains obsolete information and isn't worth distributing as a
9668 separate file anyway.
9669 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9670 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9671 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9672 (yyparse): Abort if user code uses longjmp to throw an unexpected
9673 value.
9674
a420f962
PE
96752005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9676
00292f66
PE
9677 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9678 Suggested by twlevo@xs4all.nl.
9679
127287e9
PE
9680 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9681 This avoids a diagnostic from gcc -Wswitch-enum.
9682 Problem reported by twlevo@xs4all.nl.
9683
a420f962
PE
9684 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9685 standards. Use "file name" or "file" or "name", depending on
9686 the context.
9687 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9688 not to hack/foo.tab.c.
9689 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
9690 * data/glr.c: b4_filename -> b4_file_name.
9691 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9692 All uses changed.
9693 (class position): filename -> file_name. All uses changed.
9694 * data/yacc.c: b4_filename -> b4_file_name.
9695 * lib/bitset.h: filename -> file_name in local vars.
9696 * lib/bitset_stats.c: Likewise.
9697 * src/files.c: Likewise.
9698 * src/scan-skel.l ("@output ".*\n): Likewise.
9699 * src/files.c (file_name_split): Renamed from filename_split.
9700 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
9701
97022005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9703
9704 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9705 to accommodate latest gnulib.
9706
9707 * tests/glr-regression.at (Duplicate representation of merged trees):
9708 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9709
9710 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9711 needed.
9712
42a6501d
PE
97132005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9714
9715 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
9716 All uses changed. Invoke user destructor after an error during a
9717 split parse (trivial change from Joel E. Denny).
9718
9719 * tests/glr-regression.at
9720 (User destructor after an error during a split parse): New test case.
9721 Problem reported by Joel E. Denny in:
9722 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
9723
ef9a1faf
PE
97242005-08-25 Paul Eggert <eggert@cs.ucla.edu>
9725
5b4aaf78
PE
9726 * README-cvs: Give URLs for recommended tools.
9727 Mention Gzip version problem, and bootstrapping issues.
9728 Remove troubleshooting section, as it's somewhat obsolete.
9729
b5240ba5
PE
9730 * bootstrap (no_cache): New var, to accommodate different wget
9731 variants. Use it instead of '-C off'. Problem reported by
9732 twlevo@xs4all.nl.
9733
ef9a1faf
PE
9734 * data/glr.c (yydestroyStackItem): New function.
9735 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
9736 debugging information. Problem reported by Joel E. Denny.
9737
e6efa9da
AD
97382005-08-25 Akim Demaille <akim@epita.fr>
9739
9740 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
9741
adc90f13
PE
97422005-08-24 Paul Eggert <eggert@cs.ucla.edu>
9743
9744 * data/glr.c (yyrecoverSyntaxError, yyreturn):
9745 Don't invoke destructor on unresolved entries.
9746 * tests/glr-regression.at
9747 (User destructor for unresolved GLR semantic value): New test case.
9748 Problem reported by Joel E. Denny in:
9749 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
9750
f9315de5
PE
97512005-08-21 Paul Eggert <eggert@cs.ucla.edu>
9752
15d29c1f
PE
9753 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
9754 Add strnlen.c.
9755 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
9756 lib-prefix.m4, po.m4.
9757
dd5f2af2
PE
9758 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
9759 in yydestruct diagnostic, since it might not be an error.
9760 Problem reported by Joel Denny near end of
9761 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 9762 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
9763 * data/yacc.c (yyreturn): Likewise.
9764 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
9765
9766 * src/files.c: Remove obsolete FIXME comment.
9767
9768 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
9769 with the other templates, and to fix bogus run-on messages such
9770 as the one reported at the end of
9771 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
9772 All callers changed to avoid the newline.
9773 (yyprocessOneStack): Output two lines rather than one, to accommodate
9774 the above change. This changes the debug output format slightly.
9775
f9315de5
PE
9776 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
9777 reported by Joel E. Denny in
9778 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
9779 (trivial change).
9780 * tests/glr-regression.at (Duplicate representation of merged trees):
9781 New test, from Joel E. Denny in:
9782 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
9783 * THANKS: Add Joel E. Denny.
9784
9785 * configure.ac (AC_INIT): Bump to 2.0c.
9786
04098407
PE
97872005-07-24 Paul Eggert <eggert@cs.ucla.edu>
9788
9789 * NEWS: Version 2.0b.
9790
ca5d2013
PE
9791 * Makefile.am (SUBDIRS): Put examples before tests, so that
9792 "make check" doesn't finish with "All 1 tests passed".
9793
3d54b576
PE
9794 * tests/regression.at (Token definitions): Don't rely on
9795 AT_PARSER_CHECK for data that contains backslashes. It currently
9796 uses 'echo', and 'echo' isn't portable if its argument contains
9797 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
9798 that the byte '\0xff' is not printable in the C locale; it is,
9799 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
9800 not printable, so use '\0x81' to test.
9801
d53ae497
PE
9802 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
9803 version of GCC, since the macro is used with non-GCC compilers.
9804
fc01665e
PE
9805 Fix core dump reported by Pablo De Napoli in
9806 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
9807 * tests/regression.at (Invalid inputs with {}): New test.
9808 * src/parse-gram.y (token_name): Translate type before using
9809 it as an index.
9810
04098407
PE
9811 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
9812 the user's name space. All uses changed to __attribute__
9813 ((__unused__)).
9814 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
9815 Add __attribute__ ((__noreturn__)).
9816
9817 * etc/clcommit: Remove. We weren't using it, and it failed
9818 "make maintainer-distcheck".
9819 * Makefile.maint: Merge from coreutils.
9820 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
9821 (syntax-check-rules): Change list of rules as described below.
9822 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
9823 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
9824 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
9825 (sc_trailing_space): New rules.
9826 (sc_xalloc_h_in_src): Remove.
9827 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
9828 (sc_space_tab, sc_error_exit_success, sc_changelog):
9829 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
9830 (makefile-check, po-check, author_mark_check):
9831 (makefile_path_separator_check, copyright-check):
9832 Use grep -n, to make it easier to find violations.
9833 Use CVS_LIST and CVS_LIST_EXCEPT.
9834 (header_regexp, h_re): Remove.
9835 (dd_c): New macro.
9836 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
9837 (my-distcheck): Use more-modern GCC flags.
9838 (signatures, %.asc): Remove.
9839 (rel-files, announcement): Remove signatures.
9840 Restore old updating code, even though we don't use it, so
9841 that we're the same as coreutils.
9842 (alpha, beta, major): Depend on news-date-check.
9843 Make the upload commands.
9844
9845 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
9846 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
9847 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
9848 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
9849 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
9850 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
9851 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
9852 * tests/sets.at: Likewise.
9853
9854 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
9855 we comment out the Autoconf version number.
9856 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
9857 it's error-prone and "make maintainer-distcheck" rejects it.
9858
9859 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
9860 Indent calls to "error" to pacify "make maintainer-distcheck",
9861 when the calls are not intended to be translated.
9862 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
9863
9864 * src/Makefile.am (DEFS): Use +=, to pacify
9865 "make maintainer-distcheck".
9866 (bison_SOURCES): Add scan-skel.h.
9867 (sc_tight_scope): New rule, from coreutils.
9868
9869 * src/files.c (src_extension, header_extension):
9870 Now static, not extern.
9871 * src/getargs.c (short_options): Likewise.
9872 * src/muscle_tab.c (muscle_table): Likewise.
9873 * src/parse-gram.y (current_class, current_type, current_prec):
9874 Likewise.
9875 * src/reader.c (grammar_end, previous_rule_end): Likewise.
9876 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
9877 * src/main.c (main): Cast bindtextdomain and textdomain calls to
9878 void, to avoid warning when NLS is disabled.
9879 * src/output.c: Include scan-skel.h.
9880 (scan_skel): Remove decl, since scan-skel.h does this.
9881 (output_skeleton):
9882 Indent calls to "error" to pacify "make maintainer-distcheck".
9883 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
9884 * src/reader.h (gram_end, gram_lineno): New decls to pacify
9885 "make maintainer-distcheck".
9886 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
9887 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
9888 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
9889 (skel_lex_destroy, scan_skel): Move these decls to...
9890 * src/scan-skel.h: New file.
9891 * src/uniqstr.c (uniqstr_assert):
9892 Indent calls to "error" to pacify "make maintainer-distcheck".
9893
9894 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
9895 not @VAR@.
9896
9897 * tests/torture.at: Revamp to avoid misuse of atoi that
9898 "make maintainer-distcheck" complained about.
9899
9900 * examples/extexi (message): Don't print a message more than once,
9901 and omit line-number decoration that makes Emacs compile think
9902 that informative messages are worth worrying about.
9903
99042005-07-22 Paul Eggert <eggert@cs.ucla.edu>
9905
9906 * configure.ac: Update version number.
9907
9908 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
9909 accidentally.
9910 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
9911 autogenerated by the maintainer.
9912 * examples/calc++/.cvsignore: Add *.yy.
9913
9914 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
9915 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9916 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9917
9918 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
9919
9920 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
9921 from maintainer-distcheck about casting the argument of 'free'.
9922
9923 * NEWS: Mention recent yytname changes.
9924 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
9925
9926 * bootstrap: For translations that have not yet been upgraded to
9927 the new runtime-po domain, prime the pump by extracting the
9928 relevant strings from the obsolete translations. This code can be
9929 removed once the bison-runtime domain has been translated by each
9930 team.
9931
9932 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
9933 now that token names are already quoted.
9934
9935 Fix problem reported by Anthony Heading.
9936 * data/glr.c (YYTOKEN_TABLE): New macro.
9937 (yytname): Define if YYTOKEN_TABLE.
9938 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
9939 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
9940 (YYERROR_VERBOSE): Define the same way the other skeletons do.
9941 * src/output.c (prepare_symbols): Output token_table_flag.
9942
0ffda363
PE
99432005-07-21 Paul Eggert <eggert@cs.ucla.edu>
9944
9945 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
9946 again if the first call fails.
9947
9948 * data/glr.c (yytnamerr): New function.
9949 (yyreportSyntaxError): Use it to dequote most string literals.
9950 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
9951 with other skeletons. All uses changed.
9952 (yytnameerr_): New function.
9953 (yyreport_syntax_error): Use it to dequote most string literals.
9954 * data/yacc.c (yytnamerr): New function.
9955 (yyerrlab): Use it to decode most string literals.
9956 * doc/bison.texinfo (Decl Summary, Calling Convention):
9957 Clarify quoting convention of yytname.
9958 * src/output.c (prepare_symbols): Quote all names. This undoes
9959 the 2005-04-17 change, which is now accomplished (mostly) via
9960 changes in the parsers as described above.
9961 * tests/regression.at (Token definitions, Web2c Actions):
9962 Undo most 2005-04-17 change here, too.
9963
99642005-07-20 Paul Eggert <eggert@cs.ucla.edu>
9965
9966 Fix more problems reported by twlevo@xs4all.nl.
9967 * tests/cxx-type.at: Don't pipe output of ./types through sed to
9968 remove trailing spaces. This loses the exit status of ./types,
9969 and isn't needed since ./types shouldn't be emitting trailing
9970 spaces.
9971 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
9972 as the stack isn't valid in that case.
9973
9974 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9975 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9976 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9977 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
9978 is used.
9979 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
9980 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9981 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9982 Likewise.
9983
9984 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
9985 overly-picky compilers that reject 'char *foo = "bar";'.
9986
9987 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
9988 to FILE * parameter, not to stderr. This fixes a typo introduced
9989 in the 2005-07-12 change.
9990
9991 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
9992 warnings from GCC 4.
9993
9994 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
9995 (yyglrShiftDefer, yysplitStack):
9996 Remove unused parameters b4_pure_formals. All uses changed.
9997 (yyglrShift): Remove unused parameters b4_user_formals.
9998 All uses changed.
9999 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10000
6100a9aa
PE
100012005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10002
258b75ca
PE
10003 Destructor cleanups and regularization among the three skeletons.
10004 * NEWS: Document the behavior changes.
10005 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10006 stack before failing, as the cleanup code will do it for us now.
10007 * data/lalr1.cc (yyerrlab): Likewise.
10008 * data/glr.c (yyparse): Pop everything off the stack before
10009 freeing it, so that destructors get called properly.
10010 * data/lalr1.cc (yyreturn): Likewise.
10011 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10012 This is more consistent.
10013 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10014 why destructors might be called. 1.875 -> 2.1.
10015 (Destructor Decl, Decl Summary, Table of Symbols):
10016 Some English-language cleanups for %destructor.
10017 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10018 Add output line for destructor of start symbol.
10019 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10020 because of that same extra output line.
10021
1a059451
PE
10022 * NEWS: Document minor wording changes in diagnostics of
10023 Bison-generated parsers.
10024 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10025 Remove unused formals. All uses changed.
10026 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10027 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10028 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10029 Rename yyoverflowab to yyexhaustedlab.
10030 When memory exhaustion occurs during syntax-error reporting,
10031 report it separately rather than in a single diagnostic; this
10032 eases translation.
10033 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10034 (Memory Exhausted): Renamed from Parser Stack Overflow.
10035 Revamp wording slightly to prefer "memory exhaustion".
10036 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10037
97460c78
PE
10038 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10039
30757c8c
PE
10040 Add i18n support to the GLR skeleton. Partially fix the C++
10041 skeleton; a C++ expert needs to finish this. Remove debugging
10042 msgids; there's little point to having them translated, since they
10043 can be understood only by someone who can read the
10044 (English-language) source code.
10045
10046 Generate runtime-po/bison-runtime.pot automatically, so that we
10047 don't have to worry about garbage getting in that file. We'll
10048 make sure after the next official release that old msgids don't
10049 get lost. See
10050 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10051
10052 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10053 Now auto-generated.
10054 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10055 Fix typos in explanations of the runtime file.
10056 * bootstrap: Change gettext keyword from YYI18N to YY_.
10057 Use standard Makefile.in.in in runtime-po, since we'll arrange
10058 for backward-compatible bison-runtime.po files in a different way.
10059 * data/glr.c (YY_): New macro, from yacc.c.
10060 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10061 Translate messages intended for users.
10062 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10063 the wording in the other skeletons. We don't know that the memory
10064 is virtual.
10065 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10066 Use same method that yacc.c uses.
10067 Don't translate debugging messages.
10068 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10069 it doesn't work (yet), and requires C++ expertise to fix.
10070 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10071 Move defn to a more logical place, to be consistent with other
10072 skeletons.
10073 Don't translate debugging messages.
10074 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10075 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10076 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10077 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10078
ac8c5689
PE
10079 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10080 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10081 void, not int.
10082 * tests/glr-regression.at (Badly Collapsed GLR States):
10083 Likewise.
10084 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10085 yylex should return 0 at EOF rather than aborting.
10086
6100a9aa
PE
10087 Improve tests for stack overflow in GLR parser.
10088 Problem reported by twlevo@xs4all.nl.
10089 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10090 All uses removed.
10091 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10092 can handle the problem.
10093 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10094 (yyparse): New local variable yyresult to record the result.
10095 Use result of setjmp to set it, rather than storing itinto
10096 struct.
10097 (yyDone): Remove label.
10098 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10099 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10100 if YYABORT is used).
10101 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10102 yyparse status; put status > 1 into diagnostic.
10103 Check that status==2 works.
10104 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10105 Use exit status 3 for failure to open (which shouldn't happen).
10106
15f40952
PE
101072005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10108
67fd79c4
PE
10109 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10110 1 on syntax error; just let yyparse do its thing.
10111 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10112 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10113 (Exploding the Stack Size with Alloca):
10114 (Exploding the Stack Size with Malloc):
10115 Expect exit status 2, not 1, since the parser is supposed to blow
10116 its stack. Problem reported by twlevo@xs4all.nl.
10117
15f40952
PE
10118 * data/glr.c (yyparse): Don't assume that the initial calls
10119 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10120 Print a stack-overflow message and fail instead.
10121 Initialize the line-number information before creating the stack,
10122 so that the stack-overflow message can report line zero safely.
10123
f32c66b5
PE
101242005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10125
a22ff96f 10126 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
10127 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10128 (yyuserMerge): Provide a default case if b4_mergers is empty.
10129 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10130 * tests/glr-regression.at
10131 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 10132 Add casts to pacify C++ compilers.
1beb0b24
PE
10133 * tests/glr-regression.at (Improper merging of GLR delayed action
10134 sets): Declare yylex before using it.
f32c66b5 10135 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
10136 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10137 test for valgrind; valgrind is independent of g++.
10138 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10139 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10140 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10141 Use a destructor, so that we can expand the stack. Change
10142 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 10143
d741bd1b
PE
101442005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10145
10146 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10147 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10148
0410a6e0
PE
101492005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10150
10151 * PACKAGING: New file, suggested by Bruno Haible and taken from
10152 similar wording in gettext's PACKAGING file.
10153 * NEWS: Mention PACKAGING.
10154 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10155
f7ab6a50
PE
101562005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10157
baf785db 10158 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10159 * bootstrap: Get runtime translations into runtime-po.
10160 Create runtime-po files automatically, if possible.
10161 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10162 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10163 does not infringe on the user's name space.
10164 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10165 * doc/bison.texinfo (Internationalization): Revamp the English
10166 and Texinfo syntax a bit, to try to make it clearer.
10167 (Bison Options, Option Cross Key): Mention --print-localedir.
10168 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10169 YYENABLE_NLS. Quote a bit more.
10170 * runtime-po/.cvsignore: New file.
10171 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10172 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10173 * runtime-po/quot.sed: Likewise.
10174 * runtime-po/boldquot.sed: Likewise.
10175 * runtime-po/en@quot.header: Likewise.
10176 * runtime-po/en@boldquot.header: Likewise.
10177 * runtime-po/insert-header.sin: Likewise.
10178 * runtime-po/remove-potcdate.sin: Likewise.
10179 * runtime-po/Makevars: Likewise.
10180 * runtime-po/LINGUAS: Likewise.
10181 * runtime-po/de.po: Likewise; we will rely on the translation project
10182 to maintain this, so "bootstrap" should get it.
0410a6e0 10183 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10184 its value.
10185 * src/main.c (main): Bind the bison-runtime domain, too.
10186
101872005-07-12 Bruno Haible <bruno@clisp.org>
10188
10189 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10190 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10191 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10192 * runtime-po: New directory.
10193 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10194 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10195 * runtime-po/Rules-quot: New file, copied from po/.
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: New file.
10203 * runtime-po/POTFILES.in: New file.
10204 * runtime-po/LINGUAS: New file.
10205 * runtime-po/bison-runtime.pot: New file.
10206 * runtime-po/de.po: New file.
10207 * m4/bison.m4: New file.
10208 * Makefile.am (SUBDIRS): Add runtime-po.
10209 (aclocaldir, aclocal_DATA): New variables.
10210 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10211 Define aclocaldir.
10212 * src/getargs.c (usage): Document --print-localedir option.
10213 (PRINT_LOCALEDIR_OPTION): New enum item.
10214 (long_options): Add --print-localedir option.
10215 (getargs): Handle --print-localedir option.
10216 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10217 (Internationalization): New section.
10218
22dda0f0
AD
102192005-07-12 Akim Demaille <akim@epita.fr>
10220
10221 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10222 for consistency with the rest of the code.
10223 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10224 Add separators.
10225
82b248ad
AD
102262005-07-12 Akim Demaille <akim@epita.fr>
10227
10228 * src/parse-gram.y: Use %printer instead of YYPRINT.
10229
fa0e9314
AD
102302005-07-12 Akim Demaille <akim@epita.fr>
10231
867a3e00
AD
10232 * src/symtab.h, src/symtab.c (symbol_print): New.
10233 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10234 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10235
102362005-07-12 Akim Demaille <akim@epita.fr>
10237
10238 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10239 b4_at_dollar and b4_dollar_dollar.
10240
e054b190
PE
102412005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10242
10243 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10244 and Pennello's paper.
10245
34160ec4
PE
102462005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10247
407d4a75
PE
10248 * data/yacc.c (yyparse): Undo previous patch. Instead,
10249 set yylsp[0] and yyvsp[0] only if the initial action
10250 sets yylloc and yylval, respectively.
10251
34160ec4
PE
10252 * data/yacc.c (yyparse): In the initial action, set
10253 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10254 This avoids the use of undefined variables if the initial
10255 action does not set yylloc and/or yylval.
10256
c3d5a4a7
PE
102572005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10258
b34d96c1
PE
10259 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10260 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10261 Remove from CVS. These files are automatically generated.
10262 * examples/extexi: Clarify that this file is now part of Bison,
10263 not GNU M4, and that it works with any POSIX-compatible Awk.
10264 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10265 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10266 so that we also get calc++-parser.yy. Geneate it.
10267 Use $(AWK), not gawk, since any conforming Awk will do.
10268 Put comment before action, since older 'make' can't handle comment
10269 in action.
10270 $(BUILT_SOURCES): List all built sources, not just some of them.
10271 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10272 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10273 $($(calc_sources_generated)): Remove unnecessary test for existence
10274 of target. (This had a shell syntax error anyway; a stray "x".)
10275 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10276 calc++-parser.yy.
10277 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10278
c3d5a4a7
PE
10279 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10280 implied by the other modules.
10281
828c373b
AD
102822005-07-06 Akim Demaille <akim@epita.fr>
10283
10284 Bind examples/calc++ to the package.
10285 * examples/calc++/Makefile: Remove, replaced by...
10286 * examples/calc++/Makefile.am: ... this new file.
10287 * examples/calc++/test: Remove input.
10288 * examples/calc++/compile: Remove.
10289 * examples/Makefile.am: New.
10290 * configure.ac, Makefile.am: Adjust.
10291 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10292
63cb01d6
PE
102932005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10294
fd2df2ed
PE
10295 * data/glr.c (yyFail): Drastically simplify; since the format argument
10296 never had any % directives, we can simply pass it to yyerror.
10297 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10298 be modified later, as that is the usual style in glr.c.
10299 Problems reported by Paul Hilfinger.
10300
63cb01d6
PE
10301 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10302 and size overflow errors.
10303 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10304 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10305 (YYSIZEMAX): New macro.
10306 (yystpcpy): New function, taken from yacc.c.
10307 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10308 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10309 so that we don't have to maintain their signatures.
10310 (yyFail): Check for buffer overflow, by using vsnprintf rather
10311 than vsprintf. Allocate a bigger buffer if possible.
10312 Report an error if buffer allocation fails.
10313 (yyStackOverflow): New function.
10314 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10315 the initialization was successful. It might fail if storage was
10316 exhausted.
10317 (yyexpandGLRStack): Add more checks for storage allocation failure.
10318 Use yyStackOverflow to report failures.
10319 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10320 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10321 Don't assume stack number fits in int.
10322 (yysplitStack): Check for storage allocation failure.
10323 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10324 can print diagnostics on storage allocation failure. All callers
10325 changed.
10326 (yyresolveValue): Use yybool for boolean.
10327 (yyreportSyntaxError): Check for size-calculation overflow.
10328 This code is taken from yacc.c.
10329 (yyparse): Check for storage allocation errors when allocating
10330 the initial stack.
10331
1c59e0a1
AD
103322005-07-05 Akim Demaille <akim@epita.fr>
10333
10334 Extract calc++ from the documentation.
10335 * doc/bison.texinfo (Calc++): Add the extraction marks.
10336 * examples/extexi: New, from the aborted GNU Programming 2E.
10337 Separate the different paragraph of a file with empty lines.
10338 * examples/Makefile: Use it to extract the whole calc++ example.
10339
8a0adb01
AD
103402005-06-24 Akim Demaille <akim@epita.fr>
10341
10342 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10343 class typedefs.
10344
12545799
AD
103452005-06-22 Akim Demaille <akim@epita.fr>
10346
10347 * doc/bison.texinfo (C++ Language Interface): First stab.
10348 (C++ Parsers): Remove.
10349
99be0235
AD
103502005-06-22 Akim Demaille <akim@epita.fr>
10351
10352 * data/lalr1.cc (yylex_): Honor %lex-param.
10353
0ffd4fd1
AD
103542005-06-22 Akim Demaille <akim@epita.fr>
10355
10356 Start a set of simple examples.
10357 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10358 * examples/calc++/calc++-driver.hh,
10359 * examples/calc++/calc++-parser.yy,
10360 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10361 * examples/calc++/compile, examples/calc++/test: New.
10362
0925ebb4
PE
103632005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10364
10365 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10366 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10367 which stems from the 2005-05-27 patch.
10368
43d3b664
PH
103692005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10370
10371 * data/glr.c: Modify treatment of unused parameters to permit use
10372 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10373
3062864d
PE
103742005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10375
10376 Fix infringement on user name space reported by Janos Zoltan Szabo.
10377 * data/yacc.c (yyparse): strlen -> yystrlen.
10378
989b5b8e
AD
103792005-05-30 Akim Demaille <akim@epita.fr>
10380
10381 * data/lalr1.cc (_): New.
10382 Translate the various messages.
10383
bedf57f5
PE
103842005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10385
10386 Fix infringement on user name space reported by Bruno Haible.
10387 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10388 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10389 the user's name space.
10390 (alloca): Include <stdlib.h> to get it, if it's not built in.
10391 (YYMALLOC, YYFREE): Define only if needed.
10392 (malloc, free): Declare, but only if needed, as this infringes on
10393 the user name space.
10394
4d1801f1
PE
103952005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10396
10397 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10398 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10399 with %d format.
10400 * lib/ebitset.c (min, max): Undef before defining.
10401 * lib/vbitset.c (min, max): Likewise.
10402 * lib/subpipe.c (create_subpipe): Save local variables in case
10403 vfork clobbers them.
10404
104052005-05-24 Bruno Haible <bruno@clisp.org>
10406
10407 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10408 error message syntax used by gcc-4.0.
10409
b94a9e1e
PE
104102005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10411
85ac3861
PE
10412 * README: Mention m4 1.4.3. Remove obsolete advice about
10413 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10414
b94a9e1e
PE
10415 * bootstrap: Remove workaround for problem I encountered with
10416 gettext 0.14.1; it seems to be fixed now.
10417
51c30d21
PE
104182005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10419
009ce67d
PE
10420 * NEWS: Version 2.0a.
10421
f2a97c62
PE
10422 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10423 the previous change.
10424
c8775f93
PE
10425 Various maintainer cleanups.
10426 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10427 conftest*, for benefit of CVS commands run at the same time as
10428 "configure". Add build-aux, since "bootstrap" now creates it and
10429 its subfiles.
10430 * Makefile.cfg (move_if_change): Remove.
10431 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10432 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10433 (po_repo, do-po-update, po-update, wget_files, get-targets):
10434 (config.guess-url_prefix, config.sub-url_prefix):
10435 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10436 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10437 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10438 Remove.
10439 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10440 this is now the recommended name.
10441 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10442 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10443 ylwrap. These files now go into build-aux.
10444 * config/move-if-change: Remove.
10445 * config/prev-version.txt: Bump from 1.75 to 2.0.
10446
3ea5f0ec
PE
10447 * bootstrap: Add stdio-safer, unistd-safer modules.
10448 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10449 we don't need it).
10450 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10451 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10452 * lib/subpipe.c: Include "unistd-safer.h".
10453 (create_subpipe): Make sure all the newly-created
10454 file descriptors are > 2, so that diagnostics don't
10455 get sent down them (which might cause Bison to hang, in theory).
10456 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10457 * src/files.c (xfopen): Use fopen_safer, not fopen.
10458
51c30d21
PE
10459 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10460 yesterday's yacc.c fix.
10461
cea1469d
PE
104622005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10463
3ea5f0ec
PE
10464 * data/glr.c, data/lalr1.cc: Update copyright date.
10465
cea1469d
PE
10466 Fix a destructor bug reported by Wolfgang Spraul in
10467 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10468 * data/yacc.c (yyabortlab): Don't call destructor, and
10469 don't set yychar to EMPTY.
10470 (yyoverflowlab): Don't call destructor.
10471 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10472 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10473 since we no longer output the message "discarding lookahead token
10474 end of input ()".
10475
5e6f62f2
PH
104762005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10477
10478 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10479 fix a small glitch in debugging output.
10480 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10481 after YY_SYMBOL_PRINT where needed.
10482
10483 (struct yyGLRState): Add some comments.
10484 (struct yySemanticOption): Add some comments.
10485 (union yyGLRStackItem): Add comment.
10486
10487 (yymergeOptionSets): Correct this to properly perform the union,
10488 avoiding infinite reported by Michael Rosien.
10489 Update comment.
10490
10491 * tests/glr-regression.at: Add test for GLR merging error reported
10492 by M. Rosien.
cea1469d 10493
0fb669f9
PE
104942005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10495
10496 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10497 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10498 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10499 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10500 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10501 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10502 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10503 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10504 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10505 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10506 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10507 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10508 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10509 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10510 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10511 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10512 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10513 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10514 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10515 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10516 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10517 src/output.h, src/parse-gram.c, src/parse-gram.h,
10518 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10519 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10520 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10521 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10522 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10523 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10524 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10525 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10526 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10527 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10528 tests/reduce.at, tests/regression.at, tests/sets.at,
10529 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10530 Update FSF postal mail address.
10531
51f4735e
PE
105322005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10533
10534 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10535 Problem reported by Ralf Menzel.
10536
80ce3401
PE
105372005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10538
10539 * tests/actions.at: Test that stack overflow invokes destructors.
10540 From Marcus Holland-Moritz.
10541 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10542 from here....
10543 (yyreturn): to here. That way, destructors are called properly
10544 even if the stack overflows, or the user calls YYACCEPT or
10545 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10546 (yyoverflowlab): Destroy the lookahead.
10547
105482005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10549
10550 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10551
72f000b0
PE
105522005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10553
10554 * NEWS: Bison-generated C parsers no longer quote literal strings
10555 associated with tokens.
10556 * src/output.c (prepare_symbols): Don't escape strings,
10557 since users don't want to see C escapes.
10558 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10559 in diagnostics.
c19683bb 10560 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
10561 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10562
1094323f
PE
105632005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10564
10565 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10566 the data size is known to be too small and we can't increase it.
10567 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10568
ca407bdf
PE
105692005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10570
10571 * src/parse-gram.y: Include quotearg.h.
10572 (string_as_id): Quote $1 before using it as a key, since the
10573 lexer no longer quotes it for us.
10574 (string_content): Don't strip quotes, since lexer no longer
10575 quotes it for us.
10576 * src/scan-gram.l: Include quotearg.h.
10577 ("\""): Omit quote.
10578 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10579 a key, since the rest of the lexer doesn't quote it.
10580 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10581 * tests/regression.at (Token definitions): Check for backslashes
10582 in token strings.
10583
10584 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10585 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10586 (yyparse): Revamp code to generate long syntax error message, to
10587 make it easier to translate, and to avoid problems with arithmetic
10588 overflow. Change "virtual memory" to "memory" in diagnostic, since
10589 we don't know whether the memory is virtual.
10590
1ce59070
PE
105912005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10592
10593 * NEWS: Bison-generated C parsers now use the _ macro to
10594 translate strings.
10595 * data/yacc.c (_) [!defined _]: New macro.
10596 All English strings wrapped inside this macro.
10597 * doc/bison.texinfo (Bison Parser): Document _.
10598 * po/POTFILES.in: Include src/parse-gram.c, since it now
10599 includes translateable strings that parse-gram.y doesn't.
10600
a749a695
PE
106012005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10602
10603 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10604 reverting the 2004-10-11 change to this function.
10605 (symbol_check_alias_consistency): Don't call symbol_type_set
10606 if the type name is already correct.
10607 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10608
8fb1053b
PE
106092005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10610
10611 * tests/regression.at (Token definitions): Don't use a token named
10612 c, as that generates a "#define c ..." that runs afoul of buggy
10613 stdlib.h that uses the identifier c as a member of struct
10614 drand48_data. Problem reported by Horst Wente.
10615
ff498c4a
PE
106162005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10617
10618 * bootstrap: Change translation URL from
10619 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10620 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10621 redirection glitches. Problem reported by twlevo@xs4all.nl.
10622
65211d70
PE
106232005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10624
10625 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10626 after operands; POSIX says this isn't portable for the c99 command.
10627
9577fb1f
PE
106282005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10629
10630 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10631 immediately if a data overrun has occurred; this may help us track
10632 down what may be a spurious failure on MacOS.
10633
78b178f7
PE
106342005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10635
a2599d0f
PE
10636 Respond to problems reported by twlevo@xs4all.nl.
10637
10638 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10639
78b178f7
PE
10640 * src/vcg.h: Comment fix.
10641 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10642 (G_CMAX): Change to -1 instead of INT_MAX.
10643
10644 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 10645
7296e729
PE
106462005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10647
10648 * src/tables.c (state_number_to_vector_number): Put it inside an
10649 "#if 0", since it's not currently used. Problem reported by
10650 Roland McGrath.
10651
05ac60f3
PE
106522005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10653
10654 * src/output.c (escaped_output): Renamed from
10655 escaped_file_name_output, since we now use it for symbol tags as
10656 well. All uses changed.
10657 (symbol_destructors_output, symbol_printers_output):
10658 Escape symbol tags too.
10659 Problem reported by Matyas Forstner in
10660 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10661
10662 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10663 not needed.
10664 * src/output.c (user_actions_output, token_definitions_output,
10665 symbol_destructors_output, symbol_printers_output): Likewise.
10666 * src/reader.c (prologue_augment): Likewise.
10667 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10668
10669 * src/vcg.c (output_edge): Don't quote linestyle arg.
10670 Problem reported by twlevo@xs4all.nl.
10671
7eb453ac
PE
106722005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10673
10674 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10675 example, reported by Derek M Jones. Also, make the example even
10676 more outrageous, to better illustrate how bad the problem is.
10677
4c04c52a
PE
106782005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10679
10680 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10681 putsym. Typo reported by Sebastian Piping.
10682
a61e1620
PE
106832005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10684
10685 * doc/bison.texinfo (Language and Grammar): some -> same
10686 (Epilogue): int he -> in the
10687 Typos reported by Sebastian Piping via Justin Pence.
10688
9ec93868
PE
106892005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10690
10691 * tests/glr-regression.at (Improper handling of embedded actions
10692 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10693 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10694 with dollar signs in test names.
10695 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10696 for a similar reason.
10697
73ce7e7e
PE
106982005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10699
10700 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10701 wants to redefine G_VIEW.
10702
2e72b98e
PE
107032005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10704
10705 * src/vcg.c (get_view_str): Remove case for normal_view.
10706 Problem reported by twlevo@xs4all.nl.
10707
e0d634e5
PE
107082005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10709
ccf830a4
PE
10710 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10711 Problem reported by twlevo@xs4all.nl.
10712
e0d634e5
PE
10713 * doc/bison.texinfo: Change @dircategory from "GNU programming
10714 tools" to "Software development". Requested by Richard Stallman
10715 via Karl Berry.
10716
7bbc8cb0
PE
107172005-01-23 Paul Eggert <eggert@cs.ucla.edu>
10718
10719 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
10720 Problem reported by twlevo@xs4all.nl.
10721
08b770bc
PE
107222005-01-21 Paul Eggert <eggert@cs.ucla.edu>
10723
10724 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
10725 keyword; it's not needed with modern compilers, and it doesn't
10726 affect correctness with older compilers. Suggested by
10727 twlevo@xs4all.nl.
10728
95f22ad2
PE
107292005-01-17 Paul Eggert <eggert@cs.ucla.edu>
10730
10731 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
10732 gcc -Wswitch-default.
10733 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10734 * data/yacc.c (yyparse): Likewise.
10735
d229d15c
PE
107362005-01-12 Paul Eggert <eggert@cs.ucla.edu>
10737
10738 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
10739 already. Let config.h define any nonstandard values.
10740
ecadd90f
PE
107412005-01-10 Paul Eggert <eggert@cs.ucla.edu>
10742
10743 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
10744 for the benefit of slower hosts. Problem reported by
10745 Nelson H. F. Beebe.
10746
213744b5
PE
107472005-01-07 Paul Eggert <eggert@cs.ucla.edu>
10748
10749 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
10750 being defined and not used.
10751 * data/lalr1.cc (yyparse): Likewise.
10752 Use "if (false)" rather than "if (0)".
10753
249d3236
PE
107542005-01-05 Paul Eggert <eggert@cs.ucla.edu>
10755
10756 * TODO: Mention that we should allow NUL bytes in tokens.
10757
987cc1fb
PE
107582005-01-02 Paul Eggert <eggert@cs.ucla.edu>
10759
10760 * src/scan-skel.l (<<EOF>>): Don't close standard output.
10761 Problem reported by Hans Aberg.
10762
08fe02d9
PE
107632005-01-01 Paul Eggert <eggert@cs.ucla.edu>
10764
10765 * src/getargs.c (version): Happy new year; update overall
10766 program copyright date from 2004 to 2005.
10767
10768 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
10769 Problem reported by Hans Aberg.
10770 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
10771 (Output file names.): Add a test for the case when standard output
10772 is closed.
10773
010c0266
PE
107742004-12-26 Paul Eggert <eggert@cs.ucla.edu>
10775
10776 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
10777 to fix an oversight in the Bison 2.0 manual.
10778
da12206a
PE
107792004-12-25 Paul Eggert <eggert@cs.ucla.edu>
10780
10781 * NEWS: Version 2.0. Reformat the existing news items since
10782 1.875, so that related items are grouped together.
3a4734aa 10783 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
10784 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
10785
c935d934
PE
10786 * tests/torture.at (Exploding the Stack Size with Alloca): Set
10787 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
10788 otherwise, we're not testing alloca. Unfortunately there's no
10789 simple way to consult HAVE_ALLOCA here.
10790
da12206a
PE
10791 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
10792 for yymsg, too.
10793
10794 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
10795 hand. This avoids a warning about comparing int to size_t when
10796 GCC warnings are enabled.
10797
0a2c5137
PE
107982004-12-22 Paul Eggert <eggert@cs.ucla.edu>
10799
d7e14fc0
PE
10800 * NEWS: Bison-generated parsers no longer default to using the
10801 alloca function (when available) to extend the parser stack, due
10802 to widespread problems in unchecked stack-overflow detection.
10803 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
10804 responsibility to set it to a positive value. This lets the user
10805 specify a value that is not a preprocessor constant.
10806 * data/yacc.c (YYMAXDEPTH): Likewise.
10807 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
10808 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
10809 to be a compile-time constant. However, explain the constraints on it.
10810 Also, explain the constraints on YYINITDEPTH.
10811 (Table of Symbols): Explain that alloca is no longer the default.
10812 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
10813 to 1.
10814
0a2c5137
PE
10815 * doc/bison.texinfo (Location Default Action): Mention that n must
10816 be zero when k is zero. Suggested by Frank Heckenbach.
10817
e019c247
AD
108182004-12-22 Akim Demaille <akim@epita.fr>
10819
10820 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
10821 (parser::state_type, parser::semantic_type, parser::location_type):
10822 Private, not public.
10823 (parser::parse): Return ints, not bool.
10824 Returning a bool introduces a problem: 0 corresponds to false, and
10825 it seems weird to return false on success. Returning true changes
10826 the conventions for yyparse.
10827 Alternatively we could return void and send an exception.
10828 There is no clear consensus (yet?).
10829 (state_stack, semantic_stack, location_stack): Rename as...
10830 (state_stack_type, semantic_stack_type, location_stack_type): these.
10831 Private, not public.
10832 * tests/c++.at: New.
10833 * tests/testsuite.at, tests/Makefile.am: Adjust.
10834
72731bb7
AD
108352004-12-21 Akim Demaille <akim@epita.fr>
10836
10837 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
10838
9a0d8bec
AD
108392004-12-21 Akim Demaille <akim@epita.fr>
10840
10841 Don't impose std::string for filenames.
10842
10843 * data/lalr1.cc (b4_filename_type): New.
10844 (position::filename): Use it.
10845 (parser.hh): Move the inclusion of stack.hh and location.hh below
10846 the user code, so that needed headers for the filename type can be
10847 included first.
72731bb7
AD
10848 Forward declare them before the user code.
10849 * tests/Makefile.am (check-local, installcheck-local): Pass
10850 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 10851
99880de5
AD
108522004-12-20 Akim Demaille <akim@epita.fr>
10853
10854 Use more STL like names: my_class instead of MyClass.
10855
10856 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
10857 (SemanticStack, SemanticType, StateStack, StateType)
10858 (TokenNumberType, Stack, Slice, Traits, Parser::location)
10859 (Parser::value): Rename as...
10860 (location_stack, location_type, rhs_number_type, semantic_stack)
10861 (semantic_type, state_stack, state_type, token_number_type, stack)
10862 (slice, traits, parser::yylloc, parser::yylval): these.
10863
10864 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
10865
9bec482e
PE
108662004-12-19 Paul Eggert <eggert@cs.ucla.edu>
10867
10868 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
10869 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10870
f6fbd3da
PE
108712004-12-17 Paul Eggert <eggert@cs.ucla.edu>
10872
10873 Remove uses of 'short int' and 'unsigned short int'. This raises
10874 some arbitrary limits. It uses more memory but nowadays that's
10875 not much of an issue.
10876
10877 This change does not affect the generated parsers; that's a different
10878 task, as some users will want to conserve memory there.
10879
10880 Ideally we should use size_t to represent all object counts, and
10881 something like ptrdiff_t to represent signed differences of object
10882 counts; but that will require more code-cleanup than I have the
10883 time to do right now.
10884
10885 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
10886 Use size_t, not int or short int, to count objects.
10887 * src/closure.c (nritemset, closure): Likewise.
10888 * src/closure.h (nritemset, closure): Likewise.
10889 * src/nullable.c (nullable_compute): Likewise.
10890 * src/print.c (print_core): Likewise.
10891 * src/print_graph.c (print_core): Likewise.
10892 * src/state.c (state_compare, state_hash): Likewise.
10893 * src/state.h (struct state): Likewise.
10894 * src/tables.c (default_goto, goto_actions): Likewise.
10895
10896 * src/gram.h (rule_number, rule): Use int, not short int.
10897 * src/output.c (prepare_rules): Likewise.
10898 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
10899 errs, reductions): Likewise.
10900 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
10901 Likewise.
10902 * src/tables.c (vector_number, tally, action_number,
10903 ACTION_NUMBER_MINIMUM): Likewise.
10904 * src/output.c (muscle_insert_short_int_table): Remove.
10905
efeed023
AD
109062004-12-17 Akim Demaille <akim@epita.fr>
10907
10908 * data/lalr1.cc: Extensive Doxygenation.
10909 (error_): Rename as...
10910 (error): this, since it is visible to the user.
10911 Adjust callers.
10912 (Parser::message): Now an automatic variable from...
10913 (Parser::yyreport_syntax_error_): here.
10914 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
10915 Parser::error.
10916 * tests/input.at: Escape $.
10917
bc82c5a5
PE
109182004-12-16 Paul Eggert <eggert@cs.ucla.edu>
10919
10920 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
10921 Parenthesize rhs to avoid obscure problems with mistakes like
10922 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
10923 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10924 b4_rhs_location): Likewise.
10925 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
10926 b4_rhs_location): Likewise.
10927
fd19f271
AD
109282004-12-16 Akim Demaille <akim@epita.fr>
10929
10930 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
10931 yacc.c: be sure to stay within yycheck_.
10932 * tests/actions.at: Re-enable C++ tests.
10933
10454ea4
AD
109342004-12-16 Akim Demaille <akim@epita.fr>
10935
10936 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
10937 real.
10938
c5b95ccf
AD
109392004-12-16 Akim Demaille <akim@epita.fr>
10940
10941 Use #define to handle the %name-prefix.
10942
10943 * data/glr.c, data/yacc.c: Comment changes.
10944 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
10945 so that one can refer to yylex in the parser file, and have it
10946 renamed, as is the case with other skeletons.
10947
617a8f12
AD
109482004-12-16 Akim Demaille <akim@epita.fr>
10949
10950 Move lalr1.cc internals into yy*.
10951
10952 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
10953 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
10954 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
10955 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
10956 (empty_, final_, terror_, errcode_, ntokens_)
10957 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
10958 (looka_, ilooka_, error_range_, nerrs_):
10959 Rename as...
10960 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
10961 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
10962 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
10963 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
10964 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
10965 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
10966 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
10967 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
10968 these.
10969
1e547e6e
PE
109702004-12-15 Paul Eggert <eggert@cs.ucla.edu>
10971
10972 Fix some problems reported by twlevo at xs4all.
10973 * src/symtab.c (symbol_new): Report an error if the input grammar
10974 contains too many symbols. This is better than calling abort() later.
10975 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
10976 (struct node, struct graph):
10977 Rename member expand to stretch. All uses changed.
10978 (struct graph): Remove member layoutalgorithm. All uses removed.
10979 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
10980 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
10981 All uses changed.
10982 (N_STRETCH): Rename from N_EXPAND. All uses changed.
10983
735d6bd4
AD
109842004-12-15 Akim Demaille <akim@epita.fr>
10985
10986 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
10987 Add more Doxygen comments.
10988 (symprint_, stack_print_, reduce_print_, destruct_, pop)
10989 (report_syntax_error_, translate_): Rename as...
10990 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
10991 (yypop_, yyreport_syntax_error_, yytranslate_): this.
10992
2e1f5829
AD
109932004-12-15 Akim Demaille <akim@epita.fr>
10994
10995 * data/lalr1.cc (lex_): Rename as...
10996 (yylex_): this.
10997 Move the trace here.
10998 Take the %name-prefix into account.
10999 Reported by Alexandre Duret-Lutz.
11000
a3cb6248
AD
110012004-12-15 Akim Demaille <akim@epita.fr>
11002
11003 Simplify the C++ parser constructor.
11004
11005 * data/lalr1.cc (debug_): Rename as...
11006 (yydebug_): so that the parser's internals are always in the yy*
11007 pseudo namespace.
11008 Adjust uses.
11009 (b4_parse_param_decl): Remove the leading comma as it is now only
11010 called as unique argument list.
11011 (Parser::Parser): Remove the constructor accepting a location and
11012 an initial debugging level.
11013 Remove from the other ctor the argument for the debugging level.
11014 (debug_level_type, debug_level, set_debug_level): New.
11015
11016 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11017 constructor calls.
11018
07fed891
AD
110192004-12-15 Akim Demaille <akim@epita.fr>
11020
11021 Remove b4_root related material: failure experiment
a3cb6248 11022 (which goal was to allow to derive from a class).
07fed891
AD
11023
11024 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11025 definitions and uses.
11026
e603eaa5
PE
110272004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11028
11029 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11030 not 2, since it's not portable to subtract 1 from the start of an
11031 array. The new item 0 is never set or used. All uses changed.
11032
11033 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11034 the default definition of YYLLOC_DEFAULT. Problem reported
11035 by Frank Heckenbach.
11036
fafb007d
PE
110372004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11038
11039 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11040 the normal case and one for the error case. Just use the
11041 first one uniformly. Problem reported by Frank Heckenbach.
11042 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11043 use exactly the same macro in both places.
11044 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11045 so that the normal-case YYRHSLOC works for the error case too.
11046 All uses changed.
11047 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11048 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11049 * doc/bison.texinfo (Location Default Action): Don't claim that
11050 we have an array of locations. Use the same macro for both glr
11051 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11052 the index is 0.
11053
48814dcd
PE
110542004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11055
a4e1a53b
PE
11056 * HACKING: Update email addresses to send announcements to.
11057
48814dcd
PE
11058 * configure.ac (AC_INIT): Bump version to 1.875f.
11059
337116ba
PE
110602004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11061
11062 * NEWS: Version 1.875e.
11063 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11064
11065 * src/scan-skel.l: Include "complain.h", for "fatal".
11066
11067 * src/relation.h (relation_print, relation_digraph):
11068 Relation sizes are of type relation_node, not size_t (this is
11069 merely a doc fix, since the two types are equivalent).
11070 (relation_transpose): Relation sizes are of type relation_node,
11071 not int.
11072 * src/relation.c: Likewise.
11073 (top, infinity): Now of type relation_node, not int.
11074 (traverse, relation_transpose): Use relation_node, not int.
11075
11076 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11077 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11078 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11079
11080 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 11081 specifying whether the test should be skipped. Use it tp
337116ba 11082 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 11083 fail on some hosts, and should be skipped.
337116ba 11084
da2a7671
PE
110852004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11086
11087 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11088 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11089 unless otherwise specified below.
11090
11091 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11092 to allocate kernel_base, kernel_items, kernel_size, since
11093 they needn't be initialized to 0.
11094 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11095 * src/closure.c (new_closure): Likewise, for itemset.
11096 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11097 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11098 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11099 (build_relations): Likewise for edge, states1, includes.
11100 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11101 * src/reader.c (packgram): Likewise, for ritem, rules.
11102 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11103 * src/relation.c (relation_digraph): Likewise for VERTICES.
11104 (relation_transpose): Likewise for new_R, end_R.
11105 * src/symtab.c (symbols_token_translations_init): Likewise for
11106 token_translations.
11107 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11108 (token_actions): Likewise for yydefact, actrow, conflrow,
11109 conflict_list.
11110 (save_column): Likewise for froms[symno], tos[symno].
11111 (goto_actions): Likewise for state_count.
11112 (pack_table): Likewise for base, pos, check.
11113 (tables_generate): Likewise for width.
11114
11115 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11116 for initial core. Just have a separate core, so we needn't worry
11117 about whether kernel_size and kernel_base are initialized.
11118
11119 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11120 kernel_size, kernel_items): Remove unnecessary initialization.
11121 * src/conflicts.c (conflicts): Likewise.
11122 * src/derives.c (derives): Likewise.
11123 * src/muscle_tablc (muscle_insert): Likewise.
11124 * src/relation.c (relation_digraph): Likewise.
11125 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11126 conflrow, conflict_table, conflict_list, table, check):
11127 Likewise.
11128
11129 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11130 This is because all callers pass unsigned int.
11131 * src/closure.h (new_closure): Likewise.
11132
11133 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11134 (build_relations): Initialize includes[i] in all cases.
11135 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11136 and rules[ruleno].precsym. Initialize members in order.
11137 * src/relation.c (relation_transpose): Always initialize new_R[i]
11138 and end_R[i].
11139 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11140
11141 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11142 conflict_list[0] was always 0, but now it isn't initialized.
11143
11144 * src/table.c (table_grow): When conflict_table grew, the grown
11145 area wasn't cleared. Fix this.
11146
11147 * lib/.cvsignore: Add strdup.c, strdup.h.
11148 * m4/.cvsignore: Add strdup.m4.
11149
00baeeac
PE
111502004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11151
11152 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11153 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11154 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11155 ngotos + 1 without checking for overflow.
11156 (build_relations): Use END_NODE, not -1, to denote end of edges.
11157 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11158 build_relations): Use goto_number, not int, for goto numbers.
11159 * src/tables.c (save_column, default_goto): Likewise.
11160
be3d9d42
AD
111612004-11-23 Akim Demaille <akim@epita.fr>
11162
11163 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11164 of #defining from yystype.
11165 Don't typedef yystype, C++ does not need it.
11166 This lets it possible to forward declare it as union.
11167
78e526d5
PE
111682004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11169
11170 * bootstrap (gnulib_modules): Add extensions.
11171 Problem reported by Jim Meyering.
11172
afbb696d
PE
111732004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11174
11175 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11176 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11177 src/system.h, src/tables.c: XFREE -> free, to accommodate
11178 recent change to gnulib xalloc.h.
78e526d5 11179 Problem reported by Jim Meyering.
afbb696d 11180
c1f8f16a
AD
111812004-11-17 Akim Demaille <akim@epita.fr>
11182
11183 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11184
db7e5eb5 111852004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11186 Alexandre Duret-Lutz <adl@gnu.org>
11187
11188 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11189 changes.
11190 (YYCDEBUG): Adjust.
11191 Use it instead of cdebug_.
11192 (Parser::debug_stream, Parser::set_debug_stream): New.
11193 (Parser::symprint_): Define cdebug_ for temporary backward
11194 compatibility.
11195 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11196 debug_stream ().
11197
68e11668
AD
111982004-11-17 Akim Demaille <akim@epita.fr>
11199
11200 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11201 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11202 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11203 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11204
97cbc73e
PE
112052004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11206
11207 * data/glr.c (yyloc_default): Remove; not used.
11208 Problem reported by Frank Heckenbach.
11209
e342c3be
AD
112102004-10-25 Akim Demaille <akim@epita.fr>
11211
11212 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11213 Introduce another definition to address simple location arrays.
11214 (yyGLRStack): New member: yyerror_range.
11215 (yyrecoverSyntaxError, yyparse): Update it.
11216 (yyrecoverSyntaxError): Use it when shifting the error token to
11217 have an accurate range, equivalent to the one computed by both
11218 yacc.c and lalr1.cc.
11219 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11220 that column numbers start at column 0, as per GNU Coding
11221 Standards, the others tests, and the doc.
11222 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11223 Adjust to the above change (first column is 0).
11224 And adjust the location of the "<error>", now covering the whole
11225 line.
11226
93602feb 112272004-10-22 Akim Demaille <akim@epita.fr>
04098407 11228 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11229
11230 Remove some arbitrary limits on goto numbers and relations.
11231 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11232 initial values, since they're never used.
11233 (set_goto_map): ngotos is now unsigned, so test for overflow
11234 by seeing whether it wraps around to zero.
11235 * src/lalr.h (goto_number): Now size_t, not short int.
11236 (GOTO_NUMBER_MAXIMUM): Remove.
11237 * src/relation.c (relation_print, traverse, relation_transpose):
11238 Check for END_NODE rather than looking at sign.
11239 * src/relation.h (END_NODE): New macro.
11240 (relation_node): Now size_t, not short int.
11241
dba08b04
PE
112422004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11243
11244 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11245 keyword, not an identifier. Problem reported by Baron Schwartz in
11246 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11247
df09ef2e
AD
112482004-10-11 Akim Demaille <akim@epita.fr>
11249
11250 * src/symtab.c (symbol_check_alias_consistency): Also check
11251 type names, destructors, and printers.
11252 Reported by Alexandre Duret-Lutz.
11253 Recode the handling of associativity and precedence in terms
11254 of symbol_precedence_set.
11255 Accept no redeclaration at all, not even equal to the previous
11256 value.
11257 (redeclaration): New.
11258 Use it to factor redeclaration complaints.
11259 (symbol_make_alias): Don't set the type of the alias, let
11260 symbol_check_alias_consistency do it as for other features.
11261 * src/symtab.h (symbol): Add new member prec_location, and
11262 type_location.
11263 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11264 * tests/input.at (Incompatible Aliases): New.
11265
146bc99d
PE
112662004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11267
11268 .cvsignore fixes to accommodate gnulib changes,
11269 and the practice of naming build directories "_build".
11270 * .cvsignore: Add "_*". Sort.
11271 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11272 * m4/.cvsignore: Add "*_gl.m4".
11273
e503aa60
AD
112742004-10-06 Akim Demaille <akim@epita.fr>
11275
11276 * src/parse-gram.y (add_param): Fix the truncation of trailing
11277 spaces.
11278
b4a20338
AD
112792004-10-05 Akim Demaille <akim@epita.fr>
11280
11281 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11282 whether the reducion was empty or not. This leaves room to
11283 improve the use of YYLLOC_DEFAULT in such a case.
11284 lalr1.cc is still experimental, so changing this is acceptable.
11285 And finally, there are probably not many users who changed the
11286 handling of locations in GLR, so changing is admissible too.
11287
11288 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11289 empty reduction, set @$ to an empty location ending the previously
11290 stacked symbol.
11291 Adjust uses to make sure the code is triggered on empty
11292 reductions.
11293 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11294 expected output: empty reductions have empty locations.
11295
f85a5e6f
AD
112962004-09-29 Akim Demaille <akim@epita.fr>
11297
11298 * data/lalr1.cc: Move towards a more standard C++ coding style
11299 for templates: Class < T > -> Class<T>.
11300
b203fc2c
AD
113012004-09-29 Akim Demaille <akim@epita.fr>
11302
11303 * data/lalr1.cc: Reinstall the former ctor, for sake of
11304 compatibility, but warn it will be removed.
11305 Move towards a more standard C++ coding style (i.e., type *var ->
11306 type* var).
11307
5b7e1e73
PE
113082004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11309
3fee967f
PE
11310 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11311 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11312
0dcca5c2
AD
113132004-09-27 Akim Demaille <akim@epita.fr>
11314
11315 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11316
6dde1c82
AD
113172004-09-27 Akim Demaille <akim@epita.fr>
11318
11319 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 11320 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
11321 and argument names.
11322 (b4_cc_constructor_call): Likewise.
11323
b233d555
AD
113242004-09-24 Akim Demaille <akim@epita.fr>
11325
11326 * src/parse-gram.y (add_param): Strip the leading and trailing
11327 blanks from a formal argument declaration.
11328 (YY_LOCATION_PRINT): New.
11329
619404e3
AD
113302004-09-24 Akim Demaille <akim@epita.fr>
11331
11332 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11333 after the location.
11334
dd8d9022
AD
113352004-09-24 Akim Demaille <akim@epita.fr>
11336
11337 * doc/bison.texinfo (Table of Symbols): Sort.
11338
0092f063
AD
113392004-09-21 Akim Demaille <akim@epita.fr>
11340
11341 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11342 the useless parentheses.
11343 Suggested by Paul Eggert.
11344
451364ed
AD
113452004-09-20 Akim Demaille <akim@epita.fr>
11346
11347 Let the initial-action act on the look-ahead, and use it for the
11348 "initial push" (corresponding to an hypothetical beginning-of-file).
11349 And let lalr1.cc honor %initial-action.
11350
11351 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11352 example.
11353 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11354 (Parser::Parser): Remove the ctor that used to initialize it.
11355 (Parser::parse): Like in the other skeletons, issue the "starting
11356 parse" message before any action.
11357 Honor %initial-action.
11358 Initialize the stacks with the lookahead.
11359 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11360 look-ahead.
11361 Push them in the stacks.
11362 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11363
18d192f0
AD
113642004-09-20 Akim Demaille <akim@epita.fr>
11365
11366 * doc/bison.texinfo (Initial Action Decl): New.
11367
b8458aa5
AD
113682004-09-20 Akim Demaille <akim@epita.fr>
11369
11370 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11371 clearer criterion to define it.
11372 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11373 When reducing on an empty RHS, use the latest stacked location as
11374 location.
11375 yylloc is not always available.
11376 * data/glr.c: Likewise.
11377 Also, honor initial-actions.
11378
3fc16193
AD
113792004-09-20 Akim Demaille <akim@epita.fr>
11380
11381 * data/yacc.c (YY_LOCATION_PRINT): New.
11382 Define when we know YYLTYPE's structure, i.e., when the default
11383 YYLLOC_DEFAULT is used.
11384 * data/c.m4 (b4_yysymprint_generate): Use it.
11385 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11386 value of the result.
11387 (error_start_): Replace with...
11388 (error_range_): this location array.
11389 This allows to replace code relying on the implementation of
11390 locations by portable code.
11391 * data/yacc.c (yylerrsp): Replace with...
11392 (yyerror_range): this.
11393 Every time a token is popped, update yyerror_range[0], to have an
11394 accurate location for the error token.
11395 * data/glr.c (YY_LOCATION_PRINT): New.
11396 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11397 deference a pointer.
11398 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11399 report the location in %printers.
11400
11401 * src/scan-skel.l: Instead of abort, report error messages to ease
11402 understanding skeleton scanning failures.
11403
ecfe33e7
AD
114042004-09-16 Akim Demaille <akim@epita.fr>
11405
11406 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11407 (iterator, const_iterator): these, to be more in the C++ spirit.
11408 Also, return reverse iterators so that when displaying the stack
11409 we display its bottom first.
11410 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11411 from yacc.c.
11412 We should probably use vector here though.
11413
1576d44d
AD
114142004-09-16 Akim Demaille <akim@epita.fr>
11415
11416 Have more complete shift traces.
11417
11418 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11419 to report Shifts instead of ad hoc YYDPRINTF invocations,
11420 including for the error token.
11421 * data/lalr1.cc (symprint_): Output the location.
11422 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11423 output the location within the %printer.
11424 Activate GLR tests, at least to make sure they compile properly.
11425 They still don't pass though.
11426 * tests/calc.at: Adjust expect verbose output, since now "Entering
11427 state..." is on a different line than the "Shifting" message.
11428
9c66f418
AD
114292004-09-08 Akim Demaille <akim@epita.fr>
11430
11431 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11432 Bison directive from the Bison file to the invocation of this
11433 macro, so that these directives are passed to
11434 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11435 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11436 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11437 the extra Bison directives instead of the whole series.
11438 Change the grammar so that there are recoverable errors, and
11439 unrecoverable errors. Now we can have the parser give up before
11440 consuming the whole input. As a result we now can observe that
11441 the lookahead is freed when needed.
11442 Change the parser source to parse argv[1] instead of a hard coded
11443 string.
11444 Simplify yylex, and give a value and location to EOF.
11445 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11446 passed directives already coded in the file.
11447 Add some tests to check the location of "error".
11448 For some tests, the C++ parser is correct, and not yacc.c.
11449 For other tests, they provide different, but unsatisfying, values,
11450 so keep the C++ value so that at least one parser is "correct"
11451 according to the test suite.
11452 (Actions after errors): Remove, this is subsumed by the
11453 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11454
52d5733f
AD
114552004-09-06 Akim Demaille <akim@epita.fr>
11456
11457 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 11458 (Parser::pop): New.
52d5733f
AD
11459 Use it.
11460
a0e68930
AD
114612004-09-06 Akim Demaille <akim@epita.fr>
11462
11463 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11464 argument, an informative message.
11465 Call YY_SYMBOL_PRINT.
11466 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11467 * data/lalr1.cc (destruct_): Likewise.
11468 In addition, no longer depend on b4_yysymprint_generate and
11469 b4_yydestruct_generate to generate these functions, do it "by
11470 hand".
11471
e757bb10
AD
114722004-09-03 Akim Demaille <akim@epita.fr>
11473
11474 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11475 invoked, yydestruct the lookahead.
11476 * tests/calc.at (Calculator $1): Update the expected lengths of
11477 traces: there is an added line for the discarded lookahead.
11478 * doc/bison.texinfo (Destructor Decl): Some rewording.
11479 Define "discarded" symbols.
11480
0fe1f06d
AD
114812004-09-02 Akim Demaille <akim@epita.fr>
11482
11483 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11484
284acc8b
AD
114852004-09-02 Akim Demaille <akim@epita.fr>
11486
11487 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11488 (YYDSYMPRINTF): Rename as...
11489 (YY_SYMBOL_PRINT): this.
11490 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11491 two.
11492 Use it instead of direct symprint_ calls.
11493 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11494 one.
11495
a5eb1ed2
AD
114962004-09-02 Akim Demaille <akim@epita.fr>
11497
b7c72fe1
AD
11498 * data/lalr1.cc (b4_yysymprint_generate): New.
11499 (symprint_): New member function, defined when YYDEBUG.
11500 Use it consistently instead of token/nterm debugging output by
11501 hand.
a5eb1ed2
AD
11502 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11503 %printer calls to use cdebug_ when using lalr1.cc.
11504
417141dd
AD
115052004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11506
11507 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11508 with #ifdef YYDEBUG.
11509
2fa09258
AD
115102004-08-26 Akim Demaille <akim@epita.fr>
11511
11512 * doc/bison.texinfo (Implementing Loops): Rename as...
11513 (Implementing Gotos/Loops): this.
11514
9378b508
PE
115152004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11516
11517 Adjust to latest gnulib.
11518 * bootstrap (gnulib_modules): Add xalloc-die.
11519 Set LC_ALL=C so that file names sort consistently.
11520 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11521 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11522 uintmax_t.m4, ulonglong.m4.
11523 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11524 po.m4 since we are now using _gl.m4 instead.
11525
87a8ad5c
PE
115262004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11527
11528 * src/scan-action.l: Remove. Scanning of semantic actions is
11529 handled in scan-gram.l.
11530
dca81a78
PE
115312004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11532
11533 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11534
11535 * src/location.h (struct): The file member is a uniqstr.
11536 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11537
c9cbf7c5
PE
115382004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11539
11540 Fix bug with non-%union parsers that have printers or destructors,
11541 which led to a Bison core dump. Reported by Peter Fales in
11542 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 11543
c9cbf7c5
PE
11544 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11545 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11546 not to our own type.
11547 * src/output.c (symbol_destructors_output, symbol_printers_output):
11548 Don't assume %union.
11549 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11550 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11551 UNION-FLAG. All callers changed.
11552 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11553 Use type char, not unsigned int, when declaring an array of char;
11554 this lets us remove a cast.
11555 (Printers and Destructors): Add non-%union test cases.
11556
fa7e68c3
PE
115572004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11558
11559 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11560 GLR writeups. E.g., avoid frenchspacing and the future tense,
11561 change "lookahead" to "look-ahead", and change "wrt" to "with
11562 respect to".
2fa09258 11563
fa7e68c3
PE
115642004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11565
11566 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11567 New sections, split off from the GLR Parsers section. Put the new
11568 Simple GLR Parser near the start of the GLR section, for clarity.
11569 Rewrite connective text.
11570
99a9344e
PE
115712004-06-21 Frank Heckenbach <frank@g-n-u.de>
11572
11573 * doc/bison.texinfo (Simple GLR Parsers): New section.
11574
8dd162d3
PE
115752004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11576
11577 * NEWS, TODO, doc/bison.texinfo:
11578 Use "look-ahead" instead of "lookahead", to be consistent.
11579 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11580 while we're fixing "look-ahead".
11581 * src/conflicts.c (shift_set): Renamed from shiftset.
11582 (look_ahead_set): Renamed from lookaheadset.
11583 * src/print.c: Likewise.
11584 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11585 name for "lookahead".
11586 (report_types, usage): Likewise.
11587 * src/getargs.h (report_look_ahead_tokens): Renamed from
11588 report_lookaheads.
11589 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11590 compute_lookaheads.
11591 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11592 (look_ahead_tokens_print): Renamed from lookaheads_print.
11593 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11594 state_rule_lookaheads_print.
11595 * src/state.h: Likewise.
11596 (reductions.look_ahead_tokens): Renamed from lookaheads.
11597 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11598 AT_DATA_LOOKAHEADS_GRAMMAR.
11599
57a90331
PE
116002004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11601
11602 * README: Update location of patched M4 distribution.
11603
8ed3234a
PE
116042004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11605
11606 Don't assume the C++ compiler takes the same arguments as the C compiler
11607 (trivial change).
11608 * configure.ac (O0CXXFLAGS): New var.
11609 * tests/atlocal.in (CXXFLAGS): Use it.
11610
07971983
PE
116112004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11612
11613 Fix some "make check" problems with C++ reported by
11614 Albert Chin-A-Young for Tru64 C++ in this thread:
11615 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11616
11617 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11618 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11619 Output to a .cc file for C++, not to a .c file.
11620 * tests/calc.at (AT_CHECK_CALC): Likewise.
11621 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11622 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11623
29058652
PE
116242004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11625
11626 * tests/calc.at, tests/actions.at: Workaround for SGI
11627 C++ compiler. (trivial change)
11628
62cb8a99
PE
116292004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11630
fd418816
PE
11631 Spent a few hours checking out which prerequisite versions the
11632 current sources actually require. I went all the way back to
11633 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11634 a seemingly endless set of combinations of versions more recent
11635 than that. The bottom line is that the current sources require
11636 fairly recent versions of the build tools, and it'll be some work
11637 to change this.
11638 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11639 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11640 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11641 Add comments explaining why those particular versions are
11642 currently needed.
2fa09258 11643
62cb8a99
PE
11644 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11645 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 11646 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
11647
11648 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11649 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11650
caa52c10
PE
116512004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11652
11653 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11654 0.11.5. Suggested by Bruno Haible.
11655 * bootstrap: Remove gettext version checking.
11656
11657 * doc/bison.texinfo (Decl Summary): Also mention that %union
11658 can depend on prerequisite types. Problem reported by Tim
11659 Van Holder.
11660
4bfd5e4e
PE
116612004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11662
2cef3017
PE
11663 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11664 * README-alpha: Don't tell people not to package this.
11665
b9c85d5c
PE
11666 * bootstrap: Don't assume $(...) works; use `...` instead.
11667 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11668 gettext better.
11669
4bfd5e4e
PE
11670 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11671 put into the -d output file, and mention what to do if YYSTYPE is
11672 defined as a macro.
11673
6a36ff94
PE
116742004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11675
6712933e
PE
11676 Undo change made earlier today: it caused autopoint to not bring
11677 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11678 autopoint's.
11679
11680 * bootstrap: Check that gettext version matches what's in
11681 configure.ac. Warn users to ignore robots.txt ERROR 404.
11682 * bootstrap: Undo today's earlier change (logged below).
11683 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 11684
6a36ff94
PE
11685 The gettext version checking is causing more trouble than it's
11686 curing; remove it. Problem reported by Paul Hilfinger.
11687
11688 * bootstrap: Issue a warning that one can expect a message
11689 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11690 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11691
209ea708
PE
116922004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11693
11694 Ensure that the C++ compiler used for testing actually works on a
11695 simple test program; if not, skip the C++-related tests. Problem
11696 reported by Vin Shelton in:
161a71f3 11697 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
11698
11699 * m4/cxx.m4: New file.
11700 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11701 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11702 * tests/local.at (AT_COMPILE_CXX): Use it.
11703
41ca2549
PE
117042004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11705
383e69dc
PE
11706 * data/glr.c (yylloc): Output this macro even if locations are not
11707 being generated, as the GLR parser needs it even in that case.
11708 Problem reported by Troy A. Johnson
11709 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11710
41ca2549
PE
11711 * configure.ac (AC_INIT): Update to 1.875e.
11712
e476c87d
PE
117132004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 * NEWS: Version 1.875d.
11716 * configure.ac (AC_INIT): Likewise.
11717 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
11718
11719 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
11720 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
11721 lalr1.cc runs afoul of the first, and the last two are no longer
11722 supported by GCC 3.4.0.
11723 * README: Mention GNU m4 1.4 or later; mention m4 patches.
11724 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
11725
233a88ad
PE
117262004-05-06 Paul Eggert <eggert@cs.ucla.edu>
11727
11728 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
11729 unsigned int, for compatibility with latest gnulib hash module.
11730 * src/state.c (state_hash, state_hasher): Likewise.
11731 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
11732 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 11733
12ffdd28
PE
117342004-05-03 Paul Eggert <eggert@cs.ucla.edu>
11735
11736 * NEWS: Unescaped newlines are no longer allowed in char & strings.
11737
11738 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
11739 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
11740 character and string literals.
11741 (unexpected_end): New function.
11742 (unexpected_eof): Use it.
11743 (unexpected_newline): New function.
11744 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
11745 actions.
e476c87d 11746
12ffdd28
PE
11747 * NEWS: Document %expect-rr.
11748
11749 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
11750 Fix typo by replacing $1 with $option.
11751 Remove more 'intl'-related files.
9668e2be 11752 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
11753
11754 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
11755 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
11756 strtoul.c.
11757 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
11758 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
11759 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
11760 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
11761 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
11762 * src/.cvsignore: Add *.output.
11763
11764 * src/parse-gram.y: Put copyright notice inside %{ %} so it
11765 gets copied to the output file.
e476c87d 11766
1f65350a
PE
117672004-04-28 Paul Eggert <eggert@twinsun.com>
11768
11769 Get files from the gnulib and po repositories, instead of relying
11770 on them being in our CVS. Upgrade to latest versions of gnulib
11771 and Automake.
11772
11773 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
11774 * bootstrap: Bootstrap from gnulib and po repositories.
11775 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
11776 * README-cvs: Document these changes. Remove version numbers from
11777 mentions of build tools, since they change so often. Mention Flex.
11778
11779 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
11780 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
11781 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
11782 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 11783 does this for us.
12ffdd28
PE
11784 (AC_ISC_POSIX): Remove; we no longer support this
11785 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
11786 (AC_HEADER_STDC): Remove: we now assume C89 or better.
11787 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
11788 Do not check for C89 headers, except for locale.h which is used
11789 by the Yacc library and must port to K&R hosts.
11790 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
11791 Do not check for C89 functions, except for setlocale which is
11792 used by the Yacc library.
11793 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
11794 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
11795 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
11796 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
11797 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
11798 AM_GNU_GETTEXT): Remove; now done by:
11799 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
11800 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
11801 for us.
11802
11803 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
11804 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
11805 Define to empty, as gnulib.mk will do the rest for us.
11806 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
11807 for us.
11808 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
11809 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
11810
11811 * src/files.c: Include gnulib's xstrndup.h.
11812
11813 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
11814 (REALLOC): Use xnrealloc, for likewise.
11815 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
11816 (strnlen, memrchr): Remove decls; functions no longer used.
11817 Include <stpcpy.h>.
11818
11819 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
11820 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11821 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
11822 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
11823 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
11824 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
11825 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
11826 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
11827 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
11828 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
11829 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
11830 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11831 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
11832 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
11833 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
11834 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
11835 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
11836 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
11837 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
11838 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
11839 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
11840 Remove, as these files are now generated automatically
11841 by bootstrap or automake.
11842
11843 * po/ChangeLog: Remove: all but one entry was a duplicate
11844 of this file, and I moved that 2000-11-02 entry here.
11845
11846 * config/.cvsignore: Add Makefile, depcomp, install-sh.
11847 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
11848 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
11849 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
11850 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
11851 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
11852 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
11853 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
11854 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
11855 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
11856 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
11857 xstrndup.h.
11858 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
11859 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
11860 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
11861 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
11862 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
11863 * src/.cvsignore: Remove *_.c.
11864
11865
11866 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
11867 support it. (The latest stable gzip doesn't.)
11868
118692004-04-27 Paul Eggert <eggert@twinsun.com>
11870
11871 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
11872 case, as stos_ is now used by destructors due to the 2004-02-09
11873 change.
11874
11875 Remove more K&R C support.
11876 * lib/libiberty.y (PARAMS): Remove. All uses removed.
11877 * lib/subpipe.c (errno): Remove decl.
11878 Include <stdlib.h> unconditionally.
11879 (EXIT_FAILURE): Remove macro.
11880 * src/complain.c (vfprintf, strerror): Remove.
11881 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
11882 unconditionally.
11883 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
11884 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
11885 (strchr, strspn, memchr): Remove decls.
11886 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
11887 unconditionally. Do not declare perror.
11888 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
11889 unconditionally.
11890
11891 * src/complain.c (_): Remove useless defn, as system.h defines this.
11892
11893 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
11894 with latest obstack.h.
11895 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
11896 to procedure types, as obstack.h now does that for us.
11897 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
11898
11899 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
11900 so that this include file can stand alone.
11901 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
11902 does this now. Include subpipe.h first after config.h, to
11903 test whether it can stand alone.
11904
11905 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
11906 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
11907 unused declaration.
11908
11909 * tests/synclines.at (%union synch line): Put a dummy member in
11910 the union, because empty unions aren't allowed in C. Caught
11911 by GCC 3.4.0.
11912
4f16766c
PE
119132004-04-13 Jim Meyering <jim@meyering.net>
11914
11915 * src/conflicts.c (conflicts_print): Correct format string typo:
11916 use `%%' to produce literal `%'. (trivial change)
11917
779e7ceb
PE
119182004-03-30 Paul Eggert <eggert@twinsun.com>
11919
11920 * src/getargs.c (version): Update copyright year to 2004.
11921
11922 * data/c.m4 (b4_int_type): Use 'short int' rather than
11923 'short', and similarly for 'long', 'unsigned', etc.
11924 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
11925 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
11926 yy_yypstack, yydumpstack): Likewise.
11927 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
11928 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
11929 Likewise.
11930 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
11931 yy_stack_print, yyparse): Likewise.
11932 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
11933 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
11934 * lib/bitset.c (bitset_print): Likewise.
11935 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
11936 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11937 * lib/bitsetv.c (bitsetv_dump): Likewise.
11938 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
11939 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
11940 Likewise.
11941 * src/LR0.c (allocate_itemsets): Likewise.
11942 * src/gram.h (rule_number, rule): Likewise.
11943 * src/lalr.h (goto_number): Likewise.
11944 * src/nullable.c (nullable_compute): Likewise.
11945 * src/output.c (prepare_rules): Likewise.
11946 * src/relation.c (relation_print, relation_digraph): Likewise.
11947 * src/relation.h (relation_node): Likewise.
11948 * src/state.h (state_number, transitions, errs, reductions,
11949 struct state): Likewise.
11950 * src/symtab.h (symbol_number, struct symbol): Likewise.
11951 * src/tables.c (vector_number, tally, action_number,
11952 default_goto, goto_actions): Likewise.
11953 * tests/existing.at (GNU Cim Grammar): Likewise.
11954 * tests/regression.at (Web2c Actions): Likewise.
11955
11956 * src/output.c (muscle_insert_short_int_table): Renamed from
11957 muscle_insert_short_table. All uses changed.
11958
d6328241
PH
119592004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11960
11961 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
11962 (declaration): Replace expected_conflicts with expected_sr_conflicts.
11963 Add %expect-rr rule.
4f16766c 11964
d6328241
PH
11965 * src/scan-gram.l: Recognize %expect-rr.
11966
4f16766c 11967 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 11968 expected_conflicts.
4f16766c 11969 (expected_rr_conflicts): Declare.
d6328241
PH
11970
11971 * src/conflicts.c (expected_sr_conflicts): Rename from
11972 expected_conflicts.
11973 (expected_rr_conflicts): Define.
11974 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
11975 for GLR parsers.
11976 Use expected_sr_conflicts in place of expected_conflicts.
11977 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 11978
d6328241 11979 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 11980
1452af69
PE
119812004-03-08 Paul Eggert <eggert@gnu.org>
11982
11983 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 11984 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
11985
11986 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
11987 in lalr1.cc.
11988 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
11989 * src/scan-gram.l (scan_integer): New function.
11990 ({int}): Use it.
11991 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
11992 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
11993 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
11994 Say "long int", not "long", for uniformity with GNU style.
11995
006d217d
PE
119962004-02-25 Paul Eggert <eggert@twinsun.com>
11997
11998 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
11999 compilers. This fixes a problem with Intel's C++ compiler being
12000 chatty, reported by Guido Trentalancia in
161a71f3 12001 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 12002
c2729758
ADL
120032004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12004
12005 Support %destructor and merge error locations in lalr1.cc.
12006
12007 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12008 (Parser::stos_): Define unconditionally.
12009 (Parser::destruct_): New method. Generate its body with
12010 b4_yydestruct_generate.
12011 (Parser::error_start_): New attribute.
12012 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12013 token which are discarded.
12014 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12015 error_start_ when erroneous token are discarded.
12016 (Parser::parse) <yyerrlab1>: Compute the location of the error
12017 token so that it covers all the discarded tokens.
12018 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12019 it can be called with `%skeleton "lalr1.cc"', and do that.
12020
dd0e0635
PE
120212004-02-02 Paul Eggert <eggert@twinsun.com>
12022
12023 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12024 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12025 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12026 There's no need to mention top_builddir since Automake does that
12027 for us.
12028 (INCLUDES): Remove, as Automake says it's obsolescent.
12029 Contents migrated into AM_CPPFLAGS as described above.
12030 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12031
120322004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12033
12034 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12035 (yyreportSyntaxError): Handle case where lookahead token is
12036 YYEMPTY.
12037
be16239b
PH
120382004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12039
12040 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12041 resulting parsers are compilable with C++.
12042
5fa90832
PE
120432003-12-23 Paul Eggert <eggert@twinsun.com>
12044
12045 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12046 * src/output.c (output_skeleton): Rename local var.
12047 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12048 Bison tokens, as this runs afoul of the 2003-10-07 change that
12049 disallowed NUL bytes in character constants or string literals.
12050
12051 * tests/local.at: Require Autoconf 2.59's Autotest.
12052 * tests/testsuite.at: Don't include local.at, since we now assume
12053 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12054 including it.
12055 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12056 multiple inclusion warnings.
dd0e0635 12057
b165c324
AD
120582003-12-02 Akim Demaille <akim@epita.fr>
12059
12060 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12061 conditions.
12062 From Bruno Haible.
12063
26e06a21
ADL
120642003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12065
12066 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12067
92ac3705
PE
120682003-10-07 Paul Eggert <eggert@twinsun.com>
12069
6a5ecb38
PE
12070 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12071 if testsuite doesn't exist.
12072
92ac3705
PE
12073 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12074 literals, unfortunately.
12075 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12076 Complain about NUL bytes in character constants or string literals.
12077
91d2c560
PE
120782003-10-05 Paul Eggert <eggert@twinsun.com>
12079
12080 * NEWS: Don't document %no-default-prec, as it's still
12081 too experimental.
12082 * doc/bison.texinfo: Document %no-default-prec only if
12083 the defaultprec flag is set. Normally it's not.
12084
0cc3da3a
PE
120852003-10-04 Paul Eggert <eggert@twinsun.com>
12086
12087 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12088 non-modifiable lvalue, instead of a modifiable one.
12089 * doc/bison.texinfo (Actions): Document that $$ can
12090 be assigned to. Do not claim that $$ and $N are
12091 array element references: user code should not rely on this.
12092
22fccf95
PE
120932003-10-01 Paul Eggert <eggert@twinsun.com>
12094
12095 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12096 (grammar_declaration): Use it.
12097 * src/scan-gram.l: New token %no-default-prec.
12098 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12099 * NEWS, doc/bison.texinfo: Document the above.
12100
fc8f2965
AD
121012003-10-01 Akim Demaille <akim@epita.fr>
12102
12103 VCG no longer supports long_straight_phase.
12104
12105 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12106 * src/print_graph.c (print_graph): Adjust.
12107
39a06c25
PE
121082003-09-30 Frank Heckenbach <frank@g-n-u.de>
12109 and Paul Eggert <eggert@twinsun.com>
12110
12111 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12112 Table of Symbols): Document %default-prec.
12113 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12114 (grammar_declaration): Set default_prec on %default-prec.
12115 * src/scan-gram.l (%default-prec): New token.
12116 * src/reader.h (default_prec): New flag.
12117 * src/reader.c: Likewise.
12118 (packgram): Handle it.
12119 * tests/conflicts.at (%default-prec without %prec,
12120 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 12121
39a06c25
PE
121222003-09-30 Paul Eggert <eggert@twinsun.com>
12123
12124 * tests/testsuite.at: Include local.at, not input.at, fixing
12125 a typo in the 2003-08-25 patch.
12126
62b6aef9
AD
121272003-08-27 Akim Demaille <akim@epita.fr>
12128
12129 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12130 GCC warnings.
12131
89e1cc61
AD
121322003-08-26 Akim Demaille <akim@epita.fr>
12133
12134 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12135 "<\#" to avoid magic from Gnus when posting parts of this script.
12136
a08460b0
AD
121372003-08-26 Akim Demaille <akim@epita.fr>
12138
12139 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12140 (Parser::parse): here.
12141 Adjust: nerrs and errstatus is now replaced by...
12142 (Parser::nerrs_, Parser::errstatus_): New.
12143
603f1cfd
AD
121442003-08-25 Akim Demaille <akim@epita.fr>
12145
12146 * config/announce-gen, Makefile.cfg: New.
12147 * Makefile.am: Adjust.
12148 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12149 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12150
cd3684cf
AD
121512003-08-25 Akim Demaille <akim@epita.fr>
12152
12153 When reducing initial empty rules, Bison parser read an initial
12154 location that is not defined. This results in garbage, and that
12155 affects Bison's own parser. Therefore we need (i) to extend Bison
12156 to support a means to initialize this location, and (ii) to use
12157 this CVS Bison to fix CVS Bison's parser.
12158
12159 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12160 with...
12161 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12162 * src/parse-gram.y: Adjust.
12163 (%initial-action): New.
12164 (%error-verbose): Since we require CVS Bison, there is no reason
12165 not to use it.
12166 * src/scan-gram.l: Adjust.
12167 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12168 * data/yacc.c (yyparse): Use b4_initial_action.
12169
4e03e201
AD
121702003-08-25 Akim Demaille <akim@epita.fr>
12171
12172 * doc/bison.texinfo: Don't promote stdout for error messages.
12173
8c182d05
AD
121742003-08-25 Akim Demaille <akim@epita.fr>
12175
12176 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12177 From Alexandre Duret-Lutz.
12178
6a60c4cf
PE
121792003-08-25 Akim Demaille <akim@epita.fr>
12180
12181 Version 1.875c.
12182
25f66e1a
AD
121832003-08-25 Akim Demaille <akim@epita.fr>
12184
12185 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12186 Use them.
12187
5348bfbe
AD
121882003-08-25 Akim Demaille <akim@epita.fr>
12189
12190 * data/lalr1.cc (Parser::reduce_print_): New.
12191 Use it.
12192
47301314
AD
121932003-08-25 Akim Demaille <akim@epita.fr>
12194
12195 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12196 error recovery loops. This patch is based on
161a71f3 12197 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12198 Also, augment the similarity between lalr1.cc and yacc.c.
12199 Note: the locations of error recovery rules are not correct yet.
12200
12201 * data/lalr1.cc: Comment changes to augment the similarity between
12202 lalr1.cc and yacc.c.
12203 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12204 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12205 yyerrlab), when hitting EOF, pop the whole stack here instead of
12206 merely falling thru the default error handling mechanism.
12207 (yyerrorlab): New label, with the old contents of YYERROR,
12208 plus the following change: pop the stack of rhs corresponding
12209 to the production that invoked YYERROR. That is how Yacc
12210 behaves (required by POSIX).
12211 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12212 fail.
12213
1f7a61ff
AD
122142003-08-25 Akim Demaille <akim@epita.fr>
12215
12216 Tune local.at so that people can "autom4te -l autotest calc.at -o
12217 calc" for instance, to extract a sub test suite.
12218
12219 * tests/testsuite.at: Move the initialization, Autotest version
12220 requirement, and AT_TESTED invocation into...
12221 * tests/local.at: here.
12222 * tests/testsuite.at: Include it for compatibility with Autoconf
12223 2.57.
12224 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12225 be ignore.
12226
327b5b56
PE
122272003-08-04 Paul Eggert <eggert@twinsun.com>
12228
12229 Rework code slightly to avoid gcc -Wtraditional warnings.
12230 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12231 The returned value is now stored in *YY0. All callers changed.
12232 * src/output.c (merge_output): Adjust to the above change.
12233
0051e3ed
PE
122342003-07-26 Paul Eggert <eggert@twinsun.com>
12235
12236 * data/glr.c (YYASSERT): New macro.
12237 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12238 yyresolveStates, yyprocessOneStack):
12239 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12240 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12241
137437c6
PE
122422003-07-25 Paul Eggert <eggert@twinsun.com>
12243
5b620e06
PE
12244 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12245 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12246 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12247 by Frank Heckenbach, though I have omitted the structure-initialization
12248 part of his glr-knr.diff patch since I recall that the Portable
12249 C Compiler didn't require that change.
12250
137437c6
PE
12251 Let the user specify how to allocate and free memory.
12252 Derived from a suggestion by Frank Heckenbach in
161a71f3 12253 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12254 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12255 All uses of free, malloc, realloc changed to use these macros,
12256 and unnecessary casts removed.
12257 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12258
ddb85ca5
PE
122592003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12260
12261 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12262 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12263 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12264 (trivial change)
12265
39910e09
AD
122662003-06-25 Akim Demaille <akim@epita.fr>
12267
12268 * config/depcomp, config/install-sh: Update from masters.
12269
0ae99356
PE
122702003-06-20 Paul Eggert <eggert@twinsun.com>
12271
12272 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12273 and return properly parenthesized result.
12274 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12275 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12276 Remove unnecessary parentheses from uses.
12277 * doc/bison.texinfo (Location Default Action): Describe the
12278 conventions for parentheses.
12279
cd05d13c
PE
122802003-06-19 Paul Eggert <eggert@twinsun.com>
12281
81fd08ca
PE
12282 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12283 yyreportTree): Do not assume that size_t is the same width as int,
12284 when printing sizes. Print sizes using an unsigned format.
12285 Problem reported by Frank Heckenbach in
161a71f3 12286 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12287
cd05d13c
PE
12288 Port to Forte Developer 7 C compiler.
12289 * data/glr.c (struct YYLTYPE): If locations are not being used,
12290 declare a single dummy member, as empty structs do not conform
12291 to the C standard.
12292 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12293 the Forte Developer 7 C compiler complains that end-of-loop
12294 code is not reached.
12295
4dcf140b
PE
122962003-06-17 Paul Eggert <eggert@twinsun.com>
12297
12298 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12299 avoid warnings from picky compilers about redefinition of PARAMS.
12300
8dd76bee
PE
123012003-06-17 Paul Eggert <eggert@twinsun.com>
12302
12303 Version 1.875b.
12304
12305 * NEWS: Document 1.875b.
12306
12307 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12308 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12309 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12310 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12311 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12312 per recent gettext manual's suggestion.
12313 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12314 Use prototypes, not old-style definitions.
12315 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12316 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12317 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12318 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12319 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12320 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12321 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12322 vbitset_or_and_cmp, vbitset_copy): Likewise.
12323
12324 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12325 Do not include <stdlib.h>.
12326 (PARAMS): Define unconditionally for C89.
12327 (ATTRIBUTE_NORETURN): Remove.
12328 (ATTRIBUTE_UNUSED): Define unconditionally.
12329
12330 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 12331 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
12332 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12333 * lib/vbitset.c, lib/vbitset.h: New files.
12334 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12335 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12336 from libbitset.
12337
12338 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12339 `How Can I Reset @code{yyparse}', since texinfo does not allow
12340 arbitrary @ in node names.
12341
12342 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12343 shouldn't be needed according to the gettext 0.12.1 documentation
12344 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 12345 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 12346 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 12347 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 12348
8dd76bee
PE
12349 * lib/.cvsignore: Add stdbool.h.
12350 * m4/.cvsignore: Add nls.m4, po.m4.
12351
12352 Upgrade to CVS gnulib.
12353 * stdbool_.h: File renamed from stdbool.h.in.
12354 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12355 AC_HEADER_STDBOOL.
12356 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12357 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12358 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12359 (MOSTLYCLEANFILES): New var.
12360 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12361 (stdbool.h): New rule.
12362 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12363 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12364 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12365 m4/quote.m4: Upgrade to today's gnulib.
12366
12367 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12368 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12369 the tests right now.
12370 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12371 yyerror are declared before use; C99 requires this.
12372
25005f6a
PH
123732003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12374
12375 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12376 first.
12377 (yyrecoverSyntaxError): Correct the logic for setting and testing
12378 yyerrState.
12379 Correct comment on handling EOF.
12380 Allow states with only a default reduction, rather than failing
8dd76bee 12381 (I can't quite reconstruct why these were not allowed before).
25005f6a 12382
137437c6 12383 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 12384 buffer overruns, corrupting state.
8dd76bee
PE
12385
12386 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
12387 definition.
12388 * src/reader.h (max_left_semantic_context): New variable declaration.
12389 * src/scan-gram.l (max_left_semantic_context): Define.
12390 (handle_action_dollar): Update max_left_semantic_context.
12391 * data/glr.c (YYMAXLEFT): New definition.
12392 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12393 (yyresolveAction): Ditto.
12394
12395 Fixes to problems with location handling in GLR parsers reported by
12396 Frank Heckenbach (2003/06/05).
12397
12398 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12399 (YYRHSLOC): Add parentheses, and define only if locations used.
12400 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12401 locations not used.
12402 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12403 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 12404
25005f6a
PH
12405 * tests/cxx-type.at: Exercise location information; update tests
12406 to differentiate output with and without locations.
8dd76bee 12407 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
12408 because default YYLTYPE not yet defined.
12409 Change semantic actions to compute strings, rather than printing
12410 them directly (to test proper passing of semantics values). Change
12411 output to prefix notation and update test data and expected results.
12412 (yylex): Track locations.
12413 (stmtMerge): Return value rather than printing, and include arguments
12414 in value.
8dd76bee 12415
711f40b7
PE
124162003-06-03 Paul Eggert <eggert@twinsun.com>
12417
12418 Avoid warnings generated by GCC 2.95.4 when Bison is
12419 configured with --enable-gcc-warnings.
12420 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12421 yy::]b4_parser_class_name[::translate_,
12422 yy::Stack::operator[] (unsigned),
12423 yy::Stack::operator[] (unsigned) const,
12424 yy::Slice::operator[] (unsigned),
12425 yy::Slice::operator[] (unsigned) const):
12426 Rename local vars to avoid warnings.
12427 * tests/glr-regression.at (Improper handling of embedded actions
12428 and $-N in GLR parsers): Remove unused local variable from yylex.
12429 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12430 (void) as arg when not pure, since we now assume C89 when building
12431 Bison. Pacify GCC by using parameter.
12432
ac695f7d
PE
124332003-06-02 Paul Eggert <eggert@twinsun.com>
12434
12435 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12436 yy::Location::lines, yy::Location::columns): Rename arguments
12437 to avoid shadowing; this removes a warning generated by GCC 3.3.
12438
26ec81e0
PE
124392003-06-01 Paul Eggert <eggert@twinsun.com>
12440
12441 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12442 to g++, as GCC 3.3 complains if you do it.
12443 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12444 everything that WARNING_CFLAGS has, except omit warnings
12445 not suitable for C++.
12446 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12447 * tests/atlocal.in (CXXFLAGS): New var.
12448 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12449
12450 Fix a GLR parser bug I reported in February; see
161a71f3 12451 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
12452 The problem was that GLR parsers did not conform to the C standard,
12453 because actions like { $1 = $2 + $3; } expanded to expressions
12454 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12455 to a local variable. The C standard says that expressions
12456 like (var = f ()) + (var = f ()) have undefined behavior.
12457 Another problem was that GCC sometimes issues warnings that
12458 yyfill and its parameters are unused.
12459
12460 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12461 as possibly unused.
12462 (yyfill): New function.
12463 (YYFILL): Use it.
12464 (yyuserAction): Change type of yynormal to bool, so that it matches
12465 the new yyfill signature. Mark it as possibly unused.
12466
12467
12468 Follow up on a bug I reported in February, where a Bison-generated
12469 parser can loop. Provide a test case and a fix for yacc.c. I
12470 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12471 The original bug report is in:
161a71f3 12472 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
12473
12474 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12475 macro's size was becoming unwieldy.
12476 (yyerrlab): Do not discard an empty lookahead symbol, as this
12477 might destroy garbage.
12478 (yyerrorlab): New label, with the old contents of YYERROR,
12479 plus the following change: pop the stack of rhs corresponding
12480 to the production that invoked YYERROR. That is how Yacc
12481 behaves, and POSIX requires this behavior.
12482 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12483 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12484 Define 'alarm' to do nothing if unistd.h is not available.
12485 Add a new rule "exp: '-' error;" to test the above change to
12486 data/yacc.c. Use 'alarm' to abort any test taking longer than
12487 10 seconds, as it's probably looping.
12488 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12489 Also, the new yacc.c generates two fewer diagnostics for an
12490 existing test.
12491
d0829076
PE
124922003-05-24 Paul Eggert <eggert@twinsun.com>
12493
c6ae27df
PE
12494 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12495 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12496 This fixes a problem reported by John Bowman when the Compaq/HP
12497 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12498 -ansi -Wall -gall).
12499 * data/yacc.c (union yyalloc): Likewise.
12500 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 12501
d0829076
PE
12502 Switch from 'int' to 'bool' where that makes sense.
12503
12504 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12505 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12506 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12507 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12508 Return or accept bool, not int. All callers changed.
12509 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12510 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12511 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12512 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12513 bitset_or_and_cmp_): Likewise.
12514 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12515 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12516 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12517 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12518 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12519 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12520 bitset_stats_or_and_cmp): Likewise.
12521 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12522 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12523 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12524 ebitset_xor_cmp): Likewise.
12525 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12526 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12527 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12528 lbitset_xor_cmp): Likewise.
12529 * lib/bbitset.h: Include <stdbool.h>.
12530 (struct bitset_vtable): The following members now return bool, not
12531 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12532 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12533 or_and_cmp).
12534 * src/conflicts.c (count_rr_conflicts): Likewise.
12535 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12536 All uses changed.
12537 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12538 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12539 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12540 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12541 graph_flag): Likewise.
12542 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12543 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12544 graph_flag): Likewise.
12545 * src/output.c (error_verbose): Likewise.
12546 * src/output.h (error_verbose): Likewise.
12547 * src/reader.c (start_flag, typed): Likewise.
12548 * src/reader.h (typed): Likewise.
12549 * src/getargs.c (LOCATIONS_OPTION): New constant.
12550 (long_options, getargs): Use it.
12551 * src/lalr.c (build_relations): Use bool, not int.
12552 * src/nullable.c (nullable_compute): Likewise.
12553 * src/print.c (print_reductions): Likewise.
12554 * src/tables.c (action_row, pack_vector): Likewise.
12555 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12556 * src/output.c (prepare): Use it.
12557 * src/output.c (token_definitions_output,
12558 symbol_destructors_output, symbol_destructors_output): Use string,
12559 not boolean integer, to keep track of whether to output separator.
12560 * src/print_graph.c (print_core): Likewise.
12561 * src/state.c (state_rule_lookaheads_print): Likewise.
12562
12563 * config/install-sh: Sync from automake 1.7.5.
12564
6b2584b7
PE
125652003-05-14 Paul Eggert <eggert@twinsun.com>
12566
12567 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12568 semicolon after a grammar declaration, in the interest of possible
12569 future changes to the Bison input language.
12570 Do not allow a stray semicolon at the start of the grammar.
12571 (rhses.1): Allow one or more semicolons after any rule, including
12572 just before "|" as required by POSIX.
12573 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12574 grammar.
12575
caf37a36
ADL
125762003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12577
12578 %parse-param support for lalr1.cc.
12579
12580 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12581 b4_cc_constructor_calls, b4_cc_constructor_call,
12582 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12583 definitions.
12584 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12585 parse-param arguments.
12586 (yy::b4_parser_class_name): Declare instance variables to
12587 hold parse-param arguments.
12588 * tests/calc.at: s/value/semantic_value/ because value clashes
12589 with a member of yy::b4_parser_class_name. Adjust C++ code
12590 to handle %parse-param. Enable %parse-param test in C++.
12591
3ab37077
PE
125922003-05-12 Paul Eggert <eggert@twinsun.com>
12593
12594 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12595 English a bit. Fix fclose typo. Change "const char" to "char
12596 const", and use ANSI C rather than K&R for "main". Suggest
12597 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12598 and suggest yy_switch_to_buffer.
12599
126002003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
12601
12602 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12603 C89. This avoids a diagnostic on compilers that define __STDC__
12604 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 12605 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 12606
e743727f
PE
126072003-05-03 Paul Eggert <eggert@twinsun.com>
12608
12609 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12610 Do not overrun array bounds.
12611 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 12612 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 12613
916708d5
AD
126142003-04-29 Akim Demaille <akim@epita.fr>
12615
12616 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12617 * src/getargs.c, src/getargs.h: here, as bool, not int.
12618 (nondeterministic_parser): New.
12619 * src/parse-gram.y, src/scan-gram.l: Support
12620 %nondeterministic-parser.
12621 * src/output.c (prepare): Use nondeterministic_parser instead
12622 of glr_parser where appropriate.
12623 * src/tables.c (conflict_row, action_row, save_row)
12624 (token_actions, token_actions, pack_vector): Ditto.
12625
a06ea4aa
AD
126262003-04-29 Akim Demaille <akim@epita.fr>
12627
12628 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12629
211074ca
AD
126302003-04-29 Akim Demaille <akim@epita.fr>
12631
12632 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12633 with %pure-parser and %locations to exercise the patch from Yakov
12634 Markovitch below.
12635
6175ffe3
PE
126362003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12637
12638 * data/yacc.c: (b4_lex_param): Corrected for the case where
12639 %lex-param is provided and %pure-parser isn't.
12640
b1e95857
PE
126412003-04-27 Paul Eggert <eggert@twinsun.com>
12642
12643 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 12644 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
12645 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12646 if it is not defined.
12647 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12648
acda9df6
PE
126492003-04-26 Paul Eggert <eggert@twinsun.com>
12650
3470c57b
PE
12651 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12652 Declare to be of type suitable for the ninf value itself, not of
12653 type suitable for the corresponding table, since the latter might
12654 be unsigned but the ninf value might be negative. This fixes a
12655 bug reported by Alexandre Duret-Lutz in
161a71f3 12656 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 12657
acda9df6
PE
12658 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12659 invokes it. We shouldn't invoke it twice because it will attempt
12660 to put error.o in the archive twice. This fixes a glitch reported
12661 by Martin Mokrejs in
161a71f3 12662 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 12663
b5250f26
PE
126642003-04-21 Paul Eggert <eggert@twinsun.com>
12665
12666 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12667 to gnulib.
12668
089ac0f1
PE
126692003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12670
12671 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12672 Fix obvious typo that results in uncompilable GLR parsers
12673 when both %pure-parser and %locations are used. (trivial change)
12674
5ededac6
PE
126752003-04-17 Paul Eggert <eggert@twinsun.com>
12676
1b8f2fff
PE
12677 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12678 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12679 Do not insert the expected token via unput, as this runs afoul
12680 of a POSIX-compatibility bug in flex 2.5.31.
12681 All uses changed to BEGIN the parent state,
12682 since we no longer insert the expected token via unput.
12683 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12684 that is no longer emitted after the above change.
12685
5ededac6
PE
12686 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12687 the first one. This change is from Paul Hilfinger, and it fixes
12688 regression reported by Werner Lemberg in
161a71f3 12689 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
12690
12691 (resolve_sr_conflict): Don't invoke state_errs_set
12692 unless one or more tokens have been explicitly made errors.
12693 Otherwise, the above change causes Bison to abort.
12694
12695 * tests/existing.at (GNU pic Grammar): New test case, taken from
12696 Lemberg's email.
12697
b8be9132
AD
126982003-03-31 Akim Demaille <akim@epita.fr>
12699
12700 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12701
d423d460
AD
127022003-03-31 Akim Demaille <akim@epita.fr>
12703
12704 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12705 output.
12706
c7e441b4
AD
127072003-03-31 Akim Demaille <akim@epita.fr>
12708
12709 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12710 From Paul Hilfinger.
12711
231897ad
AD
127122003-03-29 Akim Demaille <akim@epita.fr>
12713
12714 * m4/error.m4: Do not put under dynamic conditions some code which
12715 expansion is under static control.
12716
5b066063
AD
127172003-03-29 Akim Demaille <akim@epita.fr>
12718
12719 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
12720
22a74fec
AD
127212003-03-29 Akim Demaille <akim@epita.fr>
12722
12723 * doc/bison.texinfo (Strings are Destroyed): New.
12724
0eee27e7
PE
127252003-03-13 Paul Eggert <eggert@twinsun.com>
12726
12727 * .cvsignore: Add configure.lineno.
12728 * src/.cvsignore: Add yacc.
12729 * tests/.cvsignore: Add testsuite.log.
12730 * doc/fdl.texi: Sync with latest FSF version.
12731
f61aad93
PE
127322003-03-12 Paul Eggert <eggert@twinsun.com>
12733
537636c7
PE
12734 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
12735 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
12736 cursor, instead of leaving it undefined. This fixes a bug
12737 reported by Tim Van Holder in
161a71f3 12738 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
12739 * tests/input.at (Torturing the Scanner): Test the scanner on
12740 an empty input file, which was Tim Van Holder's test case.
12741
12742 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
12743 <sys/resource.h> can be included, include sys/time.h and
12744 sys/times.h first, if available. This works around the SunOS
12745 4.1.4 porting bug reported by Bruce Becker in
161a71f3 12746 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
12747
12748 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
12749 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
12750 AC_HEADER_SYS_WAIT.
12751
f61aad93
PE
12752 Merge changes from gnulib. This was prompted because the CVS
12753 snapshot didn't build on Solaris 7 due to strnlen problems.
12754
12755 These changes need to be merged back into gnulib:
12756 * lib/hash.c: Include <stdbool.h> unconditionally.
12757 * m4/onceonly.m4 (m4_quote): New macro.
12758 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
12759 Quote AC_FOREACH variable-expansions properly.
12760 The 2003-01-03 obstack.h change also needs merging.
12761 {end of changes requiring merging}
5b066063 12762
f61aad93
PE
12763 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12764 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
12765 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
12766 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
12767 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
12768 New files, imported from gnulib.
12769 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
12770 above.
12771
12772 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
12773 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
12774 gnulib sources.
12775
12776 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
12777 Add.
12778 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
12779 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
12780 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
12781 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
12782 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
12783 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
12784 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
12785 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
12786 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
12787 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
12788 (jm_PREREQ_ARGMATCH): Remove.
12789 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
12790 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
12791
12792 * src/system.h: Include <stdbool.h> unconditionally.
12793
12794 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
12795 assuming at least C89 in the bitset code for some time now.
12796
d2ffe116
AD
127972003-03-03 Akim Demaille <akim@epita.fr>
12798
12799 * ro.po: New.
12800
052826fd
AD
128012003-03-02 Akim Demaille <akim@epita.fr>
12802
12803 * doc/bison.texinfo (Table of Symbols): Reactivate the
12804 documentation for %lex-param, and %parse-param.
12805
c4749565
AD
128062003-03-02 Akim Demaille <akim@epita.fr>
12807
12808 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
12809 generate verbose error messages.
12810 Use the number of tokens as an upper bound in yytname, as it
12811 cannot be a non terminal.
12812
d5286af1
AD
128132003-03-02 Akim Demaille <akim@epita.fr>
12814
12815 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
12816 message.
12817
22e304a6
AD
128182003-03-02 Akim Demaille <akim@epita.fr>
12819
22e304a6
AD
12820 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
12821 Use them to exercise yycheck overrun.
12822 Based on Andrew Suffield's grammar.
12823
67a25fed
AD
128242003-03-02 Akim Demaille <akim@epita.fr>
12825
12826 Create tests/local.at for Bison generic testing macros.
12827
12828 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
12829 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
12830 This new file.
12831 * tests/calc.at (AT_CHECK_CALC): Adjust.
12832 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
12833 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
12834 * tests/local.at: here.
12835 (AT_COMPILE_CXX): Tags the tests using it as c++.
12836 Ignore the test if CXX is not functional.
12837
9c2b381f
PE
128382003-03-01 Paul Eggert <eggert@twinsun.com>
12839
12840 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
12841 not loc->end, since loc->end might contain garbage and this leads
12842 to undefined behavior on some platforms.
12843 (id_loc, token_start): Use (IF_LINTed) initial values that do not
12844 depend on *loc, so that the reader doesn't give the the false
12845 impression that *loc is initialized.
12846 (<INITIAL>"%%"): Do not bother setting code_start, since its value
12847 does not survive the return.
12848
0433ba88
AD
128492003-03-01 Akim Demaille <akim@epita.fr>
12850
12851 * src/scan-gram.l (code_start): Always initialize it when entering
12852 into yylex, as SC_EPILOGUE is activated *before* the corresponding
12853 yylex invocation. An alternative would be making it static, but
12854 then it starts with the second %%'s beginning, instead of its end.
12855
b305ea69
PE
128562003-02-28 Paul Eggert <eggert@twinsun.com>
12857
12858 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
12859 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 12860 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 12861
c3d25e01
PE
128622003-02-26 Paul Eggert <eggert@twinsun.com>
12863
12864 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
12865 Remove Sequent/Pyramid discussion (nobody uses them any more).
12866 Merge VMS and MS-DOS discussion; these ports may well be dead
12867 but let's keep mentioning them for now. Put <> around email
12868 addresses. Add copyright notice.
12869
c267ffbc
PE
128702003-02-24 Paul Eggert <eggert@twinsun.com>
12871
12872 * data/glr.c (yy_reduce_print): yylineno -> yylno,
12873 to avoid collision with flex use of yylineno.
12874 Problem reported by Bruce Lilly in
161a71f3 12875 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
12876 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12877 * data/yacc.c (yy_reduce_print): Likewise.
12878
12879 * config/depcomp: Sync with Automake 1.7.3.
12880
f939fc12
AD
128812003-02-21 Akim Demaille <akim@epita.fr>
12882
12883 * data/lalr1.cc: Use temporary variables instead of casts to
12884 change integer types.
12885 Suggested by Paul Eggert.
12886
95923bd6
AD
128872003-02-21 Akim Demaille <akim@epita.fr>
12888
12889 * doc/bison.texinfo: Use "location" consistently to refer to @n,
12890 to avoid confusions with lalr1.cc's notion of Position.
12891 Suggested by Paul Eggert.
12892
2cdc240e
AD
128932003-02-20 Akim Demaille <akim@epita.fr>
12894
12895 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
12896 before initial_columns.
12897 (location.hh): Use consistent variable names when defining the
12898 operator<<.
12899 Use "last" so that we subtract from Positions, not from unsigned.
12900
5d003116
AD
129012003-02-20 Akim Demaille <akim@epita.fr>
12902
12903 * data/lalr1.cc (position.hh): New subfile, including the extended
12904 and Doxygen'ed documentation of class Position.
12905 (location.hh): Use it.
12906 Document a` la Doxygen.
ba1ecc07 12907 With the help of Benoit Perrot.
5d003116 12908
d02b25f9
AD
129092003-02-20 Akim Demaille <akim@epita.fr>
12910
12911 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
12912 AT_YACC_IF.
12913 Redefine AT_YYERROR_SEES_LOC_IF using it.
12914 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
12915 not defined.
12916 Don't use the location in yy::Parser::error_ and
12917 yy::Parser::print_ when not %locations.
12918 Activate more lalr1.cc tests.
12919
0d1c3a04
AD
129202003-02-19 Akim Demaille <akim@epita.fr>
12921
12922 * data/lalr1.cc: When displaying a line number, be sure to make it
12923 an int.
12924
60a777aa
AD
129252003-02-19 Akim Demaille <akim@epita.fr>
12926
12927 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
12928 Remove, useless.
12929 (YYABORT, YYACCEPT, YYERROR): New.
12930 * tests/calc.at: Renable the lalr1.cc test.
12931
0b86fc41
AD
129322003-02-19 Akim Demaille <akim@epita.fr>
12933
12934 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
12935 error recovery, mixing with/without pops and discarding of the
12936 lookahead.
12937 Exercise YYERROR.
12938 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
12939
da99a5dc
PE
129402003-02-17 Paul Eggert <eggert@twinsun.com>
12941
12942 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
12943 * tests/testsuite.at (AT_COMPILE): Use them.
12944 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 12945 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 12946
93b8c255
PE
129472003-02-12 Paul Eggert <eggert@twinsun.com>
12948
12949 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
12950 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 12951 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
12952 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
12953 Check for malloc failure, for consistency with yacc.c.
12954 (yytname_size): Remove, for consistency with yacc.c.
12955
12956 The bug still remains in data/lalr1.cc, as I didn't have time
12957 to fix it there.
12958
7548fed2
AD
129592003-02-06 Akim Demaille <akim@epita.fr>
12960
12961 * configure.ac (GXX): Rename as...
12962 (CXX): this, to keep the original Autoconf semantics.
12963 Require 2.57.
12964 * data/lalr1.cc: Fix b4_copyright invocations.
12965 If YYDEBUG is not defined, don't depend upon name_ being defined.
12966 (location.hh): Include string and iostream.
12967 (Position::filename): New member.
12968 (Position::Position ()): New.
12969 (operator<< (Position)): New.
12970 (operator- (Position, int)): New.
12971 (Location::first, Location::last): Rename as...
12972 (Location::begin, Location::end): these, to mock the conventional
12973 iterator names.
12974 (operator<< (Location)): New.
12975 * tests/atlocal.in (CXX): New.
12976 * tests/testsuite.at (AT_COMPILE_CXX): New.
12977 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
12978 locations in a more synthetic way.
12979 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
12980 lalr1.cc is used.
12981 Adjust the C locations to match those from Emacs: first column is
12982 column 0.
12983 Change all the expected results.
12984 Conform to the GCS: simplify the locations when applicable.
12985 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
12986 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
12987 these CPP macros with the m4 macros new defined by...
12988 (AT_CHECK_PUSHDEFS): this, i.e.:
12989 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 12990 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
12991 New macros.
12992 (AT_CHECK_POPDEFS): Undefine them.
12993 (AT_CHECK_CALC_LALR1_CC): New.
12994 Use it for the first lalr1.cc test.
12995
43a176ef
AD
129962003-02-04 Akim Demaille <akim@epita.fr>
12997
12998 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
12999 Location as is defined.
13000
fc049e9c
AD
130012003-02-04 Akim Demaille <akim@epita.fr>
13002
13003 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13004 name_ being defined.
13005
a737b216
PE
130062003-02-03 Paul Eggert <eggert@twinsun.com>
13007
13008 * src/gram.h (start_symbol): Remove unused decl.
13009
13010 Use more-consistent naming conventions for local vars.
13011
13012 * src/derives.c (derives_compute): Change type of local var from
13013 int to rule_number.
13014 * src/gram.c (grammar_rules_partial_print): Likewise.
13015 * src/print.c (print_core): Likewise.
13016 * src/reduce.c (reduce_grammar_tables): Likewise.
13017
13018 * src/gram.c (grammar_dump): Change name of item_number *
13019 local var from r to rp.
13020 * src/nullable.c (nullable_compute): Likewise.
13021
13022 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13023
13024 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13025 for symbol or symbol_number var.
13026 * src/reader.c (grammar_start_symbol_set): Likewise.
13027 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13028 Likewise.
13029 * src/state.c (transitions_to): Likewise.
13030 * src/state.h: Likewise.
13031 * src/tables.c (symbol_number_to_vector_number): Likewise.
13032
13033 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13034 char * var.
13035
13036 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13037 var.
13038
13039 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13040 var.
13041
13042 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13043 Use str, not s, for char * var. Use ch, not c, for character var.
13044 Use size for size var.
13045
13046 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13047 char * var.
13048 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13049 uniqstr var.
13050 * src/uniqstr.h: Likewise.
13051
13052 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13053 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13054 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13055 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13056 param to have same name as that of enum, so that we don't use
13057 "s" to stand for a non-state.
13058
68e93ad5
AD
130592003-02-02 Akim Demaille <akim@epita.fr>
13060
13061 * src/scan-skel.l: Scan more than one inert character per yylex
13062 invocation.
13063
92898986
PE
130642003-02-01 Paul Eggert <eggert@twinsun.com>
13065
13066 Version 1.875a.
13067
1d9d5d71
PE
13068 * po/LINGUAS: Add ms.
13069
0435d061
AD
130702003-01-30 Akim Demaille <akim@epita.fr>
13071
13072 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13073
6029a57f
PH
130742003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13075
13076 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13077 of $1.
0435d061
AD
13078
13079 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 13080 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 13081 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 13082
6029a57f
PH
13083 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13084 (b4_rhs_location): Ditto.
0435d061 13085 (yyfill): New function to copy from stack tree into array
6029a57f 13086 incrementally.
0435d061
AD
13087 (yyuserAction): Modify to allow incremental move of semantic values
13088 to rhs array when in GLR mode.
13089 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
13090 as needed.
13091 Remove dummy use of yystack, as there is now a guaranteed use.
13092 (yydoAction): Modify to allow incremental move of semantic values
13093 to rhs array when in GLR mode.
13094 (yyresolveAction): Ditto.
13095 (yyglrShiftDefer): Update comment.
0435d061 13096 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
13097 (yyglrReduce): Ditto.
13098 (yydoAction): Ditto
0435d061 13099
6029a57f
PH
13100 * tests/glr-regr1.at: Rename to ...
13101 * tests/glr-regression.at: Add new regression test for the problems
13102 described above (adapted from S. Eken).
13103 Update copyright notice.
13104 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13105 * tests/Makefile.am: Ditto.
13106
6cee6297
PE
131072003-01-28 Paul Eggert <eggert@twinsun.com>
13108
13109 * data/lalr1.cc: Do not use @output_header_name@ unless
13110 b4_defines_flag is set. This fixes two bugs reported by
13111 Tim Van Holder in
161a71f3
PE
13112 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13113 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 13114
b2a836b5
PE
131152003-01-21 Paul Eggert <eggert@twinsun.com>
13116
13117 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13118 we don't need to worry about yyerrlab1 being reported as an
13119 "unused label" by non-GCC C compilers. The downside is that if
13120 locations are used then a couple of statements are duplicated each
13121 time YYERROR is invoked, but the upside is that the warnings
13122 should vanish.
13123 (yyerrlab1): Move code to YERROR.
13124 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13125 This reverts some of the 2002-12-27 change.
13126
4196b931
PE
131272003-01-17 Paul Eggert <eggert@twinsun.com>
13128
13129 * src/output.c (symbol_printers_output): Fix typo that led
13130 to core dump. Problem reported by Antonio Rus in
161a71f3 13131 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 13132
3ae831b4
AD
131332003-01-13 Akim Demaille <akim@epita.fr>,
13134 Quoc Peyrot <chojin@lrde.epita.fr>,
13135 Robert Anisko <anisko_r@lrde.epita.fr>
13136
13137 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13138 when the stacks contain one element, as the loop would otherwise
13139 free the last state, and then use the top state (the one we just
13140 popped). This means that the initial elements will not be freed
13141 explicitly, as is the case in yacc.c; it is not a problem, as
13142 these elements have fake values.
13143
e3aa65c5
PE
131442003-01-11 Paul Eggert <eggert@twinsun.com>
13145
13146 * NEWS: %expect-violations are now just warnings, reverting
13147 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13148 bootstrapping problem reported by Matthias Klose; see
161a71f3 13149 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13150 * src/conflicts.c (conflicts_print): Likewise.
13151 * tests/conflicts.at (%expect not enough, %expect too much,
13152 %expect with reduce conflicts): Likewise.
13153 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13154 that the warning is enabled if the number of conflicts changes
13155 (not necessarily increases).
13156
13157 * src/getargs.c (version): Update copyright year.
13158
f0057011
AD
131592003-01-09 Akim Demaille <akim@epita.fr>
13160
13161 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13162
1ee6d2a0
PE
131632003-01-08 Paul Eggert <eggert@twinsun.com>
13164
13165 * Makefile.maint (WGETFLAGS):
13166 New macro, containing "-C off" to disable proxy caches.
13167 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13168 (rel-check): Use $(WGET) instead of wget.
13169
d4fd77c4
PE
131702003-01-06 Paul Eggert <eggert@twinsun.com>
13171
13172 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13173 the GLR paper of Scott, Johnstone and Hussain.
13174
464c6927
PE
131752003-01-04 Paul Eggert <eggert@twinsun.com>
13176
d600ee67
PE
13177 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13178 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13179 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13180 (EXTRA_LIBRARIES): New var, for liby.a.
13181 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13182 (EXTRA_SCRIPTS): New var, for yacc.
13183
464c6927
PE
13184 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13185 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13186 Problem reported by Nelson H. F. Beebe.
13187
131882003-01-03 Paul Eggert <eggert@twinsun.com>
13189
13190 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13191 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13192 when compiling Bison 1.875's `bitset bset = obstack_alloc
13193 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13194
13195 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13196 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13197 grow to a huge size with typical invocation.
d600ee67 13198
464c6927
PE
13199 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13200 Use the pattern recommended by Autoconf 2.57, except also protect
13201 against double-definition.
13202 * src/system.h: Likewise.
13203 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13204
464c6927
PE
13205 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13206 All uses changed. Provide a definition in both C and C++.
13207 (yytrue, yyfalse): Define even if defined (__cplusplus).
13208
13209 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13210 Reported by Nelson H. F. Beebe.
d600ee67 13211
464c6927
PE
13212 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13213
0f42c7d5
PE
132142003-01-02 Paul Eggert <eggert@twinsun.com>
13215
13216 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13217 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13218 Bug reported by Nelson H. F. Beebe.
13219
dc546b0f
PE
132202003-01-01 Paul Eggert <eggert@twinsun.com>
13221
13222 * Version 1.875.
13223
2c09b6a7
PE
132242002-12-30 Paul Eggert <eggert@twinsun.com>
13225
13226 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13227 Moved here from...
13228 (<INITIAL>","): Here. This causes stray "," to be treated
13229 more uniformly.
13230
dc546b0f 13231 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13232 last brace in braced code when not in Yacc mode, for compatibility
13233 with Bison 1.35. This resurrects the 2001-12-15 patch to
13234 src/reader.c.
13235
13236 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13237 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13238
535c0f63
PE
132392002-12-28 Paul Eggert <eggert@twinsun.com>
13240
13241 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13242 that of SYM's type. This fixes Debian bug 168069, reported by
13243 Thomas Olsson.
d600ee67 13244
963fcc17
PE
132452002-12-28 Paul Eggert <eggert@twinsun.com>
13246
13247 Version 1.75f.
13248
13249 Switch back to the Yacc style of conflict reports, undoing some
13250 of the 2002-07-30 change.
13251 * doc/bison.texinfo (Understanding): Use Yacc style for
13252 conflict reports. Also, use new way of locating rules.
13253 * src/conflicts.c (conflict_report):
13254 Renamed from conflict_report_yacc, removing the old
13255 'conflict_report'. Translate the entire conflict report at once,
13256 so that we don't assume that "," has the same interpretation in
13257 all languages.
13258 (conflicts_output): Use Yacc-style conflict report for each state,
13259 instead of our more-complicated style.
13260 (conflicts_print): Use Yacc-style conflict report, except print
13261 the input file name when not emulating Yacc.
13262 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13263 Conflicted Reduction, %expect not enough, %expect too much,
13264 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13265 * tests/existing.at (GNU Cim Grammar): Likewise.
13266 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13267
13268 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13269 fatal): Don't invoke fflush; it's not needed and it might even be
13270 harmful for stdout, as stdout might not be open.
13271 * src/reduce.c (reduce_print): Likewise.
13272
b1efe548
PE
132732002-12-27 Paul Eggert <eggert@twinsun.com>
13274
13275 Fix a bug where error locations were not being recorded correctly.
13276 This problem was originally reported by Paul Hilfinger in
161a71f3 13277 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13278
13279 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13280 top of the location stack's error locations.
13281 (yyerrlab): Set it. When discarding a token, push its location
13282 onto yylerrsp so that we don't lose track of the error's end.
13283 (yyerrlab1): Now is only the target of YYERROR, so that we can
13284 properly record the location of the action that failed. For GCC
13285 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13286 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13287 (yyerrlab2): New label, which yyerrlab now falls through to.
13288 Compute the error's location by applying YYLLOC_DEFAULT to
13289 the locations of all the symbols that went into the error.
13290 * doc/bison.texinfo (Location Default Action): Mention that
13291 YYLLOC_DEFAULT is also invoked for syntax errors.
13292 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13293 Error locations include the locations of all the tokens that were
13294 discarded, not just the last token.
d600ee67 13295
983c5c2c
PE
132962002-12-26 Paul Eggert <eggert@twinsun.com>
13297
b1efe548
PE
13298 * src/files.c: Include quote.h.
13299 (compute_output_file_names): Warn if we detect conflicting
13300 outputs to the same file. This should catch the misunderstanding
13301 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13302
13303 * src/conflicts.c (conflicts_print): If the user specifies
13304 "%expect N", report an error if there are any reduce/reduce
13305 conflicts. This is what the manual says should happen.
13306 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13307 * tests/conflicts.at (%expect with reduce conflicts): New test.
13308
983c5c2c
PE
13309 Don't use m4_include on relative file names, as it doesn't work as
13310 desired if there happens to be a file with that name under ".".
d600ee67 13311
983c5c2c
PE
13312 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13313 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13314 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13315 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13316 * src/output.c (output_skeleton): Use full path names when
13317 specifying a file to include; don't rely on include path, as
13318 it's unreliable when the working file contains a file with
13319 that name.
d600ee67 13320
983c5c2c
PE
133212002-12-25 Paul Eggert <eggert@twinsun.com>
13322
13323 Remove obsolete references to bison.simple and bison.hairy.
13324 Problem mentioned by Aubin Mahe in
161a71f3 13325 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
13326 * data/glr.c: Comment fix.
13327 * doc/bison.1: Remove references. Also, mention "yacc".
13328
13329 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13330 with -g option.
13331
13332 * src/parse-gram.y (declaration): Use enum "report_states" rather
13333 than its numeric value 1.
13334
13335 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13336 opening a new one. This fixes Debian bug 165349, reported by
13337 Bruce Stephens.
13338
23f2d9dc
PE
133392002-12-24 Paul Eggert <eggert@twinsun.com>
13340
13341 Version 1.75e.
13342
13343 * Makefile.maint (cvs-update): Don't assume that the shell
13344 supports $(...), as Solaris sh doesn't.
13345
13346 * src/parse-gram.y (lloc_default): Remove test for empty
13347 nonterminals at the end, since it didn't change the result.
13348
133492002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
13350
13351 If the user does not define YYSTYPE as a macro, Bison now declares it
13352 using typedef instead of defining it as a macro. POSIX requires this.
13353 For consistency, YYLTYPE is also declared instead of defined.
13354
13355 %union directives can now have a tag before the `{', e.g., the
13356 directive `%union foo {...}' now generates the C code
13357 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13358 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13359 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13360 instead of `yyltype'.
13361
13362 `yystype' and `yyltype' are now obsolescent macros instead of being
13363 typedefs or tags; they are no longer documented and will be
13364 withdrawn in a future release.
13365
13366 * data/glr.c (b4_location_type): Remove.
13367 (YYSTYPE): Renamed from yystype.
13368 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13369 (struct YYLTYPE): Renamed from struct yyltype.
13370 (YYLTYPE): Renamed from yyltype.
13371 (yyltype, yystype): New (and obsolescent) macros,
13372 for backward compatibility.
13373 * data/yacc.c: Likewise.
13374
13375 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13376 does not specify a union tag. This is for compatibility with
13377 Solaris 9 yacc.
13378
13379 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13380 const *, since it is now modified by stripping surrounding { }.
13381 (current_braced_code): Remove.
13382 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13383 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13384 trailing " {...}". Now of type <chars>.
13385 (grammar_declaration): Adjust to bundled tokens.
13386 (code_content): Remove; stripping is now done by add_param.
13387 (print_token_value): Print contents of bundled tokens.
13388 (token_name): New function.
13389
13390 * src/reader.h (braced_code, current_braced_code): Remove.
13391 (token_name): New decl.
13392
13393 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13394 token_type, not braced_code code_kind. All uses changed.
13395 (SC_PRE_CODE): New state, for scanning after a keyword that
13396 has (or usually has) an immediately-following braced code.
13397 (token_type): New local var, to keep track of which token type
13398 to return when scanning braced code.
13399 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 13400 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
13401 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13402 instead of returning a token type immediately.
13403 (<INITIAL>"{"): Set token type.
13404 (<SC_BRACED_CODE>"}"): Use it.
13405 (handle_action_dollar, handle_action_at): Now returns bool
13406 indicating success. Fail if ! current_rule; this prevents a core dump.
13407 (handle_symbol_code_dollar, handle_symbol_code_at):
13408 Remove; merge body into caller.
13409 (handle_dollar, handle_at): Complain in invalid contexts.
13410
13411 * NEWS, doc/bison.texinfo: Document the above.
13412 * NEWS: Fix years and program names in copyright notice.
13413
879ca4f8
PE
134142002-12-17 Paul Eggert <eggert@twinsun.com>
13415
13416 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13417 Reporting, Table of Symbols): Omit mentions of %lex-param and
13418 %parse-param from the documentation for now.
13419
1c5fe69d
PE
134202002-12-15 Paul Eggert <eggert@twinsun.com>
13421
13422 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13423 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13424 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
13425 disagreed with the Bison documentation. Bug
13426 reported by Andrew Walrond.
d600ee67 13427
1c5fe69d
PE
13428 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13429 as the caller now does that.
13430 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13431 (YYEMPTY): Parenthesize right hand side, since others use it.
13432 (yyparse): Don't assume that our generated code is the only code
13433 that sets yychar.
13434
d1de5372
PE
134352002-12-13 Paul Eggert <eggert@twinsun.com>
13436
13437 Version 1.75d.
13438
13439 POSIX requires a "yacc" command.
13440 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13441 (MOSTLYCLEANFILES): Add yacc.
13442 (yacc): New rule.
1c5fe69d 13443 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
13444 as an alias for bison y.
13445
13446 * po/LINGUAS: Add da.
d600ee67 13447
d1de5372
PE
13448 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13449 problem with latest <getopt.h>.
13450 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13451
13452 * doc/fdl.texi: Upgrade to 1.2.
13453 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13454 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13455 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13456 gnulib.
13457 * config/install-sh: Sync with autotools.
13458
13459 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 13460 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
13461 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13462 locations are requested.
13463 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13464 locations are requested.
13465
d0f3fe23
PE
134662002-12-12 Paul Eggert <eggert@twinsun.com>
13467
13468 Remove unportable casts and storage allocation tricks.
13469 While we're at it, remove almost all casts, since they
13470 usually aren't needed and are a sign of trouble.
13471
13472 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13473
13474 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13475 the pointer DSET returned by malloc; this isn't portable.
13476 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13477 Similarly for DERIVES.
13478 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13479 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13480 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13481
13482 * src/derives.c (derives_compute): Do not bother invoking
13483 int_of_rule_number, since rule numbers are integers.
13484
13485 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13486 rather than XMALLOC (char, N).
13487
13488 * src/files.c (filename_split): Rewrite to avoid cast.
13489
13490 * src/gram.h (symbol_number_as_item_number,
13491 item_number_as_symbol_number, rule_number_as_item_number,
13492 item_number_as_rule_number):
13493 Now inline functions rather than macros, to avoid casts.
13494 * src/state.h (state_number_as_int): Likewise.
13495 * src/tables.c (state_number_to_vector_number,
13496 symbol_number_to_vector_number): Likewise.
13497
13498 * src/gram.h (int_of_rule_number): Remove; no longer used.
13499
13500 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13501 since the resulting storage is always stored into.
13502
13503 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13504 where it's needed.
13505
13506 * src/muscle_tab.c (muscle_m4_output):
13507 Now inline. Return bool, not int.
13508 * src/state.c (state_compare): Likewise.
13509 * src/symtab.c (symbol_check_defined,
13510 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13511 hash_compare_symbol, hash_symbol):
13512 Likewise.
13513 * src/uniqstr.c (uniqstr_print): Likewise.
13514 * src/muscle_tab.c (muscle_m4_output_processor):
13515 New function, to avoid casts.
13516 * src/state.c (state_comparator, stage_hasher): Likewise.
13517 * src/symtab.c (symbol_check_defined_processor,
13518 symbol_check_alias_consistency_processor, symbol_pack_processor,
13519 symbol_translation_processor, hash_symbol_comparator,
13520 hash_symbol_hasher): Likewise.
13521 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13522 * src/muscle_tab.c (muscles_m4_output):
13523 Use new functions instead of casting old functions unportably.
13524 * src/state.c (state_hash_new): Likewise.
13525 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13526 symbols_token_translations_init):
13527 Likewise.
13528 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13529
13530 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13531 var instead of casting to long, to avoid casts.
13532 (prepare_states): Use MALLOC rather than alloca, so that we don't
13533 have to worry about alloca.
13534 * src/state.c (state_hash_lookup): Likewise.
13535
13536 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13537 local var instead of casting to unsigned char, to avoid casts.
13538
13539 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13540 STATE_ALLOC): Remove.
13541 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13542 rather than calloc, and use offsetof to avoid allocating slightly
13543 too much storage.
13544 (state_new): Initialize all members.
13545
13546 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13547
13548 * src/symtab.c (symbol_free): Remove; unused.
13549 (symbol_get): Remove cast in lhs of assignment.
13550 (symbols_do): Now static. Accept generic arguments, not
13551 hashing-related ones.
13552
13553 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13554 (symbol_processor): Remove.
13555 (symbols_do): Remove decl; now static.
13556
13557 * src/system.h (alloca): Remove; decl no longer needed.
13558 (<stddef.h>): Include, for offsetof.
13559 (<inttypes.>, <stdint.h>): Include if available.
13560 (uintptr_t): New type, if system lacks it.
13561 (CALLOC, MALLOC, REALLOC): New macros.
13562 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13563 new macros.
13564
13565 * src/tables.c (table_size): Now int, to pacify GCC.
13566 (table_grow, table_ninf_remap): Use signed table size.
13567 (save_row): Don't bother initializing locals when not needed.
13568 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13569 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13570
13571 * src/vcg.h: Correct misspellings.
13572
13573 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13574
13575
13576 * src/getargs.c (getargs): Don't assume EOF == -1.
13577
26b4a969
PE
135782002-12-09 Paul Eggert <eggert@twinsun.com>
13579
13580 Change identifier spellings to avoid collisions with names
13581 that are reserved by POSIX.
13582
13583 Don't use names ending in _t, since POSIX reserves them.
13584 For consistency, remove _e and _s endings -- they're weren't
13585 needed to remove ambiguity. All uses changed.
13586 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13587 turn was just renamed from struniq_t.
13588 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13589 which in turn was just renamed from struniq_processor_t.
13590 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13591 in turn was renamed from hash_compare_struniq_t.
13592 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13593 (state_list): Renamed from state_list_t.
13594 * src/assoc.h (assoc): Renamed from assoc_t.
13595 * src/conflicts.c (enum conflict_resolution): Renamed from
13596 enum conflict_resolution_e.
13597 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13598 (rule_list): Renamed from rule_list_t.
13599 * src/getargs.h (enum trace): Renamed from enum trace_e.
13600 (enum report): Renamed from enum report_e.
13601 * src/gram.h (item_number): Renamed from item_number_t.
13602 (rule_number): Renamed from rule_number_t.
13603 (struct rule_s): Remove the "rule_s" part; not used.
13604 (rule): Renamed from rule_t.
13605 (rule_filter): Renamed from rule_filter_t.
13606 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13607 (goto_list): Renamed from goto_list_t.
13608 * src/lalr.h (goto_number): Renamed from goto_number_t.
13609 * src/location.h (location): Renamed from location_t.
13610 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13611 and moved here from:
13612 * src/muscle_tab.h (muscle_entry_t): here.
13613 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13614 (rule_list): Renamed from rule_list_t.
13615 * src/print_graph.c (static_graph): Renamed from graph.
13616 * src/reader.h (braced_code): Renamed from braced_code_t.
13617 Remove brace_code_e tag.
13618 * src/relation.h (relation_node): Renamed from relation_node_t.
13619 (relation_nodes): Renamed from relation_nodes_t.
13620 (relation): Renamed from relation_t.
13621 * src/state.h (state_number): Renamed from state_number_t.
13622 (struct state): Renamed from struct state_s.
13623 (state): Renamed from state_t.
13624 (transitions): Renamed from transitions_t. Unused (and
13625 misspelled) transtion_s tag removed.
13626 (errs): Renamed from errs_t. Unused errs_s tag removed.
13627 (reductions): Renamed from reductions_t. Unused tag
13628 reductions_s removed.
13629 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13630 (struct symbol_list): Renamed from struct symbol_list_s.
13631 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13632 (struct symbol): Renamed from struct symbol_s.
13633 (symbol): Renamed from symbol_t.
13634 * src/tables.c (vector_number): Renamed from vector_number_t.
13635 (action_number): Renamed from action_t.
13636 * src/tables.h (base_number): Renamed from base_t.
13637 * src/vcg.h (enum color): Renamed from enum color_e.
13638 (enum textmode): Renamed from enum textmode_e.
13639 (enum shape): Renamed from enum shape_e.
13640 (struct colorentry): Renamed from struct colorentry_s.
13641 (struct classname): Renamed from struct classname_s.
13642 (struct infoname): Renamed from struct infoname_s.
13643 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13644 (enum decision): Renamed from enum decision_e.
13645 (enum orientation): Renamed from enum orientation_e.
13646 (enum alignment): Renamed from enum alignment_e.
13647 (enum arrow_mode): Renamed from enum arrow_mode_e.
13648 (enum crossing_type): Renamed from enum crossing_type_e.
13649 (enum view): Renamed from enum view_e.
13650 (struct node): Renamed from struct node_s.
13651 (node): Renamed from node_t.
13652 (enum linestyle): Renamed from enum linestyle_e.
13653 (enum arrowstyle): Renamed from enum arrowstyle_e.
13654 (struct edge): Renamed from struct edge.
13655 (edge): Renamed from edge_t.
13656 (struct graph): Renamed from struct graph_s.
13657 (graph): Renamed from graph_t.
13658 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13659 Rename value_t -> value.
13660 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13661 value_t_as_yystype -> value_as_yystype.
13662
13663 Don't include <errno.h> in the mainstream code, since it
13664 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13665 * lib/get-errno.c, lib/get-errno.h: New files.
13666 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13667 get-errno.c.
13668 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13669 * src/output.c (output_skeleton): Likewise.
13670 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13671 instead of errno.
13672 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13673 Likewise.
13674 (handle_action_dollar, handle_action_at): Likewise.
13675 * src/system.h: Do not include <errno.h>.
13676 (TAB_EXT): Renamed from EXT_TAB.
13677 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13678
13679 Avoid str[a-z]*, since <string.h> reserves that name space.
13680 Change all instances of "struniq" in names to "uniqstr", and
13681 likewise for "STRUNIQ" and "UNIQSTR".
13682 * src/uniqstr.c: Renamed from src/struniq.c.
13683 * src/uniqstr.h: Renamed from src/struniq.h.
13684 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13685 * src/files.c (strsuffix): Remove; unused.
13686 (concat2): Renamed from stringappend. Now static.
13687 * src/files.h (strsuffix, stringappend): Remove; unused.
13688 * src/parse-gram.y (<chars>): Renamed from <string>.
13689 (<uniqstr>): Renamed from <struniq>.
13690 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13691 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13692 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13693 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13694 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13695 (N_EXPAND): Renamed from N_STRETCH.
13696
13697 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13698 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13699 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13700 Remove; unused.
13701 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13702 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13703 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13704 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13705 (BASE_MAXIMUM): Renamed from BASE_MAX.
13706 (BASE_MINIMUM): Renamed from BASE_MIN.
13707 (ACTION_MAX): Remove; unused.
13708 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13709 Unnecessary casts removed from above defines.
13710
13711
13712 Fix misspelling in names.
13713 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13714 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
13715 G_NODE_ALIGNEMENT.
13716
13717
13718 * lib/timevar.c (timevar_report): Renamed from time_report,
13719 for consistency with other names.
13720 * lib/timevar.h (timevar_report): New decl.
13721 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
13722
13723
13724 Sort include-file uses.
13725
13726 Reorder all include files under src to be in the order "system.h".
13727 then the ../lib include files in angle brackets (alphabetized),
13728 then the . include files in double-quotes (alphabetized). Fix
13729 dependency breakages encountered in this process, as follows:
13730 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
13731 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
13732 * src/state.h: Include "symtab.h".
13733
996b1c7e
PE
137342002-12-08 Paul Eggert <eggert@twinsun.com>
13735
13736 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
13737 since this causes problems when __file__ contains character
13738 sequences like "@" that are treated specially by src/scan-skel.l.
13739 Instead, just use the file's basename. This fixes the bug
13740 reported by Martin Mokrejs in
161a71f3 13741 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 13742
e19c4e5d
PE
137432002-12-06 Paul Eggert <eggert@twinsun.com>
13744
13745 Add support for rules that do not have trailing semicolons, as
13746 POSIX requires. Improve the quality of locations in Bison
13747 diagnostics.
26b4a969 13748
e19c4e5d
PE
13749 * src/location.c: Include <quotearg.h>.
13750 (empty_location): Now const.
13751 (location_print): New function. Follow the recommendation of the
13752 GNU Coding Standards for locations that span file boundaries.
13753 * src/location.h: Do not include <quotearg.h>; no longer needed.
13754 (boundary): New type.
13755 (location_t): Use it. This allows locations to span file boundaries.
13756 All member uses changed: file -> start.file or end.file (as needed),
13757 first_line -> start.line, first_column -> start.column,
13758 last_line -> end.line, last_column -> end.column.
13759 (equal_boundaries): New function.
13760 (LOCATION_RESET, LOCATION_STEP): Remove.
13761 (LOCATION_PRINT): Remove. All callers changed to use location_print.
13762 (empty_location): Now const.
13763 (location_print): New decl.
13764 * src/parse-gram.y (lloc_default): New function, which handles
13765 empty locations more accurately.
13766 (YYLLOC_DEFAULT): Use it.
13767 (%token COLON): Remove.
13768 (%token ID_COLON): New token.
26b4a969 13769 (rules): Use it.
e19c4e5d
PE
13770 (declarations, rules): Remove trailing semicolon.
13771 (declaration, rules_or_grammar_declaration):
13772 Allow empty (";") declaration.
13773 (symbol_def): Remove empty actions; no longer needed.
13774 (rules_or_grammar_declaration): Remove trailing semicolon.
13775 (semi_colon.opt): Remove.
13776 * src/reader.h: Include location.h.
13777 (scanner_cursor): New decl.
13778 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
13779 rolling our own.
13780 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
13781 of *loc.
13782 (STEP): Remove. No longer needed, now that adjust_location does
13783 the work. All uses removed.
13784 (scanner_cursor): New var.
13785 (adjust_location): Renamed from extend_location. It now sets
13786 *loc and adjusts the scanner cursor. All uses changed.
13787 Don't bother testing for CR.
13788 (handle_syncline): Remove location arg; now updates scanner cursor.
13789 All callers changed.
13790 (unexpected_end_of_file): Now accepts start boundary of token or
13791 comment, not location. All callers changed. Update scanner cursor,
13792 not the location.
13793 (SC_AFTER_IDENTIFIER): New state.
13794 (context_state): Renamed from c_context. All uses changed.
13795 (id_loc, code_start, token_start): New local vars.
13796 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
13797 processing of Yacc white space and equivalents here.
13798 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
13799 instead of returning ID immediately, since we need to search for
13800 a subsequent colon.
13801 (<INITIAL>"'", "\""): Save token_start.
13802 (<INITIAL>"%{", "{", "%%"): Save code_start.
13803 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
13804 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
13805 BEGIN context_state at end, not INITIAL.
13806 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
13807 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
13808 Return correct token start.
13809 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
13810 the start of a character, string or multiline comment is found.
13811 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
13812 Reduction): Adjust reported locations to match the more-precise
13813 results now expected.
13814 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
13815 * tests/reduce.at (Useless Rules, Reduced Automaton,
13816 Underivable Rules): Likewise.
13817 * tests/regression.at (Invalid inputs): No longer `expecting ";"
13818 or "|"' now that so many other tokens are allowed by the new grammar.
13819
13820 * src/complain.h (current_file): Remove duplicate decl;
13821 current_file is now owned by files.h.
13822 * src/complain.c, src/scan-gram.l: Include files.h.
13823
138242002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 13825
e19c4e5d
PE
13826 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
13827 promotes to int; it might be unsigned int.
13828 * data/yacc.c (yy_reduce_print): Likewise.
13829
13830 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
13831 be #defined in the prologue, not in the Bison declarations.
13832 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 13833
b64755e3
PE
138342002-12-02 Paul Eggert <eggert@twinsun.com>
13835
13836 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
13837 * lib/strtoul.c: New file, from gnulib.
13838 This fixes a porting bug reported by Peter Klein in
161a71f3 13839 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 13840
6e746484
PE
138412002-11-30 Paul Eggert <eggert@twinsun.com>
13842
b64755e3
PE
13843 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
13844 and put only a forward declaration in the prologue. This is for
13845 consistency with the other scanner helper functions.
13846
6ba55592
PE
13847 Type clashes now generate warnings, not errors, since it
13848 appears that POSIX may allow some grammars with type clashes.
13849 * src/reader.c (grammar_current_rule_check): Warn about
13850 type clashes instead of complaining.
13851 * tests/input.at (Type Clashes): Expect warnings, not complaints.
13852
6e746484
PE
13853 Add Yacc library, since POSIX requires it.
13854 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
13855 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
13856 * lib/main.c, lib/yyerror.c: New files.
13857
13858 gram_error can be static; it need not be extern.
13859 * src/reader.h (gram_error): Remove decl.
13860 * src/parse-gram.y (gram_error): Now static. Add static decl.
13861 (print_token_value): Omit parameter names from forward decl,
13862 for consistency.
13863
88510f9c
PE
138642002-11-29 Paul Eggert <eggert@twinsun.com>
13865
6e746484
PE
13866 * doc/bison.texinfo: Emphasize that yylex and yyerror must
13867 be declared before being used. E.g., one should typically
13868 declare them in the prologue. Use GNU coding style in examples.
13869 Put "const" consistently after the type it modifies. Mention
13870 that C99 supports "inline". Mention that yyerror traditionally
13871 returns "int".
13872
88510f9c
PE
13873 %parse-param and %lex-param now take just one argument, the
13874 declaration; the argument name is deduced from the declaration.
13875
13876 * doc/bison.texinfo (Parser Function, Pure Calling, Error
13877 Reporting, Table of Symbols): Document this.
13878 * src/parse-gram.y (add_param): New function.
13879 (COMMA): Remove.
13880 (declaration): Implement new rule for %parse-param and %lex-param.
13881 * src/scan-gram.l: "," now elicits a warning, rather than being
13882 a token; this is more compatible with byacc.
13883 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
13884
bb92250c
PE
138852002-11-27 Paul Eggert <eggert@twinsun.com>
13886
13887 Rename identifiers to avoid real and potential collisions.
13888
13889 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
13890 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 13891 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
13892 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
13893 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
13894 * src/parse-gram.y (print_token_value): Renamed from yyprint.
13895 All uses changed.
13896 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
13897 The name "yycontrol" violates the name space rules, and this stuff
13898 wasn't being used anyway.
13899 (input): Remove action; this stuff wasn't being used.
13900 (gram_error): Rename local variable yylloc -> loc.
13901 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
13902 (YY_DECL): Don't use "yy" at start of local variables.
13903 All uses changed, e.g., yylloc -> loc.
13904 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
13905 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
13906 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
13907 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
13908
13909 * src/parse-gram.y (gram_error): loc is now const *.
13910 * src/reader.h (gram_error): Likewise.
13911
3af4feb2
PE
139122002-11-24 Paul Eggert <eggert@twinsun.com>
13913
13914 Version 1.75c.
13915
13916 * tests/actions.at (Actions after errors): Use an output format
13917 more similar to that of the Printers and Destructors test.
13918 Test the position of the ';' token too.
13919 (Printers and Destructors): Likewise.
13920 (Printers and Destructors: %glr-parser): Remove for now, to avoid
13921 unnecessarily alarming people when the test fails.
13922
13923 * data/yacc.c (yyerrlab1): Move this label down, so that the
13924 parser does not discard the lookahead token if the user code
13925 invokes YYERROR. This change is required for POSIX conformance.
13926
13927 * lib/error.c: Sync with gnulib.
13928
139292002-11-22 Paul Eggert <eggert@twinsun.com>
13930
13931 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
13932 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
13933 * lib/xmalloc.c: Likewise.
26b4a969 13934
58004308
PE
139352002-11-20 Paul Eggert <eggert@twinsun.com>
13936
13937 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
13938
139392002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 13940
58004308
PE
13941 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
13942 should use `if (! x) abort ();' rather than `assert (x);', and
13943 anyway it's one less thing to worry about configuring.
13944
13945 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
13946 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
13947 and replace all instances of assert with abort.
13948 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
13949 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
13950
13951 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
13952 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
13953 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
13954 hash_find_entry, hash_rehash, hash_insert): Likewise.
13955 * src/conflicts.c (resolve_sr_conflict): Likewise.
13956 * src/lalr.c (set_goto_map, map_goto): Likewise.
13957 * src/nullable.c (nullable_compute): Likewise.
13958 * src/output.c (prepare_rules, token_definitions_output): Likewise.
13959 * src/reader.c (packgram, reader): Likewise.
13960 * src/state.c (state_new, state_free, state_transitions_set,
13961 state_reduction_find): Likewise.
13962 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
13963 symbol_pack): Likewise.
13964 * src/tables.c (conflict_row, pack_vector): Likewise.
13965 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13966 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13967 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
13968 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
13969
13970 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
13971 (ARGMATCH_CONSTRAINT): New macro.
13972 (ARGMATCH_ASSERT): Use it.
13973
13974 * src/system.h (verify): New macro.
13975 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
13976 rather than assert.
13977 * src/tables.c (tables_generate): Likewise.
13978
13979 * src/struniq.c (struniq_assert): Now returns void, and aborts
13980 if the assertion is false.
13981 (struniq_assert_p): Remove.
13982 * src/struniq.h: Likewise.
13983
76ae8198
PE
139842002-11-18 Paul Eggert <eggert@twinsun.com>
13985
13986 * data/glr.c (yygetLRActions): Replace `yyindex' with
13987 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
13988 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 13989 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 13990
d3c4e709
AD
139912002-11-18 Akim Demaille <akim@epita.fr>
13992
13993 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
13994 space.
13995 From Tim Van Holder.
13996
8d8a7238
PE
139972002-11-17 Paul Eggert <eggert@twinsun.com>
13998
13999 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14000 to "SyntaxError" for consistency with my 2002-11-15 change.
14001
14002 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14003 not define to {}, since this breaks the common use of `YYDPRINTF
14004 ((...));' if a single statement is desired (e.g. before `else').
14005 Work around GCC warnings by surrounding corresponding calls with
14006 {} if needed.
14007 (yyhasResolvedValue): Remove unused function.
14008 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14009 loop body.
14010 (yyreportSyntaxError): Renamed from yyreportParseError.
14011 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14012 All uses changed.
14013 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14014 extern when possible. Remove unused initializations.
14015
b0937b22
AD
140162002-11-16 Akim Demaille <akim@epita.fr>
14017
14018 Augment the similarity between GLR and LALR traces.
14019
14020 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14021 (YY_REDUCE_PRINT): New.
14022 (yyparse): Use them.
14023 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14024 YYDPRINT here.
14025 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14026 state reached after the reduction/recovery, since...
14027 (yyparse, yyprocessOneStack): Report the state we are entering in.
14028
c5e3e510
AD
140292002-11-16 Akim Demaille <akim@epita.fr>
14030
14031 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14032 Add support for --trace=skeleton.
14033 * src/scan-skel.l: %option debug.
14034 Scan strings of non-@ or \n instead of character by character.
14035 (scan_skel): Handle trace_skeleton.
14036 (QPUTS): New.
14037 (@output_parser_name@, @output_header_name@): ``Restore'' their
14038 support (used to be M4 macros).
14039 * data/yacc.c: Quote larger chunks, a la glr.c.
14040 * data/lalr1.cc: Likewise.
14041 The header guards are no longer available, so use some other
14042 string than `YYLSP_NEEDED'.
14043
4c6cc1db
AD
140442002-11-16 Akim Demaille <akim@epita.fr>
14045
14046 Make the ``Printers and Destructors'' test more verbose, taking
14047 `yacc.c''s behavior as (possibly wrong) reference.
14048
14049 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14050 instead of fprint on stdout.
14051 Set and report the last_line of the symbols.
14052 Consistently display values and locations.
14053
6d9e8019
PE
140542002-11-16 Paul Eggert <eggert@twinsun.com>
14055
14056 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14057
6e649e65
PE
140582002-11-15 Paul Eggert <eggert@twinsun.com>
14059
b25d88f6
PE
14060 * tests/actions.at (Actions after errors): New test case.
14061
6e649e65
PE
14062 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14063 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14064 tests/action.at, tests/calc.at, tests/conflicts.at,
14065 tests/cxx-type.at, tests/regression.at:
14066 "parse error" -> "syntax error" for POSIX compatibility.
14067 "parsing stack overflow..." -> "parser stack overflow" so
14068 that code matches Bison documentation.
14069
0f39aab9
AD
140702002-11-15 Akim Demaille <akim@epita.fr>
14071
14072 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14073 take two BRACED_CODE, not two string_content.
14074 Free the scanner's obstack when we are done.
14075 (code_content): New.
14076 * tests/calc.at: Adjust.
14077 * doc/bison.texinfo: Adjust.
14078 Also, make sure to include the `,' for these declarations.
14079
761c1926
AD
140802002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14081
14082 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14083 definition; avoids potential autoreconf problems.
14084
b0f98b10
AD
140852002-11-15 Akim Demaille <akim@epita.fr>
14086
14087 Always check the value returned by yyparse.
14088
14089 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14090 returned by yyparse.
14091 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14092 Adjust calls.
14093 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14094 returned by yyparse.
14095
970785f1
PH
140962002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14097
14098 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14099 on input.at test.
14100
8fcc7db1
PE
141012002-11-14 Paul Eggert <eggert@twinsun.com>
14102
7ec1b48e
PE
14103 * src/output.c (output_skeleton): Call xfopen instead of
14104 duplicating xfopen's body.
14105
cfff7583 14106 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 14107 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 14108
8fcc7db1
PE
14109 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14110 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14111 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14112 file twice in the grammar, as an extra check.
14113
14114 * tests/input.at (Torturing the Scanner): Surround the
14115 backslash-newline tests with "#if 0", to make it less likely that
14116 we'll run into compiler bugs. Bring back solitary \ inside
14117 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 14118 test backslash-newline in C character constant.
8fcc7db1 14119
4e8d992c
AD
141202002-11-14 Akim Demaille <akim@epita.fr>
14121
14122 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14123 status of the compiler.
f32b346d 14124 Calling `exit 1' is no longer needed.
4e8d992c
AD
14125 Reported by Nelson H. F. Beebe.
14126
9501dc6e
AD
141272002-11-14 Akim Demaille <akim@epita.fr>
14128
14129 * tests/atlocal.in (CPPFLAGS): We have config.h.
14130 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14131 New.
14132 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14133 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14134 * tests/regression.at, tests/torture.at: Use them for all the
14135 grammars that are to be compiled.
14136 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14137 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14138 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14139
18b519c0
AD
141402002-11-14 Akim Demaille <akim@epita.fr>
14141
14142 * doc/bison.texinfo: Various formatting changes (alignments in
14143 samples, additional @group/@end group, GCS in samples.
14144 Use @deffn instead of simple @table to define the directives,
14145 macros, variables etc.
14146
9a86cdb9
PE
141472002-11-13 Paul Eggert <eggert@twinsun.com>
14148
daa33def 14149 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14150 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14151
daa33def 14152 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14153 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14154 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14155 * tests/headers.at (export YYLTYPE): Likewise.
14156
14157 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14158 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14159
9a86cdb9
PE
14160 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14161 comments, since they're not portable. Use GNU coding style.
14162
9c1e26bd
AD
141632002-11-13 Akim Demaille <akim@epita.fr>
14164
14165 * data/yacc.c: Leave bigger chunks of quoted text.
14166 (YYDSYMPRINTF): New.
14167 Use it to report symbol activities.
14168 * data/glr.c (YYDSYMPRINTF): New.
14169 Use it.
14170
87f721cc
PE
141712002-11-12 Paul Eggert <eggert@twinsun.com>
14172
14173 Version 1.75b.
14174
14175 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14176 (yyglrReduce): Return yyok, not 0.
14177 This should avoid the enumerated-type warnings reported
464c6927 14178 by Nelson H. F. Beebe in
161a71f3 14179 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14180
14181 * lib/bbitset.h (BITSET_INLINE): Remove.
14182 * lib/bitset.h [! BITSET_INLINE]: Remove.
14183 (bitset_set, bitset_reset, bitset_test): Rename local vars
14184 to avoid shadowing warnings by GCC.
14185
14186 * data/glr.c (inline): Remove #define. It's the user's
14187 responsibility to #define it away, just like 'const'.
464c6927 14188 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14189 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14190
87f721cc
PE
14191 * Makefile.maint (po-check): Scan .l and .y files instead of the
14192 .c and the .h files that they generate. This fixes the bug
14193 reported by Tim Van Holder in:
161a71f3 14194 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14195 Look for N_ as well as for _. Try to avoid matching #define for
14196 N_ and _.
14197 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14198 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14199 * src/scan-gram.l: Revamp regular expressions so that " and '
14200 do not confuse xgettext.
14201
14202 * src/struniq.h (struniq_new): Do not declare the return type
14203 to be 'const'; this violates the C standard.
14204 * src/struniq.c (struniq_new): Likewise.
14205
be14ade5
AD
142062002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14207
14208 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14209 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14210 linker.
14211
05291fbc
AD
142122002-11-12 Akim Demaille <akim@epita.fr>
14213
14214 * Makefile.maint: Sync with Autoconf:
14215 (local_updates): New.
14216
1f5fd52e
AD
142172002-11-12 Akim Demaille <akim@epita.fr>
14218
14219 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14220
283f1e64
AD
142212002-11-12 Akim Demaille <akim@epita.fr>
14222
14223 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14224 locations.
14225
886b69d1
AD
142262002-11-12 Akim Demaille <akim@epita.fr>
14227
14228 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14229 not yyvalue.
14230
3df37415
AD
142312002-11-12 Akim Demaille <akim@epita.fr>
14232
14233 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14234 Use it to test the GLR parser.
14235
7bd6c77e
AD
142362002-11-12 Akim Demaille <akim@epita.fr>
14237
14238 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14239 defines it.
14240 * data/glr.c (yystos): New.
14241 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14242 (YYDSYMPRINT): New.
14243 (yyval): Don't define it, it is handled via M4.
14244 (yyrecoverParseError): Free verbosely the discarded symbols.
14245 * data/yacc.c (yysymprint): Remove, rather...
14246 (b4_yysymprint_generate): invoke.
14247 * data/c.m4 (b4_yysymprint_generate): New.
14248 Accept pointers as arguments, as opposed to the version from
14249 yacc.c.
14250 (b4_yydestruct_generate): Likewise.
14251 * tests/cations.at (Printers and Destructors): Use Bison directives
14252 instead of CPP macros.
14253 Don't rely on internal details.
14254
b0400cc6
AD
142552002-11-12 Akim Demaille <akim@epita.fr>
14256
14257 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14258 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14259 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14260 it against YYEMPTY and so forth), work on yytoken (i.e., set
14261 it to YYEMPTY etc.).
14262 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14263 (b4_symbol_actions): Remove.
14264 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14265 for 0, end-of-input.
14266
72f889cc
AD
142672002-11-12 Akim Demaille <akim@epita.fr>
14268
14269 * doc/bison.texinfo (Destructor Decl): New.
14270
b1ae9233
AD
142712002-11-12 Akim Demaille <akim@epita.fr>
14272
14273 * src/tables.c (tables_generate): Use free for pointers that
14274 cannot be NULL, not XFREE.
14275 (pack_vector): Use assert, not fatal, for bound violations.
14276 * src/state.c (state_new): Likewise.
14277 * src/reader.c (reader): Likewise.
14278 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14279 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14280 the file name.
14281
7ec2d4cd
AD
142822002-11-12 Akim Demaille <akim@epita.fr>
14283
14284 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14285 Restore.
14286 * src/scan-gram.l (last_string): Is global to the file, not to
14287 yylex.
14288 * src/parse-gram.y (input): Don't append the epilogue here,
14289 (epilogue.opt): do it here, and free the scanner's obstack.
14290 * src/reader.c (epilogue_set): Rename as...
14291 (epilogue_augment): this.
14292 * data/c.m4 (b4_epilogue): Defaults to empty.
14293
573a6cd3
AD
142942002-11-12 Akim Demaille <akim@epita.fr>
14295
14296 * src/getargs.c (long_options): Remove duplicates.
14297 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14298 Remove.
14299 * doc/bison.rnh: Remove.
14300 * doc/bison.texinfo (VMS Invocation): Remove.
14301
95612cfa
AD
143022002-11-12 Akim Demaille <akim@epita.fr>
14303
14304 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14305 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14306
14307 Use struniq for symbols.
14308
14309 * src/symtab.h (symbol_t): The tag member is a struniq.
14310 (symbol_type_set): Adjust.
14311 * src/symtab.c (symbol_new): Takes a struniq.
14312 (symbol_free): Don't free the tag member.
14313 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14314 (hash_compare_symbol, hash_symbol): these.
14315 Use the fact that tags as struniqs.
14316 (symbol_get): Use struniq_new.
14317 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14318 Returns a strniq.
14319 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14320 and type members are struniqs.
14321 * src/reader.c (get_merge_function)
14322 (grammar_current_rule_merge_set): Adjust.
14323 (TYPE, current_type): Are struniq.
14324
14325 Use struniq for file names.
14326
14327 * src/files.h, src/files.c (infile): Split into...
14328 (grammar_file, current_file): these.
14329 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14330 * src/reduce.c (reduce_print): Likewise.
14331 * src/getargs.c (getargs): Likewise.
14332 * src/complain.h, src/complain.c: Likewise.
14333 * src/main.c (main): Call struniqs_new early enough to use it for
14334 file names.
14335 Don't free the input file name.
14336
3e6656f9
AD
143372002-11-12 Akim Demaille <akim@epita.fr>
14338
14339 * src/symtab.c (symbol_free): Remove dead deactivated code:
14340 type_name are properly removed.
14341 Don't use XFREE to free items that cannot be NULL.
14342 * src/struniq.h, src/struniq.c: New.
14343 * src/main.c (main): Initialize/free struniqs.
14344 * src/parse-gram.y (%union): Add astruniq member.
14345 (yyprint): Adjust.
14346 * src/scan-gram.l (<{tag}>): Return a struniq.
14347 Free the obstack bit that used to store it.
14348 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14349
7672019c
PE
143502002-11-11 Paul Eggert <eggert@twinsun.com>
14351
14352 Revamp to fix many (but not all) of the C- and M4-related quoting
14353 problems. Among other things, this fixes the Bison bug reported
14354 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 14355 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
14356
14357 Use new @ escapes consistently. Represent brackets with @{ and @}
14358 rather than @<:@ and @:>@, since this works a bit better with dumb
14359 editors like vi. Represent @ with @@, since @ is now consistently
14360 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14361 __ofile__, to avoid unexpected expansions. Similarly, use @output
14362 rather than #output.
14363
14364 * data/c.m4 (b4_copyright): Omit file name from comment, since
14365 the file name could contain "*/".
14366 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14367 be quoted. All uses changed.
14368
14369 * data/glr.c: Use new @ escapes consistently.
14370 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14371 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14372 Remove, since they couldn't handle arbitrary characters in file
14373 names.
14374 * data/lalr1.cc: Likewise.
14375 * data/yacc.c: Likewise.
14376
14377 * src/files.c (output_infix): Remove; all uses removed.
14378 * src/files.h: Likewise.
14379
14380 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14381 mishandled funny characters in file names, and anyway it isn't
14382 needed any more.
14383 * data/yacc.c: Likewise.
14384 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14385
14386 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14387 * data/yacc.c: Likewise.
14388
14389 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14390 strings now.
14391 (muscle_init): Quote filename as a C string.
14392 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14393 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14394 * src/output.c (escaped_file_name_output): New function.
14395 (prepare_symbols): Quote tokens for M4.
14396 (prepare): Don't insert output_infix, output_prefix,
14397 output_parser_name, output_header_name; this is now down by scan-skel.
14398 Insert skeleton as a C string.
14399
14400 * src/output.c (user_actions_output, symbol_destructors_output,
14401 symbol_printers_output): Quote filenames for C and M4.
14402 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14403
14404 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14405 escapes other than \\ and \'; this simplifies the code.
14406 (<SC_STRING>): Likewise, for \\ and \".
14407 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14408 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14409 Use new escapes @{ and @} for [ and ].
14410
14411 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14412 them with auto vars.
14413 Switch to new escape scheme, where @ is the escape character uniformly.
14414 Abort if a stray escape character is found. Avoid unbounded input
14415 buffer when parsing non-escaped text.
14416
14417 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14418 __oline__, #output, $@, and @{ do not have unintended meanings.
14419
acea4f3b
PE
144202002-11-09 Paul Eggert <eggert@twinsun.com>
14421
14422 Fix the test failure due to GCC warnings described in
161a71f3 14423 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14424 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14425 evaluate to 0 if it's impossible for NINF to be in the respective
14426 table.
14427 (yygetLRActions, yyrecoverParseError): Use them.
14428
14429 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14430 counted in the token inserted at end of file. Now takes
14431 location_t *, not location_t, so that the location can be
14432 adjusted. All uses changed.
14433
14434 * tests/regression.at (Invalid inputs): Adjust wording in
14435 diagnostic to match the new behavior.
14436
14437 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14438 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14439 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14440 abort ();'. This reduces the runtime of the "Many lookaheads"
14441 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14442 GCC 3.2.
14443
20ef1ad5
PE
144442002-11-07 Paul Eggert <eggert@twinsun.com>
14445
14446 * src/parse-gram.y (CHARACTER): Remove unused token.
14447 All uses removed.
14448
14449 * src/scan-gram.l: Remove stack option. We no longer use the
14450 stack, since the stack was never deeper than 1; instead, use the
14451 new auto var c_context to record the stacked value.
14452
14453 Remove nounput option. At an unexpected end of file, we now unput
14454 the minimal input necessary to end cleanly; this simplifies the
14455 code.
14456
14457 Avoid unbounded token sizes where this is easy.
14458
14459 (unexpected_end_of_file): New function.
14460 Use it to systematize the error message on unexpected EOF.
14461 (last-string): Now auto, not static.
14462 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14463 (scanner_last_string_free): Remove; not used.
14464 (percent_percent_count): Move decl to just before use.
14465 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14466 not the (never otherwised-used) CHARACTER.
14467
93724f13
AD
144682002-11-07 Akim Demaille <akim@epita.fr>
14469
14470 Let yyerror always receive the msg as last argument, so that
14471 yyerror can be variadic.
14472
14473 * data/yacc.c (b4_yyerror_args): New.
14474 Use it when calling yyerror.
14475 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14476 Use it when calling yyerror.
14477 * doc/bison.texinfo (Error Reporting): Adjust.
14478 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14479 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14480
6e40b4eb
AD
144812002-11-06 Akim Demaille <akim@epita.fr>
14482
14483 #line should have quoted strings.
14484 Ideally, this should be done by m4_quotearg.
14485
14486 * src/scan-skel.l: Include quotearg.h.
14487 Quote __ofile__.
14488 * src/output.c (symbol_printers_output)
14489 (symbol_destructors_output): Quote the file name.
14490
2dfbfc12
AD
144912002-11-06 Akim Demaille <akim@epita.fr>
14492
14493 * tests/regression.at (Invalid inputs): Adjust to the recent
14494 messages.
14495
437c2d80
AD
144962002-11-06 Akim Demaille <akim@epita.fr>
14497
14498 Restore --no-lines.
14499 Reported by Jim Kent.
14500
14501 * data/c.m4 (b4_syncline): New.
14502 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14503 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14504 * src/output.c (user_actions_output): Likewise.
14505 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 14506 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 14507
900c5db5
AD
145082002-11-06 Akim Demaille <akim@epita.fr>
14509
14510 * src/main.c (main): Free `infile'.
14511 * src/scan-gram.l (handle_syncline): New.
14512 Recognize `#line'.
14513 * src/output.c (user_actions_output, symbol_destructors_output)
14514 (symbol_printers_output): Use the location's file name, not
14515 infile.
14516 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14517
e183b123 145182002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 14519
e183b123 14520 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 14521 either has GLR conflict entries.
e183b123 14522
193eb6b7
PE
145232002-11-05 Paul Eggert <eggert@twinsun.com>
14524
e183b123
PE
14525 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14526 "integer out of range" rather than "invalid value".
14527 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14528 accordingly.
14529
193eb6b7
PE
14530 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14531 Also, remove one static variable in the scanner.
14532
14533 * src/scan-gram.l (braces_level): Now auto, not static.
14534 Initialize to zero if the compiler is being picky.
14535 (INITIAL): Clear braces_level instead of incrementing it.
14536 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14537 as POSIX 1003.1-2001 requires.
14538 * src/system.h (IF_LINT): New macro, taken from coreutils.
14539 * configure.ac: Define "lint" if --enable-gcc-warnings.
14540
29c01725
AD
145412002-11-05 Akim Demaille <akim@epita.fr>
14542
14543 * src/scan-gram.l: When it starts with `%', complain about the
14544 whole directive, not just that `invalid character: %'.
14545
8aeac3ca
AD
145462002-11-04 Akim Demaille <akim@epita.fr>
14547
14548 * Makefile.maint: Update from Autoconf.
14549 (update, cvs-update, po-update, do-po-update): New.
14550
793a58bb
AD
145512002-11-04 Akim Demaille <akim@epita.fr>
14552
14553 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14554 and yyerror.
14555 Have yyerror `use' its arguments.
14556 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14557 returns true when location & yacc & pure & parse-param.
14558 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14559
c4d720cd
AD
145602002-11-04 Akim Demaille <akim@epita.fr>
14561
14562 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14563 clashes.
14564 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14565 font-lock-mode.
14566 Use complain_at.
14567 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14568 slot 0.
14569
613a0dc5
PE
145702002-11-03 Paul Eggert <eggert@twinsun.com>
14571
14572 * src/reader.c (get_merge_function, grammar_current_rule_check):
14573 Use consistent diagnostics for reporting type name clashes.
14574 Quote the types with <>, for consistency with Yacc.
14575 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14576
2a8d363a
AD
145772002-11-03 Akim Demaille <akim@epita.fr>
14578
14579 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14580 New.
14581 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14582 (b4_parse_param): Remove.
14583 Use b4_identification.
14584 Propagate b4_pure_args where needed to pass them to yyerror.
14585 * data/glr.m4 (b4_parse_param): Remove.
14586 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14587 (b4_lpure_formals): New.
14588 Use b4_identification.
14589 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14590 b4_user_formals and b4_user_args.
14591 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14592 (yyreportAmbiguity): When using a pure parser, also need
14593 the location, and the parse-params.
14594 Adjust callers.
14595 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14596 When using a pure parser, also need the parse-params.
14597 Adjust callers.
14598 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14599 (%pure-parser + %parse-param) LALR and GLR parsers.
14600 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14601 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14602 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14603 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14604 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14605 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14606 * doc/bison.texinfo: Untabify the whole file.
14607 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14608 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14609 (Error Reporting): Adjust to these new directives.
14610 Document %error-verbose, deprecate YYERROR_VERBOSE.
14611
9e32add8
AD
146122002-11-03 Akim Demaille <akim@epita.fr>
14613
14614 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14615 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14616 command line options.
14617 * tests/cxx-type.at: Formatting changes.
14618
b02d90a5
PE
146192002-11-03 Paul Eggert <eggert@twinsun.com>
14620
14621 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14622 to count columns correctly, and to check for invalid inputs.
9e32add8 14623
b02d90a5
PE
14624 Use mbsnwidth to count columns correctly. Account for tabs, too.
14625 Include mbswidth.h.
14626 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14627 (extend_location): New function.
14628 (YY_LINES): Remove.
14629
14630 Handle CRLF in C code rather than in Lex code.
14631 (YY_INPUT): New macro.
14632 (no_cr_read): New function.
14633
14634 Scan UCNs, even though we don't fully handle them yet.
14635 (convert_ucn_to_byte): New function.
14636
14637 Handle backslash-newline correctly in C code.
14638 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14639 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14640 all uses changed.
14641 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14642 Use {splice} wherever C allows backslash-newline.
14643 YY_STEP after space, newline, vertical-tab.
14644 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 14645
b02d90a5
PE
14646 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14647
14648 ({int}, handle_action_dollar, handle_action_at): Check for integer
14649 overflow.
9e32add8 14650
b02d90a5
PE
14651 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14652
14653 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14654 as well as \000. Check for UCHAR_MAX, not 255.
14655 Allow \x with an arbitrary positive number of digits, as in C.
14656 Check for overflow here.
14657 Allow \? and UCNs, for compatibility with C.
14658
14659 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14660 with quote slot used by complain_at.
14661
14662 * tests/input.at: Add tests for backslash-newline, m4 quotes
14663 in symbols, long literals, and funny escapes in strings.
14664
14665 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14666 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14667 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14668 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14669 * m4/mbswidth.m4: New file, from GNU coreutils.
14670
14671 * doc/bison.texinfo (Grammar Outline): Document // comments.
14672 (Symbols): Document that trigraphs have no special meaning in Bison,
14673 nor is backslash-newline allowed.
14674 (Actions): Document that trigraphs have no special meaning.
14675
14676 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14677 no longer used.
14678
146792002-11-02 Paul Eggert <eggert@twinsun.com>
14680
14681 * src/reader.c: Don't include quote.h; not needed.
14682 (get_merge_function): Reword warning to be consistent with
14683 type clash diagnostic in grammar_current_rule_check.
14684
14685 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14686 bug in trigraph handling.
14687
14688 * src/output.c (prepare_symbols): When printing token names,
14689 escape "[" as "@<:@" and likewise for "]".
14690
14691 * src/system.h (errno): Remove declaration, as we are now
14692 assuming C89 or better, and C89 guarantees errno.
14693
762b212b
PE
146942002-10-30 Paul Eggert <eggert@twinsun.com>
14695
14696 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14697 Check for close failures.
14698 * src/files.h (xfclose): Return void, not int, since it always
14699 returned zero.
14700 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14701 indicates one.
14702 * src/output.c (output_skeleton): Use xfclose rather than fclose
14703 and ferror. xfclose now checks ferror.
14704
14705 * data/glr.c (YYLEFTMOST_STATE): Remove.
14706 (yyreportTree): Use a stack-based leftmost state. This avoids
14707 our continuing battles with bogus warnings about initializers.
14708
56100c60
AD
147092002-10-30 Akim Demaille <akim@epita.fr>
14710
14711 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14712 #if.
14713
51b4a04c
PH
147142002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14715
14716 * tests/glr-regr1.at: New test for reported regressions.
14717 * tests/testsuite.at: Add glr-regr1.at test.
14718 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 14719
bf1ebda2
PE
147202002-10-24 Paul Eggert <eggert@twinsun.com>
14721
5c16c6b1
PE
14722 Version 1.75a.
14723
bf1ebda2
PE
14724 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
14725 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
14726 we use malloc. Don't assume 'A' through 'Z' are contiguous.
14727 Don't assume strdup exists; POSIX says its an XSI extension.
14728 Check for buffer overflow on input.
14729
b526ee61
AD
147302002-10-24 Akim Demaille <akim@epita.fr>
14731
14732 * src/output.c (output_skeleton): Don't disable M4sugar comments
14733 too soon: it results in comments being expanded.
14734 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
14735 first output.
14736
f1886bb2
AD
147372002-10-24 Akim Demaille <akim@epita.fr>
14738
14739 * data/yacc.c (m4_int_type): New.
14740 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
14741 char' as only yacc.c wants K&R portability.
14742 * data/glr.c (yysigned_char): Remove.
14743 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
14744 Reported by Quoc Peyrot.
14745
c5576256
PE
147462002-10-23 Paul Eggert <eggert@twinsun.com>
14747
14748 * src/main.c (main): With --trace=time, report times even if a
14749 non-fatal error occurs. Formerly, the times were reported in some
14750 such cases but not in others.
14751 * src/reader.c (reader): Just return if a complaint has been issued,
14752 instead of exiting, so that 'main' can report times.
14753
27b0ffea
AD
147542002-10-22 Akim Demaille <akim@epita.fr>
14755
14756 * src/system.h: Include sys/types.
14757 Reported by Bert Deknuydt.
14758
223a7883
PE
147592002-10-23 Paul Eggert <eggert@twinsun.com>
14760
14761 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
14762 Suggested by Art Haas.
14763
147642002-10-22 Paul Eggert <eggert@twinsun.com>
14765
14766 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
14767 decl; not needed any more.
14768 * src/main.c (main): Use return to exit, undoing yesterday's change.
14769 The last OS that we could find where this wouldn't work is
14770 SunOS 3.5, and that's too old to worry about now.
14771
14772 * data/glr.c (struct yyltype): Define members even when not
14773 doing locations. This is more consistent with yacc.c, and it
14774 works around the following bug reports:
161a71f3
PE
14775 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
14776 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 14777
223a7883
PE
14778 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
14779 @acronym consistently. Standardize on "Yacc" instead of "YACC",
14780 "Algol" instead of "ALGOL". Give a bit more history about BNF.
14781
8b76775a
AD
147822002-10-22 Akim Demaille <akim@epita.fr>
14783
14784 * data/README: New.
14785
6db10d14
PE
147862002-10-21 Paul Eggert <eggert@twinsun.com>
14787
14788 Be consistent about 'bool'; the old code used an enum in one
14789 module and an int in another, and this violates the C standard.
14790 * m4/stdbool.m4: New file, from coreutils 4.5.3.
14791 * configure.ac (AC_HEADER_STDBOOL): Add.
14792 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
14793 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
14794 * src/symtab.c (hash_compare_symbol_t): Likewise.
14795 * src/system.h (bool, false, true): Use a definition consistent
14796 with ../lib/hash.c. All uses changed.
14797
14798 * src/complain.c (warning_issued): Renamed from warn_message_count,
14799 so that we needn't worry about integer overflow (!).
14800 Now of type bool. All uses changed.
14801 (complaint_issued): Renamed from complain_message_count; likewise.
14802
14803 * src/main.c (main): Use exit to exit with failure.
27b0ffea 14804
6db10d14
PE
14805 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
14806 rather than 1 and 0.
14807 * src/main.c (main): Likewise.
14808 * src/getargs.c (getargs): Likewise.
14809 * src/reader.c (reader): Likewise.
14810
14811 * src/getarg.c (getargs): Remove duplicate code for
14812 "Try `bison --help'".
14813
14814 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
14815 What was that "2" for?
14816
14817 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
14818 * src/getargs.c (usage): Likewise.
14819
14820 * src/getargs.c (getargs): When there are too few operands, report
14821 the last one. When there are too many, report the first extra
14822 one. This is how diffutils does it.
14823
92a060fd
PE
148242002-10-20 Paul Eggert <eggert@twinsun.com>
14825
14826 Remove K&R vestiges.
14827 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
14828 * src/complain.c (VA_START): Remove. Assume prototypes.
14829 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
14830 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
14831 fatal): Assume prototypes.
14832 * src/complain.h: Assume prototypes.
14833 * src/system.h (PARAMS): Remove.
14834 Include <limits.h> unconditionally, since it's guaranteeed even
14835 for a freestanding C89 compiler.
14836 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
14837 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 14838
e7cb57c0
AD
148392002-10-20 Akim Demaille <akim@epita.fr>
14840
14841 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
14842 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
14843 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
14844 (yyresolveStates, yyresolveAction, yyresolveStack)
14845 (yyprocessOneStack): Use them.
14846 (yy_reduce_print): New.
14847 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
14848
0245f82d
AD
148492002-10-20 Akim Demaille <akim@epita.fr>
14850
14851 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
14852 arguments and output `void'.
14853 (b4_c_function): Rename as...
14854 (b4_c_function_def): this.
14855 (b4_c_function_decl, b4_c_ansi_function_def)
14856 (b4_c_ansi_function_decl): New.
14857 Change the interpretation of the arguments: before `int, foo', now
14858 `int foo, foo'.
14859 * data/yacc.c (yyparse): Prototype and define thanks to these.
14860 Adjust b4_c_function_def uses.
14861 * data/glr.c (yyparse): Likewise, but ANSI only.
14862
39912f52
AD
148632002-10-20 Akim Demaille <akim@epita.fr>
14864
14865 * src/output.c (prepare): Move the definition of `tokens_number',
14866 `nterms_number', `undef_token_number', `user_token_number_max'
14867 to...
14868 (prepare_tokens): Here.
14869 (prepare_tokens): Rename as...
14870 (prepare_symbols): this.
14871 (prepare): Move the definition of `rules_number' to...
14872 (prepare_rules): here.
14873 (prepare): Move the definition of `last', `final_state_number',
14874 `states_number' to...
14875 (prepare_states): here.
14876 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
14877
20c1e2ad
AD
148782002-10-20 Akim Demaille <akim@epita.fr>
14879
14880 * src/tables.h, src/tables.c, src/output.c: Comment changes.
14881
21964f43
AD
148822002-10-20 Akim Demaille <akim@epita.fr>
14883
14884 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
14885 * data/c.m4: here.
14886
66d30cd4
AD
148872002-10-20 Akim Demaille <akim@epita.fr>
14888
14889 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
14890 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
14891 `pair'.
14892 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
14893 `name' to...
14894 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
14895 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
14896 These.
14897
95f2c9fe
PE
148982002-10-19 Paul Eggert <eggert@twinsun.com>
14899
14900 Do not create a temporary file, as that involves security and
14901 cleanup headaches. Instead, use a pair of pipes.
14902 Derived from a suggestion by Florian Krohm.
14903 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
14904 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
14905 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
14906 (BISON_PREREQ_SUBPIPE): Add.
14907 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
14908 Add subpipe.h, subpipe.c.
14909 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
14910 * po/POTFILES.in: Add lib/subpipe.c.
14911 * src/output.c: Include "subpipe.h".
14912 (m4_invoke): Remove decl.
14913 (scan_skel): New decl.
14914 (output_skeleton): Use pipe rather than temporary file for m4 input.
14915 Check that m4sugar.m4 is readable, to avoid deadlock.
14916 Check for pipe I/O error.
14917 * src/scan-skel.l (readpipe): Remove decl.
14918 (scan_skel): New function, to be used in place of m4_invoke.
14919 Read from stream rather than file.
66d30cd4 14920
95f2c9fe
PE
14921 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
14922 float, as this generates a warning on Solaris 8 + GCC 3.2 with
14923 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
14924 this generates a more-accurate value anyway.
14925
14926 * lib/timevar.c (timervar_accumulate): Rename locals to
14927 avoid confusion with similarly-named more-global.
14928 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
14929
14930 * src/output.c (prepare): Use xstrdup to convert char const *
14931 to char *, to avoid GCC warning.
14932
c19988b7
AD
149332002-10-19 Akim Demaille <akim@epita.fr>
14934
14935 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
14936 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
14937 Use them to have `calc.y' ready for %pure-parser.
14938 * data/yacc.c (YYLEX): Pass a yylex return type to
14939 b4_c_function_call.
14940
ae7453f2
AD
149412002-10-19 Akim Demaille <akim@epita.fr>
14942
14943 Prototype support of %lex-param and %parse-param.
14944
14945 * src/parse-gram.y: Add the definition of the %lex-param and
14946 %parse-param tokens, plus their rules.
14947 Drop the `_' version of %glr-parser.
14948 Add the "," token.
14949 * src/scan-gram.l (INITIAL): Scan them.
14950 * src/muscle_tab.c: Comment changes.
14951 (muscle_insert, muscle_find): Rename `pair' as `probe'.
14952 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
14953 (muscle_entry_s): The `value' member is no longer const.
14954 Adjust all dependencies.
14955 * src/muscle_tab.c (muscle_init): Adjust: use
14956 MUSCLE_INSERT_STRING.
14957 Initialize the obstack earlier.
14958 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
14959 (muscle_pair_list_grow): New.
14960 * data/c.m4 (b4_c_function_call, b4_c_args): New.
14961 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
14962 * tests/calc.at: Use %locations, not --locations.
14963 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
14964
0e575721
AD
149652002-10-19 Akim Demaille <akim@epita.fr>
14966
14967 * src/getargs.c (usage): Take status as argument and exit
14968 accordingly.
14969 Report the traditional `Try ... --help' message when status != 0.
14970 (usage, version): Don't take a FILE * as arg, it is pointless.
14971 (getargs): When there is an incorrect number of arguments, make it
14972 an error, and report it GNUlically thanks to `usage ()'.
14973
724ce7f5
PE
149742002-10-18 Paul Eggert <eggert@twinsun.com>
14975
3a781eb2
PE
14976 * data/glr.c (yyreportParseError): Don't assume that sprintf
14977 yields the length of the printed string, as this is not true
14978 on SunOS 4.1.4. Reported by Peter Klein.
14979
724ce7f5
PE
14980 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
14981 * tests/conflicts.at (%nonassoc and eof): Likewise.
14982 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
14983
473d0a75
AD
149842002-10-17 Akim Demaille <akim@epita.fr>
14985
14986 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
14987 * src/getargs.c (trace_types, trace_args): Adjust.
14988 * src/reader.c (grammar_current_rule_prec_set)
14989 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
14990 Standardize error messages.
14991 And s/@prec/%prec/!
14992 (reader): Use trace_flag to enable scanner/parser debugging,
14993 instead of an adhoc scheme.
14994 * src/scan-gram.l: Remove trailing debugging code.
14995
e76d2469
PE
149962002-10-16 Paul Eggert <eggert@twinsun.com>
14997
93e2236a
PE
14998 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
14999 MUSCLE_TAB_H.
15000
e76d2469
PE
15001 * NEWS: Officially drop support for building Bison with K&R C,
15002 since it didn't work anyway and it's not worth worrying about.
15003 * Makefile.maint (wget_files): Remove ansi2knr.c.
15004 (ansi2knr.c-url_prefix): Remove.
15005 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15006 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15007 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15008
5bd1c419
PE
150092002-10-15 Paul Eggert <eggert@twinsun.com>
15010
15011 Stop using the "enum_" trick for K&R-style function definitions;
15012 it confused me, and I was the author! Instead, assume that people
15013 who want to use K&R C compilers (when using these modules in GCC,
15014 perhaps?) will run ansi2knr.
15015
15016 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15017 All uses of "enum_" changed to "enum ".
15018 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15019 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 15020
5bd1c419
PE
15021 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15022 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15023 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15024 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15025 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15026 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15027 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15028 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15029 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15030 Use function prototypes; this removes the need for declaring
15031 static functions simply to provide their prototypes.
15032 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15033 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15034 bitset_count_, bitset_create, bitset_dump, bitset_first,
15035 bitset_free, bitset_init, bitset_last, bitset_next,
15036 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15037 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15038 bitset_print, bitset_release_memory, bitset_toggle_,
15039 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15040 debug_bitset): Likewise.
15041 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15042 * lib/bitset_stats.c (bitset_log_histogram_print,
15043 bitset_percent_histogram_print, bitset_stats_and,
15044 bitset_stats_and_cmp, bitset_stats_and_or,
15045 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15046 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15047 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15048 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15049 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15050 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15051 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15052 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15053 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15054 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15055 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15056 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15057 bitset_stats_zero): Likewise.
15058 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15059 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15060 bitsetv_dump, debug_bitsetv): Likewise.
15061 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15062 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15063 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15064 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15065 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15066 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15067 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15068 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15069 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15070 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15071 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15072 Likewise.
15073 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15074 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15075 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15076 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15077 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15078 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15079 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15080 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15081 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15082 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15083 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 15084
ae26e1f0
AD
150852002-10-14 Akim Demaille <akim@epita.fr>
15086
15087 Version 1.75.
15088
d43baf71
AD
150892002-10-14 Akim Demaille <akim@epita.fr>
15090
15091 * tests/Makefile.am (maintainer-check-posix): New.
15092
7ebc83e3
AD
150932002-10-14 Akim Demaille <akim@epita.fr>
15094
15095 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15096 member.
15097
05846dae
AD
150982002-10-14 Akim Demaille <akim@epita.fr>
15099
15100 * src/tables.c (table_ninf_remap): base -> tab.
15101 Reported by Matt Rosing.
15102
1318e37d
PE
151032002-10-14 Paul Eggert <eggert@twinsun.com>
15104
447fbb17
PE
15105 * tests/action.at, tests/calc.at, tests/conflicts.at,
15106 tests/cxx-type.at, tests/headers.at, tests/input.at,
15107 tests/regression.at, tests/synclines.at, tests/torture.at:
15108 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15109 so that the tests still work even if POSIXLY_CORRECT is set.
15110 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 15111
1318e37d
PE
15112 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15113 for portability to K&R hosts. Fix typo: signed char is guaranteed
15114 only to 127, not to 128.
15115 * data/glr.c (yysigned_char): New type.
15116 * data/yacc.c (yysigned_char): Likewise.
15117 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15118
cc0f0794
PE
151192002-10-13 Paul Eggert <eggert@twinsun.com>
15120
5038f418
PE
15121 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15122 true due to limited range of data type" warning from GCC.
15123
cc0f0794
PE
15124 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15125 by wrapping enum yytokentype's definition inside #ifndef
15126 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15127
6fed0802
AD
151282002-10-13 Akim Demaille <akim@epita.fr>
15129
15130 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15131 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15132
32f0598d
AD
151332002-10-13 Akim Demaille <akim@epita.fr>
15134
15135 * Makefile.maint: Update from Autoconf 2.54.
15136 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15137
7ea9a33f
AD
151382002-10-13 Akim Demaille <akim@epita.fr>
15139
15140 * src/print.c (print_state): Separate the list of solved conflicts
15141 from the other items.
15142 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15143
ea99527d
AD
151442002-10-13 Akim Demaille <akim@epita.fr>
15145
15146 Let nondeterministic skeletons be usable with deterministic
15147 tables.
15148
15149 With the patch, GAWK compiled by GCC without -O2 passes its test
15150 suite using a GLR parser driven by LALR tables. It fails with -O2
15151 because `struct stat' gives two different answers on my machine:
15152 88 (definition of an auto var) and later 96 (memset on this var).
15153 Hence the stack is badly corrumpted. The headers inclusion is to
15154 blame: if I move the awk.h inclusion before GLR's system header
15155 inclusion, the two struct stat have the same size.
15156
15157 * src/tables.c (pack_table): Always create conflict_table.
15158 (token_actions): Always create conflict_list.
15159 * data/glr.c (YYFLAG): Remove, unused.
15160
f377f69f
AD
151612002-10-13 Akim Demaille <akim@epita.fr>
15162
15163 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15164 (O0FLAGS): New.
15165 (VALGRIND, GXX): New.
15166 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15167 * tests/bison.in: Run $PREBISON a pre-command.
15168 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15169 (maintainer-check-g++): New.
15170 * Makefile.am (maintainer-check): New.
15171
2a1fe6ed
AD
151722002-10-13 Akim Demaille <akim@epita.fr>
15173
15174 * data/glr.c: Formatting changes.
15175 Tweak some trace messages to match yacc.c's.
15176
f50adbbd
AD
151772002-10-13 Akim Demaille <akim@epita.fr>
15178
15179 GLR parsers sometimes raise parse errors instead of performing the
15180 default reduction.
15181 Reported by Charles-Henry de Boysson.
15182
15183 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15184 check the length of the traces when %glr.
f50adbbd
AD
15185 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15186 GLR's traces.
15187 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15188 Test GLR parsers.
15189 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15190 (yyltype): Remove the yy prefix from the member names.
15191 (yytable): Complete its comment.
15192 (yygetLRActions): Map error action number from YYTABLE from
15193 YYTABLE_NINF to 0.
15194 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15195 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15196 not satisfying as we could compare an YYACTION computed from
15197 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15198 only value for error actions.
15199 (yyreportParseError): In verbose parse error messages, don't issue
15200 `error' in the list of expected tokens.
15201 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15202 next action to perform to match glr.c's decoding.
15203 (yytable): Complete its comment.
15204
bcbad5b9
PE
152052002-10-13 Paul Eggert <eggert@twinsun.com>
15206
15207 Fix problem reported by Henrik Grubbstroem in
161a71f3 15208 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15209 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15210 because the Bison parser reads the second action before reducing
15211 the first one.
15212 * src/scan-gram.l (rule_length): New static var.
15213 Use it to keep track of the rule length in the scanner, since
15214 we can't expect the parser to be in lock-step sync with the scanner.
15215 (handle_action_dollar, handle_action_at): Use this var.
15216 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15217
14904b89
PE
152182002-10-12 Paul Eggert <eggert@twinsun.com>
15219
1fe611e5
PE
15220 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15221 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15222 Include <sys/time.h> when checking for clock_t and struct tms.
15223 Use same include order as source.
15224 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15225 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15226
1fe611e5
PE
15227 * lib/timevar.c: Update copyright date and clarify comments.
15228 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15229
1fe611e5
PE
15230 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15231 GCC version as of today, then merge Bison's changes.
15232 Change "GCC" to "Bison" in copyright notice. timevar.def's
15233 author is Akim, so change that too.
15234
98194095
PE
15235 * src/reader.c (grammar_current_rule_check):
15236 Don't worry about the default action if $$ is untyped.
15237 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15238 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15239
14904b89
PE
15240 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15241 * data/glr.c, data/lalr1.cc, data/yacc.c:
15242 Output token definitions before the first part of user declarations.
15243 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15244 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15245
ff6dca18
PE
152462002-10-11 Paul Eggert <eggert@twinsun.com>
15247
15248 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15249 (yyparse): here. This undoes some of the 2002-07-25 change.
15250 Compatibility problem reported by Ralf S. Engelschall with
15251 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15252
eb714592
AD
152532002-10-11 Akim Demaille <akim@epita.fr>
15254
15255 * tests/regression.at Characters Escapes): New.
15256 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15257 characters.
15258 Reported by Jan Nieuwenhuizen.
15259
b7195100
AD
152602002-10-11 Akim Demaille <akim@epita.fr>
15261
15262 * po/id.po: New.
15263
f28a0f2d
PE
152642002-10-10 Paul Eggert <eggert@twinsun.com>
15265
15266 Portability fixes for bitsets; this also avoids several GCC
15267 warnings.
15268
15269 * lib/abitset.c: Include <stddef.h>, for offsetof.
15270 * lib/lbitset.c: Likewise.
15271
15272 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15273 properly for vectors of objects. Do not assume that adding a
15274 header size to a multiple of a word size yields a value that is
15275 properly aligned for the whole union.
15276 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15277
15278 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15279 unique names for structures.
15280 * lib/ebitset.c (ebitset_bytes): Likewise.
15281 * lib/lbitset.c (lbitset_bytes): Likewise.
15282
15283 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15284 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15285 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15286 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15287 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15288 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15289 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15290 to improve the type-checking that GCC can do.
15291 * lib/bitset.c (bitset_op4_cmp): Likewise.
15292 * lib/bitset_stats.c (bitset_stats_count,
15293 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15294 bitset_stats_copy, bitset_stats_disjoint_p,
15295 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15296 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15297 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15298 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15299 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15300 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15301 bitset_stats_or_and_cmp): Likewise.
15302 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15303 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15304 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15305 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15306
15307 * lib/abitset.h: Include bitset.h, not bbitset.h.
15308 * lib/ebitset.h: Likewise.
15309 * lib/lbitset.h: Likewise.
15310
15311 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15312 All instances of parameters of type enum bitset_opts are now of
15313 type enum_bitset_opts, to conform to the C Standard, and similarly
15314 for enum_bitset_type.
15315 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15316 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15317
15318 Do not use "struct bitset_struct" to mean different things in
15319 different modules. Not only is this confusing, it violates
15320 the C Standard, which requires that structure types in different
15321 modules must be compatible if one is to be passed to the other.
15322 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15323 All instances of "struct bitset_struct *" replaced with "bitset".
15324 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15325 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15326 struct lbitset_struct, struct bitset_stats_struct): New types.
15327 All uses of struct bitset_struct changed to union bitset_union,
15328 etc.
ba0fe3c7 15329 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
15330 struct bitset_struct): Remove.
15331 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15332 struct bitset_struct): Remove.
15333 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15334 bitset_struct): Remove.
15335 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15336 Likewise.
15337
15338 Do not call a function of type T using a call that assumes the
15339 function is of a different type U. Standard C requires that a
15340 function must be called with a type that is compatible with its
15341 definition.
15342 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15343 New decls.
15344 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15345 New functions.
15346 * lib/ebitset.c (PFV): Remove.
15347 * lib/lbitset.c (PFV): Likewise.
15348 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15349 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15350 decls.
15351 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15352 (ebitset_vtable): Use them.
15353 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15354 lbitset_xor): New functions.
15355 (lbitset_vtable): Use them.
15356
15357 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15358 Declare.
15359
15360 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15361 GCC warning.
15362 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15363 Use offsetof, for simplicity.
15364
6fbe4984
PE
153652002-10-06 Paul Eggert <eggert@twinsun.com>
15366
15367 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15368 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 15369 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
15370 which was inadvertently undone by the 2002-09-30 patch.
15371 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15372 the same width as int.
15373
420f93c8
PE
153742002-10-04 Paul Eggert <eggert@twinsun.com>
15375
15376 Version 1.50.
15377
15378 * configure.ac (AC_INIT), NEWS: Increment version number.
15379
15380 * doc/bison.texinfo: Minor spelling, grammar, and white space
15381 fixes.
15382 (Symbols): Mention that any negative value returned from yylex
15383 signifies end-of-input. Warn about negative chars. Mention
15384 the portable Standard C character set.
15385
15386 The GNU coding standard says CFLAGS and YFLAGS are reserved
15387 for the installer to set.
15388 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15389 * src/Makefile.am (AM_CFLAGS): Likewise.
15390 (AM_YFLAGS): Renamed from YFLAGS.
15391
15392 Fix some MAX and MIN problems.
15393 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15394 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15395 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15396 * src/reader.c (reader): Use it.
15397
15398 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15399 POSIX 1003.1-2001 has removed fgrep.
15400
154012002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15402
15403 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15404 interpreted as signed.
15405 * lib/ebitset.c (ebitset_list): Fix bug.
15406
ff68026d
PE
154072002-10-01 Paul Eggert <eggert@twinsun.com>
15408
15409 More fixes for 64-bit hosts and large bitsets.
15410
15411 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15412 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15413 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15414 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15415 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15416 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15417 bitset_count_): Likewise.
15418 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15419 bitset_first, bitset_last): Likewise.
15420 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15421 bitset_stats_list_reverse, bitset_stats_size,
15422 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15423 Likewise.
15424 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15425 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15426 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15427 bitsetv_reflexive_transitive_closure): Likewise.
15428 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15429 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15430 Likewise.
15431 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15432 Likewise.
420f93c8 15433
ff68026d
PE
15434 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15435 Use size_t, not unsigned int, to count bytes.
15436 * lib/abitset.h (abitset_bytes): Likewise.
15437 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15438 Likewise.
15439 * lib/bitset.h (bitset_bytes): Likewise.
15440 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15441 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15442 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15443 * lib/ebitset.c (ebitset_bytes): Likewise.
15444 * lib/ebitset.h (ebitset_bytes): Likewise.
15445 * lib/lbitset.c (lbitset_bytes): Likewise.
15446 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 15447
ff68026d
PE
15448 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15449 abitset_subset_p, abitset_disjoint_p, abitset_and,
15450 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15451 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15452 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15453 abitset_or_and, abitset_or_and_cmp):
15454 Use bitset_windex instead of unsigned int.
15455 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15456 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15457 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15458 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15459 Likewise.
15460 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 15461
ff68026d
PE
15462 * lib/bitset.c (bitset_print):
15463 Use proper printf formats for widths of integer types.
15464 * lib/bitset_stats.c (bitset_percent_histogram_print,
15465 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15466 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15467 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15468 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 15469
ff68026d
PE
15470 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15471 BITSET_SIZE_MAX): New macros.
15472 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15473 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15474 to BITSET_WINDEX_MAX.
15475
15476 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15477 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15478 since we now return the bitset_bindex type (not int).
15479
15480 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15481 when computing sizes.
15482 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15483
15484 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15485 and avoid cast to unsigned.
15486
6aa452a6
AD
154872002-09-30 Akim Demaille <akim@epita.fr>
15488
15489 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15490 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15491 Updates from Michael Hayes.
15492
927f7817
AD
154932002-09-30 Art Haas <ahaas@neosoft.com>
15494
15495 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15496 invocations.
15497 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15498 defined.
15499
9738f41e
AD
155002002-09-27 Akim Demaille <akim@epita.fr>
15501
15502 Version 1.49c.
15503
a5c75d7f
AD
155042002-09-27 Akim Demaille <akim@epita.fr>
15505
15506 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15507 (Because of AC_LIBSOURCE).
15508
8280e179
AD
155092002-09-27 Akim Demaille <akim@epita.fr>
15510
15511 Playing with Autoscan.
15512
15513 * configure.ac: Remove the old LIBOBJ tweaks.
15514 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15515 * lib/strrchr.c: New.
15516 * lib/strtol.c: New, from the Coreutils 4.5.1.
15517
ae64af35
AD
155182002-09-27 Akim Demaille <akim@epita.fr>
15519
15520 Playing with Autoscan.
15521
15522 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15523 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15524 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15525 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15526 Coreutils 4.5.1.
15527
d1a1114f
AD
155282002-09-24 Akim Demaille <akim@epita.fr>
15529
15530 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15531 (Frequently Asked Questions, Parser Stack Overflow): New.
15532
b906441c
AD
155332002-09-13 Akim Demaille <akim@epita.fr>
15534
15535 Playing with autoscan.
15536
15537 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15538 * src/files.c (skeleton_find): Remove, unused.
15539 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15540 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15541
bd701811
AD
155422002-09-13 Akim Demaille <akim@epita.fr>
15543
15544 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15545 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15546
e0a13e7b
AD
155472002-09-13 Akim Demaille <akim@epita.fr>
15548
15549 * configure.ac: Require 2.54.
15550 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15551 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15552 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15553 Remove, provided by Autoconf macros.
15554
c97011bf
AD
155552002-09-12 Akim Demaille <akim@epita.fr>
15556
15557 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15558
d862b1be
AD
155592002-09-12 Akim Demaille <akim@epita.fr>
15560
15561 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15562 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15563 Reported by Martin Mokrejs.
15564
3d38c03a
AD
155652002-09-10 Akim Demaille <akim@epita.fr>
15566
15567 * src/parse-gram.y: Associate a human readable string to each
15568 token type.
15569 * tests/regression.at (Invalid inputs): Adjust.
15570
b6347355
AD
155712002-09-10 Gary V. Vaughan <gary@gnu.org>
15572
15573 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15574 with an Autoconf-2.5x style configure.ac.
15575
09ba4ab2
PE
155762002-09-06 Paul Eggert <eggert@twinsun.com>
15577
15578 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15579 exception applies only to yacc.c. This is a modification of a
15580 patch originally suggested by Akim Demaille.
15581
21846f69
AD
155822002-09-06 Akim Demaille <akim@epita.fr>
15583
09ba4ab2
PE
15584 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15585 here to...
15586 * data/yacc.c: here.
15587
21846f69
AD
15588 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15589 LocationType.
15590 (b4_ltype): Default to yy::Location from location.hh.
15591
c0ad8bf3
AD
155922002-09-04 Jim Meyering <jim@meyering.net>
15593
15594 * data/yacc.c: Guard the declaration of yytoknum also with
15595 `#ifdef YYPRINT', so it is declared only when used.
15596
3a93251e
AD
155972002-09-04 Akim Demaille <akim@epita.fr>
15598
15599 * configure.in: Rename as...
15600 * configure.ac: this.
15601 Bump to 1.49c.
15602
427c0dda
AD
156032002-09-04 Akim Demaille <akim@epita.fr>
15604
15605 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15606 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15607 translate maintainer only messages.
15608
6a254321
PE
156092002-08-12 Paul Eggert <eggert@twinsun.com>
15610
645e30d1
PE
15611 Version 1.49b.
15612
6a254321
PE
15613 * Makefile.am (SUBDIRS): Remove intl.
15614 (DISTCLEANFILES): Remove.
15615 * NEWS: Mention that GNU M4 is now required. Clarify what is
15616 meant by "larger grammars". Mention the pt_BR translation.
15617 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15618 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15619 Bump version from 0.11.2 to 0.11.5.
15620 (BISON_PREREQ_STAGE): Remove.
15621 (AM_GNU_GETTEXT): Use external gettext.
15622 (AC_OUTPUT): Remove intl/Makefile.
15623
15624 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15625
15626 * data/glr.c: Include string.h, for strlen.
15627 (yyreportParseError): Use size_t for yysize.
15628 (yy_yypstack): No longer nested inside yypstates, as nested
15629 functions are not portable. Do not assume size_t is the
15630 same width as int.
15631 (yypstates): Do not assume that ptrdiff_t is the same width
15632 as int, and similarly for yyposn and YYINDEX.
15633
15634 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15635
15636 * lib/Makefile.am (INCLUDES): Do not include from the intl
15637 directory, which has been removed.
15638 * src/Makefile.am (INCLUDES): Likewise.
15639
15640 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15641 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15642 New vars.
15643
15644 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15645 * tests/Makefile.am (EXTRA_DIST): Likewise.
15646
15647 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15648 Do not assume that bitset_windex is the same width as unsigned.
15649
15650 * lib/abitset.c (abitset_unused_clear): Do not assume that
15651 bitset_word is the same width as int.
15652 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15653 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15654 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15655 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15656 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15657
15658 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15659 portability to one's complement hosts!).
15660 * lib/ebitset.c (ebitset_op1): Likewise.
15661 * lib/lbitset.c (lbitset_op1): Likewise.
15662
15663 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15664 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15665 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15666 Sync with fileutils.
15667 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15668 lib/gettext.h: Sync with diffutils.
15669
15670 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15671 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15672
15673 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15674 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15675 check for void *.
15676
15677 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15678 size_t; the old version tried to do this but casted improperly.
15679 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15680 (bitset_test): Now returns int, not unsigned long.
15681
15682 * lib/bitset_stats.c: Include "gettext.h".
15683 (_): New macro.
15684 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15685 name locals "index", as it generates unnecessary warnings on some
15686 hosts that have an "index" function.
15687
15688 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15689 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15690 they need translation.
15691 * src/LR0.c (state_list_append, new_itemsets, get_state,
15692 append_states, generate_states): Likewise.
15693 * src/assoc.c (assoc_to_string): Likewise.
15694 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15695 * src/gram.c (grammar_dump): Likewise.
15696 * src/injections.c (injections_compute): Likewise.
15697 * src/lalr.c (lookaheads_print): Likewise.
15698 * src/relation.c (relation_transpose): Likewise.
15699 * src/scan-gram.l: Likewise.
15700 * src/tables.c (table_grow, pack_vector): Likewise.
15701
15702 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15703 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15704 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15705 * m4/mbstate_t.m4: Sync with fileutils.
15706 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15707
15708 * po/LINGUAS: Add pt_BR.
15709 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15710 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15711 lib/timevar.c.
15712 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15713 manual recommends.
15714 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
15715
15716 * src/complain.c (strerror_r): Remove decl; not needed.
15717 (strerror): Use same pattern as ../lib/error.c.
15718
15719 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
15720
15721 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
15722
15723 * src/main.c (main): Cast result of bindtextdomain and textdomain
15724 to void, to avoid a GCC warning when --disable-nls is in effect.
15725
15726 * src/scan-gram.l: Use strings rather than escapes when possible,
15727 to minimize the number of warnings from xgettext.
15728 (handle_action_dollar, handle_action_at): Don't use isdigit,
15729 as it mishandles negative chars and it may not work as expected
15730 outside the C locale.
15731
15732 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
15733 this is a GCC extension and is not portable to other compilers.
15734
15735 * src/system.h (alloca): Use same pattern as ../lib/error.c.
15736 Do not include <ctype.h>; no longer needed.
15737 Do not include <malloc.h>; no longer needed (and generates
15738 warnings on OpenBSD 3.0).
15739
15740 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
15741 it's not portable.
15742
15743 * tests/regression.at: Do not use 'cc -c input.c -o input';
15744 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
15745
15746 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
15747 exit status as failure, not just exit status 1. Sun C exits
15748 with status 2 sometimes.
15749
15750 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
15751 Use it for the two large tests.
15752
c8f002c7
AD
157532002-08-02 Akim Demaille <akim@epita.fr>
15754
15755 * src/conflicts.c (conflicts_output): Don't output rules never
15756 reduced here, since anyway that computation doesn't work.
15757 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
15758 (rule_useless_p, rule_never_reduced_p): New.
15759 (grammar_rules_partial_print): Use a filter instead of a range.
15760 Display the title only if needed.
15761 (grammar_rules_print): Adjust.
15762 (grammar_rules_never_reduced_report): New.
15763 * src/tables.c (action_row): Move the computation of rules never
15764 reduced to...
15765 (token_actions): here.
15766 * src/main.c (main): Make the parser before making the report, so
15767 that rules never reduced are computed.
15768 Call grammar_rules_never_reduced_report.
15769 * src/print.c (print_results): Report rules never reduced.
15770 * tests/conflicts.at, tests/reduce.at: Adjust.
15771
cd08e51e
AD
157722002-08-01 Akim Demaille <akim@epita.fr>
15773
15774 Instead of attaching lookaheads and duplicating the rules being
15775 reduced by a state, attach the lookaheads to the reductions.
15776
15777 * src/state.h (state_t): Remove the `lookaheads',
15778 `lookaheads_rule' member.
15779 (reductions_t): Add a `lookaheads' member.
15780 Use a regular array for the `rules'.
15781 * src/state.c (reductions_new): Initialize the lookaheads member
15782 to 0.
15783 (state_rule_lookaheads_print): Adjust.
15784 * src/state.h, src/state.c (state_reductions_find): New.
15785 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
15786 (count_rr_conflicts): Adjust.
15787 * src/lalr.c (LArule): Remove.
15788 (add_lookback_edge): Adjust.
15789 (state_lookaheads_count): New.
15790 (states_lookaheads_initialize): Merge into...
15791 (initialize_LA): this.
15792 (lalr_free): Adjust.
15793 * src/main.c (main): Don't free nullable and derives too early: it
15794 is used by --verbose.
15795 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
15796
bb0027a9
AD
157972002-08-01 Akim Demaille <akim@epita.fr>
15798
15799 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
15800 `rule_number_t**'.
15801 (set_derives, free_derives): Rename as...
15802 (derives_compute, derives_free): this.
15803 Adjust all dependencies.
15804 * src/nullable.c (set_nullable, free_nullable): Rename as...
15805 (nullable_compute, nullable_free): these.
15806 (rule_list_t): Store rule_t *, not rule_number_t.
15807 * src/state.c (state_rule_lookaheads_print): Directly compare rule
15808 pointers, instead of their numbers.
15809 * src/main.c (main): Call nullable_free, and derives_free earlier,
15810 as they were lo longer used.
15811
3325ddc4
AD
158122002-08-01 Akim Demaille <akim@epita.fr>
15813
15814 * lib/timevar.c (get_time): Include children time.
15815 * src/lalr.h (LA, LArule): Don't export them: used with the
15816 state_t.
15817 * src/lalr.c (LA, LArule): Static.
15818 * src/lalr.h, src/lalr.c (lalr_free): New.
15819 * src/main.c (main): Call it.
15820 * src/tables.c (pack_vector): Check whether loc is >= to the
15821 table_size, not >.
15822 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
15823 (tables_generate): do it, since that's also it which allocates
15824 them.
15825 Don't free LA and LArule, main does.
15826
c6f1a33c
AD
158272002-07-31 Akim Demaille <akim@epita.fr>
15828
15829 Separate parser tables computation and output.
15830
15831 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
15832 (conflict_list, conflict_list_cnt, table, check, table_ninf)
15833 (yydefgoto, yydefact, high): Move to...
15834 * src/tables.h, src/tables.c: here.
15835 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
15836 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
15837 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
15838 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
15839 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
15840 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15841 (action_row, save_row, token_actions, save_column, default_goto)
15842 (goto_actions, sort_actions, matching_state, pack_vector)
15843 (table_ninf_remap, pack_table, prepare_actions): Move to...
15844 * src/tables.c: here.
15845 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
15846 * src/output.c (token_actions, output_base, output_conflicts)
15847 (output_check): Merge into...
15848 (prepare_actions): this.
15849 (actions_output): Rename as...
15850 (user_actions_output): this.
15851 * src/main.c (main): Call tables_generate and tables_free.
15852
1509d42f
AD
158532002-07-31 Akim Demaille <akim@epita.fr>
15854
15855 Steal GCC's --time-report support.
15856
15857 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
15858 stolen/adjusted from GCC.
15859 * m4/stage.m4: Remove time related checks.
15860 * m4/timevar.m4: New.
15861 * configure.in: Adjust.
15862 * src/system.h: Adjust to using timevar.h.
15863 * src/getargs.h, src/getargs.c: Support trace_time for
15864 --trace=time.
15865 * src/main.c (stage): Remove.
15866 (main): Replace `stage' invocations with timevar calls.
15867 * src/output.c: Insert pertinent timevar calls.
15868
273a74fa
AD
158692002-07-31 Akim Demaille <akim@epita.fr>
15870
15871 Let --trace have arguments.
15872
15873 * src/getargs.h (enum trace_e): New.
15874 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
15875 (long_options, short_options): --trace/-T takes an optional
15876 argument.
15877 Change all the uses of trace_flag to reflect the new flags.
15878 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
15879
15880 Strengthen `stage' portability.
15881
15882 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
15883 * configure.in: Use it.
15884 Don't check for malloc.h and sys/times.h.
15885 * src/system.h: Include them when appropriate.
15886 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
15887 times and struct tms are available.
15888
217598da
AD
158892002-07-30 Akim Demaille <akim@epita.fr>
15890
15891 In verbose parse error message, don't report `error' as an
15892 expected token.
15893 * tests/actions.at (Printers and Destructors): Adjust.
15894 * tests/calc.at (Calculator $1): Adjust.
15895 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
15896 error message, do not report the parser accepts the error token in
15897 that state.
15898
52489d44
AD
158992002-07-30 Akim Demaille <akim@epita.fr>
15900
15901 Normalize conflict related messages.
15902
15903 * src/complain.h, src/complain.c (warn, complain): New.
15904 * src/conflicts.c (conflicts_print): Use them.
15905 (conflict_report_yacc): New, extracted from...
15906 (conflicts_print): here.
15907 * tests/conflicts.at, tests/existing.at: Adjust.
15908
e8832397
AD
159092002-07-30 Akim Demaille <akim@epita.fr>
15910
15911 Report rules which are never reduced by the parser: those hidden
15912 by conflicts.
15913
15914 * src/LR0.c (save_reductions): Don't make the final state too
15915 different: save its reduction (accept) instead of having a state
15916 without any action (no shift or goto, no reduce).
15917 Note: the final state is now a ``regular'' state, i.e., the
15918 parsers now contain `reduce 0' as default reduction.
15919 Nevertheless, since they decide to `accept' when yystate =
15920 final_state, they still will not reduce rule 0.
15921 * src/print.c (print_actions, print_reduction): Adjust.
15922 * src/output.c (action_row): Track reduced rules.
15923 (token_actions): Report rules never reduced.
15924 * tests/conflicts.at, tests/regression.at: Adjust.
15925
caf23d24
AD
159262002-07-30 Akim Demaille <akim@epita.fr>
15927
15928 `stage' was accidently included in a previous patch.
15929 Initiate its autoconfiscation.
15930
15931 * configure.in: Look for malloc.h and sys/times.h.
15932 * src/main.c (stage): Adjust.
15933 Report only when trace_flag.
15934
640748ee
AD
159352002-07-29 Akim Demaille <akim@epita.fr>
15936
15937 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
15938 state_number_t.
15939 (errs_t): symbol_t*, not symbol_number_t.
15940 (reductions_t): rule_t*, not rule_number_t.
15941 (FOR_EACH_SHIFT): New.
15942 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
15943 * src/print.c, src/print_graph.c: Adjust.
15944
88bce5a2
AD
159452002-07-29 Akim Demaille <akim@epita.fr>
15946
15947 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
15948
15949 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
15950 (endtoken, accept): these.
15951 * src/reader.c (reader): Set endtoken's default tag to "$end".
15952 Set undeftoken's tag to "$undefined" instead of "$undefined.".
15953 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
15954 Adjust.
15955
1bfb97db
AD
159562002-07-29 Akim Demaille <akim@epita.fr>
15957
15958 * src/reduce.c (reduce_grammar): When the language is empty,
15959 complain about the start symbol, not the axiom.
15960 Use its location.
15961 * tests/reduce.at (Empty Language): New.
15962
fc5734fe
AD
159632002-07-26 Akim Demaille <akim@epita.fr>
15964
15965 * src/reader.h, src/reader.c (gram_error): ... can't get
15966 yycontrol without making too strong assumptions on the parser
15967 itself.
15968 * src/output.c (prepare_tokens): Use the real 0th value of
15969 token_translations instead of `0'.
15970 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
15971 visible here.
15972 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
15973 for the time being: %locations ought to provide it to yyerror.
15974
3650b4b8
AD
159752002-07-25 Akim Demaille <akim@epita.fr>
15976
15977 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
15978 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
15979 * tests/regression.at (Web2c Actions): Adjust.
15980
4b3d3a8e
AD
159812002-07-25 Akim Demaille <akim@epita.fr>
15982
15983 Stop storing rules from 1 to nrules + 1.
15984
15985 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
15986 * src/nullable.c, src/output.c, src/print.c, src/reader.c
15987 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
15988 Iterate from 0 to nrules.
15989 Use rule_number_as_item_number and item_number_as_rule_number.
15990 Adjust to `derive' now containing possibly 0.
15991 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
15992 Handle the `- 1' part in rule numbers from/to item numbers.
15993 * src/conflicts.c (log_resolution): Fix the message which reversed
15994 shift and reduce.
15995 * src/output.c (action_row): Initialize default_rule to -1.
15996 (token_actions): Adjust.
15997 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
15998 expected output.
15999 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16000
4a2a22f4
AD
160012002-07-25 Akim Demaille <akim@epita.fr>
16002
16003 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16004 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16005 (b4_c_knr_arg_decl): New.
16006 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16007 yyreport_parse_error.
16008
b8df3223
AD
160092002-07-25 Akim Demaille <akim@epita.fr>
16010
16011 * data/yacc.c (yyreport_parse_error): New, extracted from...
16012 (yyparse): here.
16013 (yydestruct, yysymprint): Move above yyparse.
16014 Be K&R compliant.
16015
a762e609
AD
160162002-07-25 Akim Demaille <akim@epita.fr>
16017
16018 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16019 replace...
16020 (b4_sint_type, b4_uint_type): these.
16021 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16022 * tests/regression.at (Web2c Actions): Adjust.
16023
12b0043a
AD
160242002-07-25 Akim Demaille <akim@epita.fr>
16025
16026 * src/gram.h (TIEM_NUMBER_MAX): New.
16027 (item_number_of_rule_number, rule_number_of_item_number): Rename
16028 as...
16029 (rule_number_as_item_number, item_number_as_rule_number): these.
16030 Adjust dependencies.
16031 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16032 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16033 (symbol_number_to_vector_number): New.
16034 (order): Of vector_number_t* type.
16035 (base_t, BASE_MAX, BASE_MIN): New.
16036 (froms, tos, width, pos, check): Of base_t type.
16037 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16038 (actrow): Of action_number_t type.
16039 (conflrow): Of unsigned int type.
16040 (table_ninf, base_ninf): New.
16041 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16042 (muscle_insert_int_table, muscle_insert_base_table)
16043 (muscle_insert_rule_number_table): New.
16044 (prepare_tokens): Output `toknum' as int_table.
16045 (action_row): Returns a rule_number_t.
16046 Use ACTION_MIN, not SHRT_MIN.
16047 (token_actions): yydefact is rule_number_t*.
16048 (table_ninf_remap): New.
16049 (pack_table): Use it for `base' and `table'.
16050 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16051 replaced with...
16052 (YYPACT_NINF, YYTABLE_NINF): these.
16053 (yypact, yytable): Compute their types instead of hard-coded
16054 `short'.
16055 * tests/regression.at (Web2c Actions): Adjust.
16056
5dde258a
AD
160572002-07-19 Akim Demaille <akim@epita.fr>
16058
16059 * src/scan-gram.l (id): Can start with an underscore.
16060
a945ec39
AD
160612002-07-16 Akim Demaille <akim@epita.fr>
16062
16063 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16064 Adjust all former `associativity' dependencies.
16065 * src/symtab.c (symbol_new): Default associativity is `undef', not
16066 `right'.
16067 (symbol_check_alias_consistence): Adjust.
16068
fae437e8
AD
160692002-07-09 Akim Demaille <akim@epita.fr>
16070
16071 * doc/bison.texinfo: Properly set the ``header'' part.
16072 Use @dircategory ``GNU programming tools'' as per Texinfo's
16073 documentation.
16074 Use @copying.
16075
1a715ef2
AD
160762002-07-09 Akim Demaille <akim@epita.fr>
16077
16078 * lib/quotearg.h: Protect against multiple inclusions.
16079 * src/location.h (location_t): Add a `file' member.
16080 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16081 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16082 `error_one_per_line' support.
16083
a5d50994
AD
160842002-07-09 Akim Demaille <akim@epita.fr>
16085
16086 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16087 * src/reader.c (lineno): Remove.
16088 Adjust all dependencies.
16089 (get_merge_function): Take a location and use complain_at.
16090 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16091 * tests/regression.at (Invalid inputs, Mixing %token styles):
16092 Adjust.
16093
b275314e
AD
160942002-07-09 Akim Demaille <akim@epita.fr>
16095
16096 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16097 recovery rule, and forbid extensions when --yacc.
16098 (gram_error): Use complain_at.
16099 * src/reader.c (reader): Exit if there were parse errors.
16100
865b9df1
AD
161012002-07-09 Akim Demaille <akim@epita.fr>
16102
16103 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16104 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16105 Reported by R Blake <blakers@mac.com>.
16106
c76e14da
AD
161072002-07-09 Akim Demaille <akim@epita.fr>
16108
16109 * data/yacc.c: Output the copyright notive in the header.
16110
7db2ed2d
AD
161112002-07-03 Akim Demaille <akim@epita.fr>
16112
16113 * src/output.c (froms, tos): Are state_number_t.
16114 (save_column): sp, sp1, and sp2 are state_number_t.
16115 (prepare): Rename `final' as `final_state_number', `nnts' as
16116 `nterms_number', `nrules' as `rules_number', `nstates' as
16117 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16118 unused.
16119 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16120 * data/lalr1.cc (nsym_): Remove, unused.
16121
e68e0410
AD
161222002-07-03 Akim Demaille <akim@epita.fr>
16123
16124 * src/lalr.h, src/lalr.c (goto_number_t): New.
16125 * src/lalr.c (goto_list_t): New.
16126 Propagate them.
16127 * src/nullable.c (rule_list_t): New.
16128 Propagate.
16129 * src/types.h: Remove.
16130
e1a4f3a4
AD
161312002-07-03 Akim Demaille <akim@epita.fr>
16132
16133 * src/closure.c (print_fderives): Use rule_rhs_print.
16134 * src/derives.c (print_derives): Use rule_rhs_print.
16135 (rule_list_t): New, replaces `shorts'.
16136 (set_derives): Add comments.
16137 * tests/sets.at (Nullable, Firsts): Adjust.
16138
536545f3
AD
161392002-07-03 Akim Demaille <akim@epita.fr>
16140
16141 * src/output.c (prepare_actions): Free `tally' and `width'.
16142 (prepare_actions): Allocate and free `order'.
16143 * src/symtab.c (symbols_free): Free `symbols'.
16144 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16145 * src/output.c (m4_invoke): Move to...
16146 * src/scan-skel.l: here.
16147 (<<EOF>>): Close yyout, and free its name.
16148
8b752b00
AD
161492002-07-03 Akim Demaille <akim@epita.fr>
16150
16151 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16152
16153 * src/LR0.c (new_state): Merge into...
16154 (state_list_append): this.
16155 (new_states): Merge into...
16156 (generate_states): here.
16157 (set_states): Don't ensure a proper `errs' state member here, do it...
16158 * src/conflicts.c (conflicts_solve): here.
16159 * src/state.h, src/state.c: Comment changes.
16160 (state_t): Rename member `shifts' as `transitions'.
16161 Adjust all dependencies.
16162 (errs_new): For consistency, also take the values as argument.
16163 (errs_dup): Remove.
16164 (state_errs_set): New.
16165 (state_reductions_set, state_transitions_set): Assert that no
16166 previous value was assigned.
16167 (state_free): New.
16168 (states_free): Use it.
16169 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16170 temporary storage: use `errs' and `nerrs' as elsewhere.
16171 (set_conflicts): Allocate and free this `errs'.
16172
613f5e1a
AD
161732002-07-02 Akim Demaille <akim@epita.fr>
16174
16175 * lib/libiberty.h: New.
16176 * lib: Update the bitset implementation from upstream.
16177 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16178 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16179 * src/main.c: Adjust bitset stats calls.
16180
26e0cadc
PE
161812002-07-01 Paul Eggert <eggert@twinsun.com>
16182
16183 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16184 char, so that negative chars don't collide with $.
16185
1154cced
AD
161862002-06-30 Akim Demaille <akim@epita.fr>
16187
16188 Have the GLR tests be `warning' checked, and fix the warnings.
16189
16190 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16191 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16192 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16193 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16194 (yyaddDeferredAction): static.
16195 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16196 (yyreportParseError): yyprefix is const.
16197 yytokenp is used only when verbose.
16198 (yy__GNUC__): Replace with __GNUC__.
16199 (yypdumpstack): yyi is size_t.
16200 (yypreference): Un-yy local variables and arguments, to avoid
16201 clashes with `yyr1'. Anyway, we are not in the user name space.
16202 (yytname_size): be an int, as is compared with ints.
16203 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16204 Use them.
16205 * tests/cxx-gram.at: Use quotation to protect $1.
16206 Use AT_COMPILE to enable warnings hunts.
16207 Prototype yylex and yyerror.
16208 `Use' argc.
16209 Include `string.h', not `strings.h'.
16210 Produce and prototype stmtMerge only when used.
16211 yylex takes a location.
16212
97650f4e
AD
162132002-06-30 Akim Demaille <akim@epita.fr>
16214
16215 We spend a lot of time in quotearg, in particular when --verbose.
16216
16217 * src/symtab.c (symbol_get): Store a quoted version of the key.
16218 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16219 Adjust all callers.
16220
d2576365
AD
162212002-06-30 Akim Demaille <akim@epita.fr>
16222
16223 * src/state.h (reductions_t): Rename member `nreds' as num.
16224 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16225 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16226
ccaf65bc
AD
162272002-06-30 Akim Demaille <akim@epita.fr>
16228
16229 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16230 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16231 (shifts_to): Rename as...
16232 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16233 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16234 (TRANSITION_IS_DISABLED, transitions_to): these.
16235
87675353
AD
162362002-06-30 Akim Demaille <akim@epita.fr>
16237
16238 * src/print.c (print_shifts, print_gotos): Merge into...
16239 (print_transitions): this.
16240 (print_transitions, print_errs, print_reductions): Align the
16241 lookaheads columns.
16242 (print_core, print_transitions, print_errs, print_state,
16243 print_grammar): Output empty lines separator before, not after.
16244 (state_default_rule_compute): Rename as...
16245 (state_default_rule): this.
16246 * tests/conflicts.at (Defaulted Conflicted Reduction),
16247 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16248 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16249
ce4ccb4b
AD
162502002-06-30 Akim Demaille <akim@epita.fr>
16251
16252 Display items as we display rules.
16253
16254 * src/gram.h, src/gram.c (rule_lhs_print): New.
16255 * src/gram.c (grammar_rules_partial_print): Use it.
16256 * src/print.c (print_core): Likewise.
16257 * tests/conflicts.at (Defaulted Conflicted Reduction),
16258 (Unresolved SR Conflicts): Adjust.
16259 (Unresolved SR Conflicts): Adjust and rename as...
16260 (Resolved SR Conflicts): this, as was meant.
16261 * tests/regression.at (Web2c Report): Adjust.
16262
bc933ef1
AD
162632002-06-30 Akim Demaille <akim@epita.fr>
16264
16265 * src/print.c (state_default_rule_compute): New, extracted from...
16266 (print_reductions): here.
16267 Pessimize, but clarify the code.
16268 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16269
53d4308d
AD
162702002-06-30 Akim Demaille <akim@epita.fr>
16271
16272 * src/output.c (action_row): Let default_rule be always a rule
16273 number.
16274
574fb2d5
AD
162752002-06-30 Akim Demaille <akim@epita.fr>
16276
16277 * src/closure.c (print_firsts, print_fderives, closure):
16278 Use BITSET_EXECUTE.
16279 * src/lalr.c (lookaheads_print): Likewise.
16280 * src/state.c (state_rule_lookaheads_print): Likewise.
16281 * src/print_graph.c (print_core): Likewise.
16282 * src/print.c (print_reductions): Likewise.
16283 * src/output.c (action_row): Likewise.
16284 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16285
05811fd7
AD
162862002-06-30 Akim Demaille <akim@epita.fr>
16287
16288 * src/print_graph.c: Use report_flag.
16289
0e4d5753
AD
162902002-06-30 Akim Demaille <akim@epita.fr>
16291
16292 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16293 to...
16294 * src/relation.h, src/relation.c (traverse, relation_digraph)
16295 (relation_print, relation_transpose): New.
16296
24c7d800
AD
162972002-06-30 Akim Demaille <akim@epita.fr>
16298
16299 * src/state.h, src/state.c (shifts_to): New.
16300 * src/lalr.c (build_relations): Use it.
16301
9222837b
AD
163022002-06-30 Akim Demaille <akim@epita.fr>
16303
16304 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16305 (item_number_of_rule_number, rule_number_of_item_number): New.
16306 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16307 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16308 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16309 Propagate their use.
16310 Much remains to be done, in particular wrt `shorts' from types.h.
16311
260008e5
AD
163122002-06-30 Akim Demaille <akim@epita.fr>
16313
16314 * src/symtab.c (symbol_new): Initialize the `printer' member.
16315
8a731ca8
AD
163162002-06-30 Akim Demaille <akim@epita.fr>
16317
16318 * src/LR0.c (save_reductions): Remove, replaced by...
16319 * src/state.h, src/state.c (state_reductions_set): New.
16320 (reductions, errs): Rename as...
16321 (reductions_t, errs_t): these.
16322 Adjust all dependencies.
16323
32e1e0a4
AD
163242002-06-30 Akim Demaille <akim@epita.fr>
16325
16326 * src/LR0.c (state_list_t, state_list_append): New.
16327 (first_state, last_state): Now symbol_list_t.
16328 (this_state): Remove.
16329 (new_itemsets, append_states, save_reductions): Take a state_t as
16330 argument.
16331 (set_states, generate_states): Adjust.
16332 (save_shifts): Remove, replaced by...
16333 * src/state.h, src/state.c (state_shifts_set): New.
16334 (shifts): Rename as...
16335 (shifts_t): this.
16336 Adjust all dependencies.
16337 * src/state.h (state_t): Remove the `next' member.
16338
e5fb6710
AD
163392002-06-30 Akim Demaille <akim@epita.fr>
16340
16341 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16342 escaped in slot 0.
16343
c7ca99d4
AD
163442002-06-30 Akim Demaille <akim@epita.fr>
16345
16346 Use hash.h for the state hash table.
16347
16348 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16349 (allocate_storage): Use state_hash_new.
16350 (free_storage): Use state_hash_free.
16351 (new_state, get_state): Adjust.
16352 * src/lalr.h, src/lalr.c (states): Move to...
16353 * src/states.h (state_t): Remove the `link' member, no longer
16354 used.
16355 * src/states.h, src/states.c: here.
16356 (state_hash_new, state_hash_free, state_hash_lookup)
16357 (state_hash_insert, states_free): New.
16358 * src/states.c (state_table, state_compare, state_hash): New.
16359 * src/output.c (output_actions): Do not free states now, since we
16360 still need to know the final_state number in `prepare', called
16361 afterwards. Do it...
16362 * src/main.c (main): here: call states_free after `output'.
16363
df0e7316
AD
163642002-06-30 Akim Demaille <akim@epita.fr>
16365
16366 * src/state.h, src/state.c (state_new): New, extracted from...
16367 * src/LR0.c (new_state): here.
16368 * src/state.h (STATE_ALLOC): Move to...
16369 * src/state.c: here.
16370 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16371 * src/state.h, src/state.c: here.
16372
39f41916
AD
163732002-06-30 Akim Demaille <akim@epita.fr>
16374
16375 * src/reader.c (gensym): Rename as...
16376 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16377 (getsym): Rename as...
16378 (symbol_get): this.
16379
d57650a5
AD
163802002-06-30 Akim Demaille <akim@epita.fr>
16381
16382 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16383 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16384 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16385 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16386
5a08f1ce
AD
163872002-06-30 Akim Demaille <akim@epita.fr>
16388
16389 Make the test suite pass with warnings checked.
16390
16391 * tests/actions.at (Printers and Destructors): Improve.
16392 Avoid unsigned vs. signed issues.
16393 * tests/calc.at: Don't exercise the scanner here, do it...
16394 * tests/input.at (Torturing the Scanner): here.
16395
720623af
PH
163962002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16397
88e7e941 16398 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
16399 reorganize first lines parallel to yacc.c.
16400
fb8135fa
AD
164012002-06-28 Akim Demaille <akim@epita.fr>
16402
16403 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16404 (b4_token_enum, b4_token_defines): New, factored from...
16405 * data/lalr1.cc, data/yacc.c, glr.c: here.
16406
41442480
AD
164072002-06-28 Akim Demaille <akim@epita.fr>
16408
16409 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16410 unused variables.
16411 * src/output.c (merger_output): static.
16412
e0e5bf84
AD
164132002-06-28 Akim Demaille <akim@epita.fr>
16414
ba0fe3c7 16415 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
16416 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16417 pacify GCC.
16418 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16419
676385e2
PH
164202002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16421
16422 Accumulated changelog for new GLR parsing features.
16423
6a254321 16424 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
16425 conflicts_total_count.
16426 * src/conflicts.h: Ditto.
16427 * src/output.c (token_actions): Use the new name.
16428 (output_conflicts): Change conflp => conflict_list_heads, and
16429 confl => conflict_list for better readability.
16430 * data/glr.c: Use the new names.
16431 * NEWS: Add self to GLR announcement.
e0e5bf84 16432
676385e2
PH
16433 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16434
16435 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16436 Akim Demaille.
16437
16438 * data/bison.glr: Change name to glr.c
16439 * data/glr.c: Renamed from bison.glr.
16440 * data/Makefile.am: Add glr.c
e0e5bf84
AD
16441
16442 * src/getargs.c:
16443
676385e2 16444 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 16445 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 16446
676385e2
PH
16447 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16448
16449 * data/bison.glr: Be sure to restore the
16450 current #line when returning to the skeleton contents after having
16451 exposed the input file's #line.
16452
16453 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16454
16455 * data/bison.glr: Bring up to date with changes to bison.simple.
16456
16457 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16458
16459 * data/bison.glr: Correct definitions that use b4_prefix.
16460 Various reformatting.
16461 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16462 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16463 yytokenp argument; now part of stack.
16464 (yychar): Define to behave as documented.
16465 (yyclearin): Ditto.
e0e5bf84 16466
676385e2
PH
16467 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16468
16469 * src/reader.h: Add declaration for free_merger_functions.
16470
16471 * src/reader.c (merge_functions): New variable.
16472 (get_merge_function): New function.
16473 (free_merger_functions): New function.
16474 (readgram): Check for %prec that is not followed by a symbol.
16475 Handle %dprec and %merge declarations.
16476 (packgram): Initialize dprec and merger fields in rules array.
16477
16478 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16479 conflict_list_cnt, conflict_list_free): New variables.
16480 (table_grow): Also grow conflict_table.
e0e5bf84 16481 (prepare_rules): Output dprec and merger tables.
676385e2 16482 (conflict_row): New function.
e0e5bf84 16483 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
16484 default reduction in conflicted states for GLR parser so that there
16485 are spaces for the conflict lists.
16486 (save_row): Also save conflict information.
16487 (token_actions): Allocate conflict list.
16488 (merger_output): New function.
16489 (pack_vector): Pack conflict table, too.
16490 (output_conflicts): New function to output yyconflp and yyconfl.
16491 (output_check): Allocate conflict_tos.
16492 (output_actions): Output conflict tables, also.
16493 (output_skeleton): Output b4_mergers definition.
16494 (prepare): Output b4_max_rhs_length definition.
16495 Use 'bison.glr' as default skeleton for GLR parsers.
16496
16497 * src/gram.c (glr_parser): New flag.
16498 (grammar_free): Call free_merger_functions.
16499
16500 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16501 all pairs of conflicting reductions, rather than just all tokens
16502 causing conflicts. Needed to size conflict tables.
e0e5bf84 16503 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
16504 interface.
16505 (conflicts_print): Ditto.
16506 (count_total_conflicts): New function.
16507
16508 * src/reader.h (merger_list): New type.
16509 (merge_functions): New variable.
16510
16511 * src/lex.h (tok_dprec, tok_merge): New token types.
16512
16513 * src/gram.h (rule_s): Add dprec and merger fields.
16514 (glr_parser): New flag.
16515
16516 * src/conflicts.h (count_total_conflicts): New function.
16517
16518 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16519
16520 * doc/bison.texinfo (Generalized LR Parsing): New section.
16521 (GLR Parsers): New section.
16522 (Language and Grammar): Mention GLR parsing.
16523 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16524 Correct typo ("tge" -> "the").
16525
16526 * data/bison.glr: New skeleton for GLR parsing.
16527
16528 * tests/cxx-gram.at: New tests for GLR parsing.
16529
16530 * tests/testsuite.at: Include cxx-gram.at.
16531
16532 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 16533
676385e2
PH
16534 * src/parse-gram.y:
16535
16536 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16537
16538 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 16539
b5480d74 165402002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
16541
16542 * src/options.h, src/options.c: Remove.
16543 * src/getargs.c (short_options, long_options): New.
16544
60491a94
AD
165452002-06-27 Akim Demaille <akim@epita.fr>
16546
16547 * data/bison.simple, data/bison.c++: Rename as...
16548 * data/yacc.c, data/lalr1.cc: these.
16549 * doc/bison.texinfo (Environment Variables): Remove.
16550
9be0c25b
AD
165512002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16552
16553 * src/getargs.c (report_argmatch): Initialize strtok().
16554
1ae72863
AD
165552002-06-20 Akim Demaille <akim@epita.fr>
16556
16557 * data/bison.simple (b4_symbol_actions): New, replaces...
16558 (b4_symbol_destructor, b4_symbol_printer): these.
16559 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16560 user token numbers.
16561
87542d29
AD
165622002-06-20 Akim Demaille <akim@epita.fr>
16563
16564 * data/bison.simple (yydestructor): Rename as...
16565 (yydestruct): this.
16566
1a31ed21
AD
165672002-06-20 Akim Demaille <akim@epita.fr>
16568
16569 * src/symtab.h, src/symtab.c (symbol_type_set)
16570 (symbol_destructor_set, symbol_precedence_set): The location is
16571 the last argument.
16572 Adjust all callers.
16573
e776192e
AD
165742002-06-20 Akim Demaille <akim@epita.fr>
16575
16576 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16577 internals.
16578 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16579 Takes a location.
16580 * src/symtab.h, src/symtab.c (symbol_class_set)
16581 (symbol_user_token_number_set): Likewise.
16582 Adjust all callers.
16583 Promote complain_at.
16584 * tests/input.at (Type Clashes): Adjust.
16585
5c1180b3
AD
165862002-06-20 Akim Demaille <akim@epita.fr>
16587
16588 * data/bison.simple (YYLEX): Fix the declaration when
16589 %pure-parser.
16590
e3170060
AD
165912002-06-20 Akim Demaille <akim@epita.fr>
16592
16593 * data/bison.simple (yysymprint): Don't print the token number,
16594 just its name.
16595 * tests/actions.at (Destructors): Rename as...
16596 (Printers and Destructors): this.
16597 Also exercise %printer.
16598
253862fd
AD
165992002-06-20 Akim Demaille <akim@epita.fr>
16600
16601 * data/bison.simple (YYDSYMPRINT): New.
16602 Use it to remove many of the #if YYDEBUG/if (yydebug).
16603
366eea36
AD
166042002-06-20 Akim Demaille <akim@epita.fr>
16605
16606 * src/symtab.h, src/symtab.c (symbol_t): printer and
16607 printer_location are new members.
16608 (symbol_printer_set): New.
16609 * src/parse-gram.y (PERCENT_PRINTER): New token.
16610 Handle its associated rule.
16611 * src/scan-gram.l: Adjust.
16612 (handle_destructor_at, handle_destructor_dollar): Rename as...
16613 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16614 * src/output.c (symbol_printers_output): New.
16615 (output_skeleton): Call it.
16616 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16617 since there are already many grammar files with a user `yyprint'.
16618 Replace the calls to YYPRINT to calls to yysymprint.
16619 * tests/calc.at: Adjust.
16620 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16621 taking advantage of parser very internal details (stack size!).
16622
4f25ebb0
AD
166232002-06-20 Akim Demaille <akim@epita.fr>
16624
16625 * src/scan-gram.l: Complete the scanner with the missing patterns
16626 to pacify Flex.
16627 Use `quote' and `symbol_tag_get' where appropriate.
16628
93b68a0e
AD
166292002-06-19 Akim Demaille <akim@epita.fr>
16630
16631 * tests/actions.at (Destructors): Augment to test locations.
16632 * data/bison.simple (yydestructor): Pass it the current location
16633 if locations are enabled.
16634 Prototype only when __STDC__ or C++.
16635 Change the argument names to move into the yy name space: there is
16636 user code here.
16637
58612f1d
AD
166382002-06-19 Akim Demaille <akim@epita.fr>
16639
74310291
AD
16640 * data/bison.simple (b4_pure_if): New.
16641 Use it instead of #ifdef YYPURE.
16642
166432002-06-19 Akim Demaille <akim@epita.fr>
16644
16645 * data/bison.simple (b4_location_if): New.
58612f1d
AD
16646 Use it instead of #ifdef YYLSP_NEEDED.
16647
f25bfb75
AD
166482002-06-19 Akim Demaille <akim@epita.fr>
16649
16650 Prepare @$ in %destructor, but currently don't bind it in the
16651 skeleton, as %location use is not cleaned up yet.
16652
16653 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16654 (handle_action_at): New.
16655 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16656 a braced_code_t and a location as additional arguments.
16657 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16658 unquote one when outputting `b4_dollar_dollar'.
16659 Adjust callers.
16660 * data/bison.simple (b4_eval): Remove.
16661 (b4_symbol_destructor): Adjust.
16662 * tests/input.at (Invalid @n): Adjust.
16663
c732d2c6
AD
166642002-06-19 Zack Weinberg <zack@codesourcery.com>
16665
16666 * doc/bison.texinfo: Document ability to have multiple
16667 prologue sections.
16668
8c165d89
AD
166692002-06-18 Akim Demaille <akim@epita.fr>
16670
16671 * src/files.c (compute_base_names): When computing the output file
16672 names from the input file name, strip the directory part.
16673
ca98bf57
AD
166742002-06-18 Akim Demaille <akim@epita.fr>
16675
16676 * data/bison.simple.new: Comment changes.
16677 Reported by Andreas Schwab.
16678
0bfb02ff
AD
166792002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16680
16681 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16682 there are no `label `yyoverflowlab' defined but not used' warnings
16683 when yyoverflow is defined.
16684
24c0aad7
AD
166852002-06-18 Akim Demaille <akim@epita.fr>
16686
16687 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16688 new member.
16689 (symbol_destructor_set): Adjust.
16690 * src/output.c (symbol_destructors_output): Output the destructor
16691 locations.
16692 Output the symbol name.
16693 * data/bison.simple (b4_symbol_destructor): Adjust.
16694
5719c109
AD
166952002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16696 and Akim Demaille <akim@epita.fr>
16697
16698 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16699 what's left on the stack when the error recovery hits EOF.
16700 * tests/actions.at (Destructors): Complete to exercise this case.
16701
9280d3ef
AD
167022002-06-17 Akim Demaille <akim@epita.fr>
16703
16704 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16705 arguments is really empty, not only equal to `[]'.
16706 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16707 member.
16708 (symbol_destructor_set): New.
16709 * src/output.c (symbol_destructors_output): New.
16710 * src/reader.h (brace_code_t, current_braced_code): New.
16711 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16712 (handle_dollar): Rename as...
16713 (handle_action_dollar): this.
16714 (handle_destructor_dollar): New.
16715 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
16716 (grammar_declaration): Use it.
16717 * data/bison.simple (yystos): Is always defined.
16718 (yydestructor): New.
16719 * tests/actions.at (Destructors): New.
16720 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
16721
dafdc66f
AD
167222002-06-17 Akim Demaille <akim@epita.fr>
16723
16724 * src/symlist.h, src/symlist.c (symbol_list_length): New.
16725 * src/scan-gram.l (handle_dollar, handle_at): Compute the
16726 rule_length only when needed.
16727 * src/output.c (actions_output, token_definitions_output): Output
16728 the full M4 block.
16729 * src/symtab.c: Don't access directly to the symbol tag, use
16730 symbol_tag_get.
16731 * src/parse-gram.y: Use symbol_list_free.
16732
56c47203
AD
167332002-06-17 Akim Demaille <akim@epita.fr>
16734
16735 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
16736 (symbol_list_prepend, get_type_name): Move to...
16737 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
16738 (symbol_list_prepend, symbol_list_n_type_name_get): here.
16739 Adjust all callers.
16740 (symbol_list_free): New.
16741 * src/scan-gram.l (handle_dollar): Takes a location.
16742 * tests/input.at (Invalid $n): Adjust.
16743
1e0bab92
AD
167442002-06-17 Akim Demaille <akim@epita.fr>
16745
16746 * src/reader.h, src/reader.c (symbol_list_new): Export it.
16747 (symbol_list_prepend): New.
16748 * src/parse-gram.y (%union): `list' is a new member.
16749 (symbols.1): New, replaces...
16750 (terms_to_prec.1, nterms_to_type.1): these.
16751 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
16752 Take a location as additional argument.
16753 Adjust all callers.
16754
04e60654
AD
167552002-06-15 Akim Demaille <akim@epita.fr>
16756
16757 * src/parse-gram.y: Move %token in the declaration section so that
16758 we don't depend upon CVS Bison.
16759
10e5b8bd
AD
167602002-06-15 Akim Demaille <akim@epita.fr>
16761
16762 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
16763 * src/print.c (print_core): Use it.
16764
9801d40c
AD
167652002-06-15 Akim Demaille <akim@epita.fr>
16766
16767 * src/conflicts.c (log_resolution): Accept the rule involved in
16768 the sr conflicts instead of the lookahead number that points to
16769 that rule.
16770 (flush_reduce): Accept the current lookahead vector as argument,
16771 instead of the index in LA.
16772 (resolve_sr_conflict): Accept the current number of lookahead
16773 bitset to consider for the STATE, instead of the index in LA.
16774 (set_conflicts): Adjust.
16775 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
16776
c0263492
AD
167772002-06-15 Akim Demaille <akim@epita.fr>
16778
16779 * src/state.h (state_t): Replace the `lookaheadsp' member, a
16780 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
16781 Adjust all dependencies.
16782 * src/lalr.c (initialize_lookaheads): Split into...
16783 (states_lookaheads_count, states_lookaheads_initialize): these.
16784 (lalr): Adjust.
16785
9757c359
AD
167862002-06-15 Akim Demaille <akim@epita.fr>
16787
16788 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
16789 out of...
16790 (grammar_rules_print): here.
16791 * src/reduce.c (reduce_output): Use it.
16792 * tests/reduce.at (Useless Rules, Reduced Automaton)
16793 (Underivable Rules): Adjust.
16794
6b98e4b5
AD
167952002-06-15 Akim Demaille <akim@epita.fr>
16796
16797 Copy BYacc's nice way to report the grammar.
16798
16799 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
16800 New.
16801 Don't print the rules' location, it is confusing and useless.
16802 (rule_print): Use grammar_rhs_print.
16803 * src/print.c (print_grammar): Use grammar_rules_print.
16804
6b98e4b5
AD
168052002-06-15 Akim Demaille <akim@epita.fr>
16806
16807 Complete and rationalize `useless thing' warnings.
16808
16809 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
16810 (symbol_tag_print): New.
16811 Use them everywhere in place of accessing directly the tag member.
16812 * src/gram.h, src/gram.c (rule_print): New.
16813 Use it where a rule used to be printed `by hand'.
16814 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
16815 (reduce_grammar_tables): Report the useless rules.
16816 (reduce_print): Useless things are a warning, not an error.
16817 Report it as such.
16818 * tests/reduce.at (Useless Nonterminals, Useless Rules):
16819 (Reduced Automaton, Underivable Rules): Adjust.
16820 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
16821 * tests/conflicts.at (Unresolved SR Conflicts)
16822 (Solved SR Conflicts): Adjust.
16823
ee000ba4
AD
168242002-06-15 Akim Demaille <akim@epita.fr>
16825
16826 Let symbols have a location.
16827
16828 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
16829 (getsym): Adjust.
16830 Adjust all callers.
16831 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
16832 Use location_t, not int.
16833 * src/symtab.c (symbol_check_defined): Take advantage of the
16834 location.
16835 * tests/regression.at (Invalid inputs): Adjust.
16836
8efe435c
AD
168372002-06-15 Akim Demaille <akim@epita.fr>
16838
16839 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
16840 (input): Don't try to initialize yylloc here, do it in the
16841 scanner.
16842 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
16843 * src/gram.h (rule_t): Change line and action_line into location
16844 and action_location, of location_t type.
16845 Adjust all dependencies.
16846 * src/location.h, src/location.c (empty_location): New.
16847 * src/reader.h, src/reader.c (grammar_start_symbol_set)
16848 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
16849 (grammar_current_rule_symbol_append)
16850 (grammar_current_rule_action_append): Expect a location as argument.
16851 * src/reader.c (grammar_midrule_action): Adjust to attach an
16852 action's location as dummy symbol location.
16853 * src/symtab.h, src/symtab.c (startsymbol_location): New.
16854 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
16855 the line numbers.
16856
1921f1d7
AD
168572002-06-14 Akim Demaille <akim@epita.fr>
16858
16859 Grammar declarations may be found in the grammar section.
16860
16861 * src/parse-gram.y (rules_or_grammar_declaration): New.
16862 (declarations): Each declaration may end with a semicolon, not
16863 just...
16864 (grammar_declaration): `"%union"'.
16865 (grammar): Branch to rules_or_grammar_declaration.
16866
4515534c
AD
168672002-06-14 Akim Demaille <akim@epita.fr>
16868
16869 * src/main.c (main): Invoke scanner_free.
16870
f958596b
AD
168712002-06-14 Akim Demaille <akim@epita.fr>
16872
16873 * src/output.c (m4_invoke): Extracted from...
16874 (output_skeleton): here.
16875 Free tempfile.
16876
2c569025
AD
168772002-06-14 Akim Demaille <akim@epita.fr>
16878
16879 * src/parse-gram.y (directives, directive, gram)
16880 (grammar_directives, precedence_directives, precedence_directive):
16881 Rename as...
16882 (declarations, declaration, grammar, grammar_declaration)
16883 (precedence_declaration, precedence_declarator): these.
16884 (symbol_declaration): New.
16885
592e8d4d
AD
168862002-06-14 Akim Demaille <akim@epita.fr>
16887
16888 * src/files.c (action_obstack): Remove, unused.
16889 (output_obstack): Remove it, and all its dependencies, as it is no
16890 longer needed.
16891 * src/reader.c (epilogue_set): Build the epilogue in the
16892 muscle_obstack.
16893 * src/output.h, src/output.c (muscle_obstack): Move to...
16894 * src/muscle_tab.h, src/muscle_tab.h: here.
16895 (muscle_init): Initialize muscle_obstack.
16896 (muscle_free): New.
16897 * src/main.c (main): Call it.
16898
0c15323d
AD
168992002-06-14 Akim Demaille <akim@epita.fr>
16900
16901 * src/location.h: New, extracted from...
16902 * src/reader.h: here.
16903 * src/Makefile.am (noinst_HEADERS): Merge into
16904 (bison_SOURCES): this.
16905 Add location.h.
16906 * src/parse-gram.y: Use location_t instead of Bison's.
16907 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
16908 Use location_t instead of ints.
16909
e96c9728
AD
169102002-06-14 Akim Demaille <akim@epita.fr>
16911
16912 * data/bison.simple, data/bison.c++: Be sure to restore the
16913 current #line when returning to the skeleton contents after having
16914 exposed the input file's #line.
16915
75d1fe16
AD
169162002-06-12 Akim Demaille <akim@epita.fr>
16917
16918 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
16919 eager.
16920 * tests/actions.at (Exotic Dollars): New.
16921
6c35d22c
AD
169222002-06-12 Akim Demaille <akim@epita.fr>
16923
16924 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
16925 ['"/] too eagerly.
16926 * tests/input.at (Torturing the Scanner): New.
16927
1d6412ad
AD
169282002-06-11 Akim Demaille <akim@epita.fr>
16929
16930 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
16931 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
16932 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
16933 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
16934 * src/reader.c (reader): Use it.
16935
4cdb01db
AD
169362002-06-11 Akim Demaille <akim@epita.fr>
16937
16938 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
16939 Adjust all callers.
16940 (scanner_last_string_free): New.
16941
44995b2e
AD
169422002-06-11 Akim Demaille <akim@epita.fr>
16943
16944 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
16945 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
16946 (last_string, YY_OBS_FREE): New.
16947 Use them when returning an ID.
16948
e9955c83
AD
169492002-06-11 Akim Demaille <akim@epita.fr>
16950
16951 Have Bison grammars parsed by a Bison grammar.
16952
16953 * src/reader.c, src/reader.h (prologue_augment): New.
16954 * src/reader.c (copy_definition): Remove.
16955
16956 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
16957 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
16958 (grammar_current_rule_prec_set, grammar_current_rule_check)
16959 (grammar_current_rule_symbol_append)
16960 (grammar_current_rule_action_append): Export.
16961 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
16962 (symbol_list_action_append): Remove.
16963 Hook the routines from reader.
16964 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
16965 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
16966
16967 * src/reader.c (read_declarations): Remove, unused.
16968
16969 * src/parse-gram.y: Handle the epilogue.
16970 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
16971 (grammar_start_symbol_set): this.
16972 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
16973 * src/reader.c (readgram): Remove, unused.
16974 (reader): Adjust to insert eoftoken and axiom where appropriate.
16975
16976 * src/reader.c (copy_dollar): Replace with...
16977 * src/scan-gram.h (handle_dollar): this.
16978 * src/parse-gram.y: Remove `%thong'.
16979
16980 * src/reader.c (copy_at): Replace with...
16981 * src/scan-gram.h (handle_at): this.
16982
16983 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
16984 New.
16985
16986 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
16987 time being.
16988
16989 * src/reader.h, src/reader.c (grammar_rule_end): New.
16990
16991 * src/parse.y (current_type, current_class): New.
16992 Implement `%nterm', `%token' support.
16993 Merge `%term' into `%token'.
16994 (string_as_id): New.
16995 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
16996 type name.
16997
16998 * src/parse-gram.y: Be sure to handle properly the beginning of
16999 rules.
17000
17001 * src/parse-gram.y: Handle %type.
17002 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17003
17004 * src/parse-gram.y: More directives support.
17005 * src/options.c: No longer handle source directives.
17006
17007 * src/parse-gram.y: Fix %output.
17008
17009 * src/parse-gram.y: Handle %union.
17010 Use the prologue locations.
17011 * src/reader.c (parse_union_decl): Remove.
17012
17013 * src/reader.h, src/reader.c (epilogue_set): New.
17014 * src/parse-gram.y: Use it.
17015
17016 * data/bison.simple, data/bison.c++: b4_stype is now either not
17017 defined, then default to int, or to the contents of %union,
17018 without `union' itself.
17019 Adjust.
17020 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17021
17022 * src/output.c (actions_output): Don't output braces, as they are
17023 already handled by the scanner.
17024
17025 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17026 characters to themselves.
17027
17028 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17029 that the epilogue has a proper #line.
17030
17031 * src/parse-gram.y: Handle precedence/associativity.
17032
17033 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17034 a terminal.
17035 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17036 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17037 at all to define terminals that cannot be emitted.
17038
17039 * src/scan-gram.l: Escape M4 characters.
17040
17041 * src/scan-gram.l: Working properly with escapes in user
17042 strings/characters.
17043
17044 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17045 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17046 grammar.
17047 Use more modest sizes, as for the time being the parser does not
17048 release memory, and therefore the process swallows a huge amount
17049 of memory.
17050
17051 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17052 stricter %token grammar.
17053
17054 * src/symtab.h (associativity): Add `undef_assoc'.
17055 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17056 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17057
17058 * tests/regression.at (Invalid %directive): Remove, as it is now
17059 meaningless.
17060 (Invalid inputs): Adjust to the new error messages.
17061 (Token definitions): The new grammar doesn't allow too many
17062 eccentricities.
17063
17064 * src/lex.h, src/lex.c: Remove.
17065 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17066 (copy_character, copy_string2, copy_string, copy_identifier)
17067 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17068 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17069 (parse_action): Remove.
17070 * po/POTFILES.in: Adjust.
17071
2e047461
AD
170722002-06-11 Akim Demaille <akim@epita.fr>
17073
cd05d13c 17074 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
17075 rule's action member: return the action as a string.
17076 Don't require `rule_length' as an argument: compute it.
17077 (grammar_current_rule_symbol_append)
17078 (grammar_current_rule_action_append): New, eved out from
17079 (readgram): here.
17080 Remove `action_flag', `rulelength', unused now.
17081
9af3fbce
AD
170822002-06-11 Akim Demaille <akim@epita.fr>
17083
17084 * src/reader.c (grammar_current_rule_prec_set).
17085 (grammar_current_rule_check): New, eved out from...
17086 (readgram): here.
17087 Remove `xaction', `first_rhs': useless.
17088 * tests/input.at (Type clashes): New.
17089 * tests/existing.at (GNU Cim Grammar): Adjust.
17090
1485e106
AD
170912002-06-11 Akim Demaille <akim@epita.fr>
17092
17093 * src/reader.c (grammar_midrule_action): New, Eved out from
17094 (readgram): here.
17095
da4160c3
AD
170962002-06-11 Akim Demaille <akim@epita.fr>
17097
17098 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17099 New.
17100 (readgram): Use them as replacement of inlined code, crule and
17101 crule1.
17102
f6d0f937
AD
171032002-06-11 Akim Demaille <akim@epita.fr>
17104
17105 * src/reader.c (grammar_end, grammar_symbol_append): New.
17106 (readgram): Use them.
17107 Make the use of `p' as local as possible.
17108
69078d4b
AD
171092002-06-10 Akim Demaille <akim@epita.fr>
17110
17111 GCJ's parser requires the tokens to be defined before the prologue.
17112
17113 * data/bison.simple: Output the token definition before the user's
17114 prologue.
17115 * tests/regression.at (Braces parsing, Duplicate string)
17116 (Mixing %token styles): Check the output from bison.
17117 (Early token definitions): New.
17118
5e424082
AD
171192002-06-10 Akim Demaille <akim@epita.fr>
17120
17121 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17122 assigning twice the same user number to a token, so that we can
17123 use it in...
17124 * src/lex.c (lex): here.
17125 Also use `symbol_class_set' instead of hand written code.
17126 * src/reader.c (parse_assoc_decl): Likewise.
17127
44536b35
AD
171282002-06-10 Akim Demaille <akim@epita.fr>
17129
17130 * src/symtab.c, src/symtab.c (symbol_class_set)
17131 (symbol_user_token_number_set): New.
17132 * src/reader.c (parse_token_decl): Use them.
17133 Use a switch instead of ifs.
17134 Use a single argument.
17135
8b9f2372
AD
171362002-06-10 Akim Demaille <akim@epita.fr>
17137
17138 Remove `%thong' support as it is undocumented, unused, duplicates
17139 `%token's job, and creates useless e-mail traffic with people who
17140 want to know what it is, why it is undocumented, unused, and
17141 duplicates `%token's job.
17142
17143 * src/reader.c (parse_thong_decl): Remove.
17144 * src/options.c (option_table): Remove "thong".
17145 * src/lex.h (tok_thong): Remove.
17146
3ae2b51f
AD
171472002-06-10 Akim Demaille <akim@epita.fr>
17148
17149 * src/symtab.c, src/symtab.c (symbol_type_set)
17150 (symbol_precedence_set): New.
17151 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17152 (value_components_used): Remove, unused.
17153
2f1afb73
AD
171542002-06-09 Akim Demaille <akim@epita.fr>
17155
17156 Move symbols handling code out of the reader.
17157
17158 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17159 (axiom): Move to...
17160 * src/symtab.h, src/symtab.c: here.
17161
17162 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17163 * src/reader.c (startval): Rename as...
17164 * src/symtab.h, src/symtab.c (startsymbol): this.
17165 * src/reader.c: Adjust.
17166
17167 * src/reader.c (symbol_check_defined, symbol_make_alias)
17168 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17169 (token_translations_init)
17170 Move to...
17171 * src/symtab.c: here.
17172 * src/reader.c (packsymbols): Move to...
17173 * src/symtab.h, src/symtab.c (symbols_pack): here.
17174 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17175 argument.
17176
e9bca3ad
AD
171772002-06-03 Akim Demaille <akim@epita.fr>
17178
17179 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17180 then statements.
17181
86eff183
AD
171822002-06-03 Akim Demaille <akim@epita.fr>
17183
17184 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17185 structs with non literals.
17186 * src/scan-skel.l: never-interactive.
17187 * src/conflicts.c (enum conflict_resolution_e): No trailing
17188 comma.
17189 * src/getargs.c (usage): Split long literal strings.
17190 Reported by Hans Aberg.
17191
717be197
AD
171922002-05-28 Akim Demaille <akim@epita.fr>
17193
17194 * data/bison.c++: Use C++ ostreams.
17195 (cdebug_): New member.
17196
670ddffd
AD
171972002-05-28 Akim Demaille <akim@epita.fr>
17198
17199 * src/output.c (output_skeleton): Be sure to allocate enough room
17200 for `/' _and_ for `\0' in full_skeleton.
17201
769b430f
AD
172022002-05-28 Akim Demaille <akim@epita.fr>
17203
17204 * data/bison.c++: Catch up with bison.simple:
17205 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17206 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17207 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17208 and popping traces.
17209
7067cb36
PH
172102002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17211
17212 * src/output.c (output_skeleton): Put an explicit path in front of
17213 the skeleton file name, rather than relying on the -I directory,
17214 to partially alleviate effects of having a skeleton file lying around
17215 in the current directory.
769b430f 17216
4a713ec2
PH
172172002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17218
769b430f 17219 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17220 obstack_printf should be obstack_fgrow1.
17221
b408954b
AD
172222002-05-26 Akim Demaille <akim@epita.fr>
17223
17224 * src/state.h (state_t): `solved_conflicts' is a new member.
17225 * src/LR0.c (new_state): Set it to 0.
17226 * src/conflicts.h, src/conflicts.c (print_conflicts)
17227 (free_conflicts, solve_conflicts): Rename as...
17228 (conflicts_print, conflicts_free, conflicts_solve): these.
17229 Adjust callers.
17230 * src/conflicts.c (enum conflict_resolution_e)
17231 (solved_conflicts_obstack): New, used by...
17232 (log_resolution): this.
17233 Adjust to attach the conflict resolution to each state.
17234 Complete the description with the precedence/associativity
17235 information.
17236 (resolve_sr_conflict): Adjust.
17237 * src/print.c (print_state): Output its solved_conflicts.
17238 * tests/conflicts.at (Unresolved SR Conflicts)
17239 (Solved SR Conflicts): Exercise --report=all.
17240
a49aecd5
AD
172412002-05-26 Akim Demaille <akim@epita.fr>
17242
17243 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17244 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17245 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17246 (token_number_t, item_number_as_token_number)
17247 (token_number_as_item_number, muscle_insert_token_number_table):
17248 Rename as...
17249 (symbol_number_t, item_number_as_symbol_number)
17250 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17251 these, since it is more appropriate.
17252
5504898e
AD
172532002-05-26 Akim Demaille <akim@epita.fr>
17254
17255 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17256 `Error:' lines.
17257 * data/bison.simple (yystos) [YYDEBUG]: New.
17258 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17259 error recovery.
17260 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17261
ec3bc396
AD
172622002-05-25 Akim Demaille <akim@epita.fr>
17263
17264 * doc/bison.texinfo (Debugging): Split into...
17265 (Tracing): this new section, its former contents, and...
17266 (Understanding): this new section.
17267 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17268 by...
17269 (report_flag): this.
17270 Adjust all dependencies.
17271 (report_args, report_types, report_argmatch): New.
17272 (usage, getargs): Report/support -r, --report.
17273 * src/options.h
17274 (struct option_table_struct): Rename as..,
17275 (struct option_table_s): this.
17276 Rename the `set_flag' member to `flag' to match with getopt_long's
17277 struct.
17278 * src/options.c (option_table): Split verbose into an entry for
17279 %verbose, and another for --verbose.
17280 Support --report/-r, so remove -r from the obsolete --raw.
17281 * src/print.c: Attach full item sets and lookaheads reports to
17282 report_flag instead of trace_flag.
17283 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17284
78df8250
PE
172852002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17286 and Paul Eggert <eggert@twinsun.com>
769b430f 17287
78df8250
PE
17288 * data/bison.simple (yyparse): Correct error handling to conform to
17289 POSIX and yacc. Specifically, after syntax error is discovered,
17290 do not reduce further before shifting the error token.
17291 Clean up the code a bit by removing the labels yyerrdefault,
17292 yyerrhandle, yyerrpop.
17293 * NEWS: Document the above.
17294
c0c9ea05
PH
172952002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17296
17297 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17298 type; it isn't always big enough, since it doesn't necessarily
17299 include non-terminals.
769b430f 17300 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17301 the latter can be removed.
17302 (yy_token_number_type): Remove, only one use.
17303 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17304 don't use TokenNumberType as element type.
769b430f 17305
c0c9ea05
PH
17306 * tests/regression.at: Modify expected output to agree with change
17307 to yyr1 and yytranslate.
769b430f 17308
6390a83f
FK
173092002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17310
17311 * src/reader.c (parse_action): Use copy_character instead of
17312 obstack_1grow.
17313
db7c8e9a
AD
173142002-05-13 Akim Demaille <akim@epita.fr>
17315
17316 * tests/regression.at (Token definitions): Prototype yylex and
17317 yyerror.
17318
fcc61800
PH
173192002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17320
158c687b 17321 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
17322 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17323 32-bit arithmetic.
17324 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17325
5683e9b2
AD
173262002-05-07 Akim Demaille <akim@epita.fr>
17327
17328 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17329 avoid GCC warnings.
17330
0c2d3f4c
AD
173312002-05-07 Akim Demaille <akim@epita.fr>
17332
17333 Kill GCC warnings.
17334
17335 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17336 over the RHS of each rule.
17337 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17338 * src/state.h (state_t): Member `nitems' is unsigned short.
17339 * src/LR0.c (get_state): Adjust.
17340 * src/reader.c (packgram): Likewise.
17341 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17342 `Type'.
17343 (muscle_insert_int_table): Remove, unused.
17344 (prepare_rules): Remove `max'.
17345
1565b720
AD
173462002-05-06 Akim Demaille <akim@epita.fr>
17347
17348 * src/closure.c (print_firsts): Display of the symbol tags.
17349 (bitmatrix_print): Move to...
17350 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17351 here.
17352 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17353
cfaee611
AD
173542002-05-06 Akim Demaille <akim@epita.fr>
17355
17356 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17357 hash_do_for_each.
17358
458be8e0
AD
173592002-05-06 Akim Demaille <akim@epita.fr>
17360
17361 * src/LR0.c (new_state, get_state): Instead of using the global
17362 `kernel_size' and `kernel_base', have two new arguments:
17363 `core_size' and `core'.
17364 Adjust callers.
17365
a900a624
AD
173662002-05-06 Akim Demaille <akim@epita.fr>
17367
17368 * src/reader.c (packgram): No longer end `ritem' with a 0
17369 sentinel: it is not used.
17370
d4e7d3a1
AD
173712002-05-05 Akim Demaille <akim@epita.fr>
17372
17373 New experimental feature: display the lookaheads in the report and
17374 graph.
17375
17376 * src/print (print_core): When --trace-flag, display the rules
17377 lookaheads.
17378 * src/print_graph.c (print_core): Likewise.
17379 Swap the arguments.
17380 Adjust caller.
17381
39ceb25b
AD
173822002-05-05 Akim Demaille <akim@epita.fr>
17383
17384 * tests/torture.at (Many lookaheads): New test.
17385
5372019f
AD
173862002-05-05 Akim Demaille <akim@epita.fr>
17387
17388 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17389 (GENERATE_MUSCLE_INSERT_TABLE): this.
17390 (output_int_table, output_unsigned_int_table, output_short_table)
17391 (output_token_number_table, output_item_number_table): Replace with...
17392 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17393 (muscle_insert_short_table, muscle_insert_token_number_table)
17394 (muscle_insert_item_number_table): these.
17395 Adjust all callers.
17396 (prepare_tokens): Don't free `translations', since...
17397 * src/reader.h, src/reader.c (grammar_free): do it.
17398 Move to...
17399 * src/gram.h, src/gram.c (grammar_free): here.
17400 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17401 b4_translate_max.
17402
5df5f6d5
AD
174032002-05-05 Akim Demaille <akim@epita.fr>
17404
17405 * src/output.c (output_unsigned_int_table): New.
17406 (prepare_rules): `i' is unsigned.
17407 `prhs', `rline', `r2' are unsigned int.
17408 Rename muscle `rhs_number_max' as `rhs_max'.
17409 Output muscles `prhs_max', `rline_max', and `r2_max'.
17410 Free rline and r1.
17411 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17412 to compute types instead of constant types.
17413 * tests/regression.at (Web2c Actions): Adjust.
17414
b87f8b21
AD
174152002-05-04 Akim Demaille <akim@epita.fr>
17416
17417 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17418 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17419 Adjust dependencies.
17420 * src/output.c (token_definitions_output): Be sure not to output a
17421 `#define 'a'' when fed with `%token 'a' "a"'.
17422 * tests/regression.at (Token definitions): New.
17423
8bb936e4
PE
174242002-05-03 Paul Eggert <eggert@twinsun.com>
17425
17426 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17427 for K&R C.
17428
174292002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17430
17431 * Makefile.am (SUBDIRS): Remove intl.
17432 (EXTRA_DIST): Add config/config.rpath.
17433
53c71a12
AD
174342002-05-03 Akim Demaille <akim@epita.fr>
17435
17436 * data/bison.simple (m4_if): Don't output empty enums.
17437 And actually, output valid enum definitions :(.
17438
289dd0cf
AD
174392002-05-03 Akim Demaille <akim@epita.fr>
17440
17441 * configure.bat: Remove, completely obsolete.
17442 * Makefile.am (EXTRA_DIST): Adjust.
17443 Don't distribute config.rpath...
17444 * config/Makefile.am (EXTRA_DIST): Do it.
17445
db85e524
AD
174462002-05-03 Akim Demaille <akim@epita.fr>
17447
17448 * configure.in (GETTEXT_VERSION): New.
17449 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17450
83ccf991
AD
174512002-05-03 Akim Demaille <akim@epita.fr>
17452
17453 * data/bison.simple (b4_token_enum): New.
17454 (b4_token_defines): Use it to output tokens both as #define and
17455 enums.
17456 Suggested by Paul Eggert.
17457 * src/output.c (token_definitions_output): Don't output spurious
17458 white spaces.
17459
1f418995
AD
174602002-05-03 Akim Demaille <akim@epita.fr>
17461
17462 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17463
45119f04
RA
174642002-05-02 Robert Anisko <robert@lrde.epita.fr>
17465
17466 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17467 Update the stack class, give a try to deque as the default container.
17468
b2d52318
AD
174692002-05-02 Akim Demaille <akim@epita.fr>
17470
17471 * data/bison.simple (yyparse): Do not implement @$ = @1.
17472 (YYLLOC_DEFAULT): Adjust to do it.
17473 * doc/bison.texinfo (Location Default Action): Fix.
17474
3a8b4109
AD
174752002-05-02 Akim Demaille <akim@epita.fr>
17476
17477 * src/reader.c (parse_braces): Merge into...
17478 (parse_action): this.
17479
84614e13
AD
174802002-05-02 Akim Demaille <akim@epita.fr>
17481
17482 * configure.in (ALL_LINGUAS): Remove.
17483 * po/LINGUAS, hr.po: New.
17484
fdbcd8e2
AD
174852002-05-02 Akim Demaille <akim@epita.fr>
17486
17487 Remove the so called hairy (semantic) parsers.
17488
17489 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17490 * src/gram.h, src/gram.c (semantic_parser): Remove.
17491 (rule_t): Remove the guard and guard_line members.
17492 * src/lex.h (token_t): remove tok_guard.
17493 * src/options.c (option_table): Remove %guard and %semantic_parser
17494 support.
17495 * src/output.c, src/output.h (guards_output): Remove.
17496 (prepare): Adjust.
17497 (token_definitions_output): Don't output the `T'
17498 tokens (???).
17499 (output_skeleton): Don't output the guards.
17500 * src/files.c, src/files.c (attrsfile): Remove.
17501 * src/reader.c (symbol_list): Remove the guard and guard_line
17502 members.
17503 Adjust dependencies.
17504 (parse_guard): Remove.
17505 * data/bison.hairy: Remove.
17506 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17507 BISON_HAIRY.
17508
82b6cb3f
AD
175092002-05-02 Akim Demaille <akim@epita.fr>
17510
17511 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17512 (parse_guard): Rename the formal argument `stack_offset' as
17513 `rule_length', which is more readable.
17514 Adjust callers.
17515 (copy_at, copy_dollar): Instead of outputting the hard coded
17516 values of $$, $n and so forth, output invocation to b4_lhs_value,
17517 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
17518 Note: this patch partially drops `semantic-parser' support: it
17519 always does `rule_length - n', where semantic parsers ought to
17520 always use `-n'.
82b6cb3f
AD
17521 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17522 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17523
6cbfbcc5
AD
175242002-05-02 Akim Demaille <akim@epita.fr>
17525
17526 * configure.in (AC_INIT): Bump to 1.49b.
17527 (AM_INIT_AUTOMAKE): Short invocation.
17528
b8548114
AD
175292002-05-02 Akim Demaille <akim@epita.fr>
17530
17531 Version 1.49a.
17532
c20cd1fa
AD
175332002-05-01 Akim Demaille <akim@epita.fr>
17534
17535 * src/skeleton.h: Remove.
17536
8a9566d4
AD
175372002-05-01 Akim Demaille <akim@epita.fr>
17538
17539 * src/skeleton.h: Fix the #endif.
17540 Reported by Magnus Fromreide.
17541
8c6d399a
PE
175422002-04-26 Paul Eggert <eggert@twinsun.com>
17543
17544 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17545 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 17546 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 17547
2b7ed18a
RA
175482002-04-25 Robert Anisko <robert@lrde.epita.fr>
17549
17550 * src/scan-skel.l: Postprocess quadrigraphs.
17551
17552 * src/reader.c (copy_character): New function, used to output
17553 single characters while replacing `[' and `]' with quadrigraphs, to
17554 avoid troubles with M4 quotes.
17555 (copy_comment): Output characters with copy_character.
17556 (read_additionnal_code): Likewise.
17557 (copy_string2): Likewise.
17558 (copy_definition): Likewise.
17559
17560 * tests/calc.at: Exercise M4 quoting.
17561
34a89c50
AD
175622002-04-25 Akim Demaille <akim@epita.fr>
17563
17564 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17565 between `!' and the command.
17566 Reported by Paul Eggert.
17567
0dd1580a
RA
175682002-04-24 Robert Anisko <robert@lrde.epita.fr>
17569
17570 * tests/calc.at: Exercise prologue splitting.
17571
17572 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17573 `b4_post_prologue' instead of `b4_prologue'.
17574
17575 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17576 muscles.
17577 (output): Free pre_prologue_obstack and post_prologue_obstack.
17578 * src/files.h, src/files.c (attrs_obstack): Remove.
17579 (pre_prologue_obstack, post_prologue_obstack): New.
17580 * src/reader.c (copy_definition): Add a parameter to specify the
17581 obstack to fill, instead of using attrs_obstack unconditionally.
17582 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17583 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17584
83c1796f
PE
175852002-04-23 Paul Eggert <eggert@twinsun.com>
17586
17587 * data/bison.simple: Remove unnecessary commentary and white
17588 space differences from 1_29-branch.
17589 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17590
17591 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17592 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17593 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17594 constructors or destructors.
17595
17596 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17597
1207eeac
AD
175982002-04-23 Akim Demaille <akim@epita.fr>
17599
17600 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17601 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17602 location with columns.
17603 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17604 All reported by Paul Eggert.
17605
78ab8f67
AD
176062002-04-22 Akim Demaille <akim@epita.fr>
17607
17608 * src/reduce.c (dump_grammar): Move to...
17609 * src/gram.h, src/gram.c (grammar_dump): here.
17610 Be sure to separate long item numbers.
17611 Don't read the members of a rule's prec if its nil.
17612
133c20e2
AD
176132002-04-22 Akim Demaille <akim@epita.fr>
17614
17615 * src/output.c (table_size, table_grow): New.
17616 (MAXTABLE): Remove, replace uses with table_size.
17617 (pack_vector): Instead of dying when the table is too big, grow it.
17618
9515e8a7
AD
176192002-04-22 Akim Demaille <akim@epita.fr>
17620
17621 * data/bison.simple (yyr1): Its type is that of a token number.
17622 * data/bison.c++ (r1_): Likewise.
17623 * tests/regression.at (Web2c Actions): Adjust.
17624
23c5a174
AD
176252002-04-22 Akim Demaille <akim@epita.fr>
17626
17627 * src/reader.c (token_translations_init): 256 is now the default
17628 value for the error token, i.e., it will be assigned another
17629 number if the user assigned 256 to one of her tokens.
17630 (reader): Don't force 256 to error.
17631 * doc/bison.texinfo (Symbols): Adjust.
17632 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17633 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17634 etc. instead of 10, 20, 30 (which was used to `jump' over error
17635 (256) and undefined (2)).
17636
5fbb0954
AD
176372002-04-22 Akim Demaille <akim@epita.fr>
17638
17639 Propagate more token_number_t.
17640
17641 * src/gram.h (token_number_as_item_number)
17642 (item_number_as_token_number): New.
17643 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17644 Use it to create output_item_number_table and
17645 output_token_number_table.
17646 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17647 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17648 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17649 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17650
4f940944
AD
176512002-04-22 Akim Demaille <akim@epita.fr>
17652
17653 * src/output.h, src/output.c (get_lines_number): Remove.
17654
3ded9a63
AD
176552002-04-19 Akim Demaille <akim@epita.fr>
17656
17657 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17658 as Lex/Flex'.
17659 (Debugging): More details about enabling the debugging features.
17660 (Table of Symbols): Describe $$, $n, @$, and @n.
17661 Suggested by Tim Josling.
17662
e0c471a9
AD
176632002-04-19 Akim Demaille <akim@epita.fr>
17664
17665 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17666
fecc10cd
AD
176672002-04-10 Akim Demaille <akim@epita.fr>
17668
17669 * src/system.h: Rely on HAVE_LIMITS_H.
17670 Suggested by Paul Eggert.
17671
51dec47b
AD
176722002-04-09 Akim Demaille <akim@epita.fr>
17673
17674 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17675 full stderr, and strip it according to the bison options, instead
17676 of composing the error message from different bits.
17677 This makes it easier to check for several error messages.
17678 Adjust all the invocations.
17679 Add an invocation exercising the error token.
17680 Add an invocation demonstrating a stupid error message.
17681 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17682 Adjust the tests.
17683 Error message are for stderr, not stdout.
17684
007a50a4
AD
176852002-04-09 Akim Demaille <akim@epita.fr>
17686
17687 * src/gram.h, src/gram.c (error_token_number): Remove, use
17688 errtoken->number.
17689 * src/reader.c (reader): Don't specify the user token number (2)
17690 for $undefined, as it uselessly prevents using it.
17691 * src/gram.h (token_number_t): Move to...
17692 * src/symtab.h: here.
17693 (state_t.number): Is a token_number_t.
17694 * src/print.c, src/reader.c: Use undeftoken->number instead of
17695 hard coded 2.
17696 (Even though this 2 is not the same as above: the number of the
17697 undeftoken remains being 2, it is its user token number which
17698 might not be 2).
17699 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17700 `user_token_number_max'.
17701 Output `undef_token_number'.
17702 * data/bison.simple, data/bison.c++: Use them.
17703 Be sure to map invalid yylex return values to
17704 `undef_token_number'. This saves us from gratuitous SEGV.
17705
17706 * tests/conflicts.at (Solved SR Conflicts)
17707 (Unresolved SR Conflicts): Adjust.
17708 * tests/regression.at (Web2c Actions): Adjust.
17709
06446ccf
AD
177102002-04-08 Akim Demaille <akim@epita.fr>
17711
17712 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17713 Adding #line.
17714 Remove the duplicate `typedefs'.
17715 (RhsNumberType): Fix the declaration and various other typos.
17716 Use __ofile__.
17717 * data/bison.simple: Use __ofile__.
17718 * src/scan-skel.l: Handle __ofile__.
17719
62a3e4f0
AD
177202002-04-08 Akim Demaille <akim@epita.fr>
17721
17722 * src/gram.h (item_number_t): New, the type of item numbers in
17723 RITEM. Note that it must be able to code symbol numbers as
17724 positive number, and the negation of rule numbers as negative
17725 numbers.
17726 Adjust all dependencies (pretty many).
17727 * src/reduce.c (rule): Remove this `short *' pointer: use
17728 item_number_t.
17729 * src/system.h (MINSHORT, MAXSHORT): Remove.
17730 Include `limits.h'.
17731 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
17732 (shortcpy): Remove.
17733 (MAXTABLE): Move to...
17734 * src/output.c (MAXTABLE): here.
17735 (prepare_rules): Use output_int_table to output rhs.
17736 * data/bison.simple, data/bison.c++: Adjust.
17737 * tests/torture.at (Big triangle): Move the limit from 254 to
17738 500.
17739 * tests/regression.at (Web2c Actions): Ajust.
17740
17741 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
17742 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
17743 passes, but produces negative #line number, once fixed, GCC is
17744 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
17745 C), it passes.
17746 * src/state.h (state_h): Code input lines on ints, not shorts.
17747
bb88b0fc
AD
177482002-04-08 Akim Demaille <akim@epita.fr>
17749
17750 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
17751 and then the grammar.
17752
9a636f47
AD
177532002-04-08 Akim Demaille <akim@epita.fr>
17754
17755 * src/system.h: No longer using strndup.
17756
680e8701
AD
177572002-04-07 Akim Demaille <akim@epita.fr>
17758
17759 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
17760 * src/output.c (output_table_data): Return the longest number.
17761 (prepare_tokens): Output `token_number_max').
17762 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
17763 New.
17764 Use them to define yy_token_number_type/TokenNumberType.
17765 Use this type for yytranslate.
17766 * tests/torture.at (Big triangle): Push the limit from 124 to
17767 253.
17768 * tests/regression.at (Web2c Actions): Adjust.
17769
817e9f41
AD
177702002-04-07 Akim Demaille <akim@epita.fr>
17771
17772 * tests/torture.at (Big triangle): New.
17773 (GNU AWK Grammar, GNU Cim Grammar): Move to...
17774 * tests/existing.at: here.
17775
5123689b
AD
177762002-04-07 Akim Demaille <akim@epita.fr>
17777
17778 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
17779 nritems.
17780 Adjust dependencies.
17781
f3849179
AD
177822002-04-07 Akim Demaille <akim@epita.fr>
17783
17784 * src/reader.c: Normalize increments to prefix form.
17785
bd02036a
AD
177862002-04-07 Akim Demaille <akim@epita.fr>
17787
17788 * src/reader.c, symtab.c: Remove debugging code.
17789
db8837cb
AD
177902002-04-07 Akim Demaille <akim@epita.fr>
17791
17792 Rename all the `bucket's as `symbol_t'.
17793
17794 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
17795 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
17796 * src/symtab.c, src/symtab.h (bucket): Rename as...
17797 (symbol_t): this.
17798 (symbol_list_new, bucket_check_defined, bucket_make_alias)
17799 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
17800 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17801 (buckets_new, buckets_free, buckets_do): Rename as...
17802 (symbol_list_new, symbol_check_defined, symbol_make_alias)
17803 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17804 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
17805 (symbols_new, symbols_free, symbols_do): these.
17806
72a23c97
AD
178072002-04-07 Akim Demaille <akim@epita.fr>
17808
17809 Use lib/hash for the symbol table.
17810
17811 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
17812 EOF.
17813 * src/lex.c (lex): Set the `number' member of new terminals.
17814 * src/reader.c (bucket_check_defined, bucket_make_alias)
17815 (bucket_check_alias_consistence, bucket_translation): New.
17816 (reader, grammar_free, readgram, token_translations_init)
17817 (packsymbols): Adjust.
17818 (reader): Number the predefined tokens.
17819 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
17820 for predefined tokens.
17821 * src/symtab.h (bucket): Remove all the hash table related
17822 members.
17823 * src/symtab.c (symtab): Replace by...
17824 (bucket_table): this.
17825 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
17826 (buckets_new, buckets_do): New.
17827
280a38c3
AD
178282002-04-07 Akim Demaille <akim@epita.fr>
17829
17830 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
17831 (start_symbol, max_user_token_number, semantic_parser)
17832 (error_token_number): Initialize.
17833 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
17834 Initialize.
17835 (reader): Don't.
17836 (errtoken, eoftoken, undeftoken, axiom): Extern.
17837
03b31c0c
AD
178382002-04-07 Akim Demaille <akim@epita.fr>
17839
17840 * src/gram.h (rule_s): prec and precsym are now pointers
17841 to the bucket giving the priority/associativity.
17842 Member `associativity' removed: useless.
17843 * src/reduce.c, src/conflicts.c: Adjust.
17844
8b3df748
AD
178452002-04-07 Akim Demaille <akim@epita.fr>
17846
17847 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
17848 Properly escape the symbols' TAG when outputting them.
17849
e601aa1d
AD
178502002-04-07 Akim Demaille <akim@epita.fr>
17851
17852 * src/lalr.h (LA): Is a bitsetv, not bitset*.
17853
b0299a2e
AD
178542002-04-07 Akim Demaille <akim@epita.fr>
17855
17856 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
17857 (LArule): this, which is an array to rule_t*.
17858 * src/print.c, src/conflicts.c: Adjust.
17859
d7e1f00c
AD
178602002-04-07 Akim Demaille <akim@epita.fr>
17861
17862 * src/gram.h (rule_t): Rename `number' as `user_number'.
17863 `number' is a new member.
17864 Adjust dependencies.
17865 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
17866
cc9305dd
AD
178672002-04-07 Akim Demaille <akim@epita.fr>
17868
17869 As a result of the previous patch, it is no longer needed
17870 to reorder ritem itself.
17871
17872 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
17873
b0940840
AD
178742002-04-07 Akim Demaille <akim@epita.fr>
17875
17876 Be sure never to walk through RITEMS, but use only data related to
17877 the rules themselves. RITEMS should be banished.
17878
17879 * src/output.c (output_token_translations): Rename as...
17880 (prepare_tokens): this.
17881 In addition to `translate', prepare the muscles `tname' and
17882 `toknum', which were handled by...
17883 (output_rule_data): this.
17884 Remove, and move the remainder of its outputs into...
17885 (prepare_rules): this new routines, which also merges content from
17886 (output_gram): this.
17887 (prepare_rules): Be sure never to walk through RITEMS.
17888 (output_stos): Rename as...
17889 (prepare_stos): this.
17890 (output): Always invoke prepare_states, after all, just don't use it
17891 in the output if you don't need it.
17892
643a5994
AD
178932002-04-07 Akim Demaille <akim@epita.fr>
17894
17895 * src/LR0.c (new_state): Display `nstates' as the name of the
17896 newly created state.
17897 Adjust to initialize first_state and last_state if needed.
17898 Be sure to distinguish the initial from the final state.
17899 (new_states): Create the itemset of the initial state, and use
17900 new_state.
17901 * src/closure.c (closure): Now that the initial state has its
17902 items properly set, there is no need for a special case when
17903 creating `ruleset'.
17904
17905 As a result, now the rule 0, reducing to $axiom, is visible in the
17906 outputs. Adjust the test suite.
17907
17908 * tests/conflicts.at (Solved SR Conflicts)
17909 (Unresolved SR Conflicts): Adjust.
17910 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
17911 * tests/conflicts.at (S/R in initial): New.
17912
b4c4ccc2
AD
179132002-04-07 Akim Demaille <akim@epita.fr>
17914
17915 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
17916 the RHS of the rules.
17917 * src/output.c (output_gram): Likewise.
17918
bba97eb2
AD
179192002-04-07 Akim Demaille <akim@epita.fr>
17920
17921 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
17922 bucket.
17923 Adjust all dependencies.
17924 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
17925 `number' of the buckets too.
17926 * src/gram.h: Include `symtab.h'.
17927 (associativity): Move to...
17928 * src/symtab.h: here.
17929 No longer include `gram.h'.
17930
c3b407f4
AD
179312002-04-07 Akim Demaille <akim@epita.fr>
17932
17933 * src/gram.h, src/gram.c (rules_rhs_length): New.
17934 (ritem_longest_rhs): Use it.
17935 * src/gram.h (rule_t): `number' is a new member.
17936 * src/reader.c (packgram): Set it.
17937 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
17938 the end of `rules', and count them out of `nrules'.
17939 (reduce_output, dump_grammar): Adjust.
17940 * src/print.c (print_grammar): It is no longer needed to check for
17941 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
17942 * tests/reduce.at (Reduced Automaton): New test.
17943
11652ab3
AD
179442002-04-07 Akim Demaille <akim@epita.fr>
17945
17946 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
17947 lacking `+ 1' to nrules, Bison reported as useless a token if it
17948 was used solely to set the precedence of the last rule...
17949
26b23c1a
AD
179502002-04-07 Akim Demaille <akim@epita.fr>
17951
17952 * data/bison.c++, data/bison.simple: Don't output the current file
17953 name in #line, to avoid useless diffs between two identical
17954 outputs under different names.
17955
18bcecb0
AD
179562002-04-07 Akim Demaille <akim@epita.fr>
17957
17958 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
17959 Normalize loops to using `< nrules + 1', not `<= nrules'.
17960
fa770c86
AD
179612002-04-07 Akim Demaille <akim@epita.fr>
17962
17963 * TODO: Update.
17964
d9b739c3
AD
179652002-04-07 Akim Demaille <akim@epita.fr>
17966
17967 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
17968 bucket.value as bucket.number.
17969
99013900
AD
179702002-04-07 Akim Demaille <akim@epita.fr>
17971
17972 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
17973 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17974 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
17975 RHS, instead of being an index in RITEMS.
17976
e966383b
PE
179772002-04-04 Paul Eggert <eggert@twinsun.com>
17978
17979 * doc/bison.texinfo: Update copyright date.
17980 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
17981 (Symbols): Warn about running Bison in one character set,
17982 but compiling and/or running in an incompatible one.
17983 Warn about character code 256, too.
17984
179852002-04-03 Paul Eggert <eggert@twinsun.com>
17986
17987 * src/bison.data (YYSTACK_ALLOC): Depend on whether
17988 YYERROR_VERBOSE is nonzero, not whether it is defined.
17989
17990 Merge changes from bison-1_29-branch.
c307773e 17991
8d6c48b9
PE
179922002-03-20 Paul Eggert <eggert@twinsun.com>
17993
17994 Merge fixes from Debian bison_1.34-1.diff.
17995
17996 * configure.in (AC_PREREQ): 2.53.
17997
e53c6322
AD
179982002-03-20 Akim Demaille <akim@epita.fr>
17999
18000 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18001
9ffbeca7
PE
180022002-03-19 Paul Eggert <eggert@twinsun.com>
18003
21db0b2a
PE
18004 * src/bison.simple (YYCOPY): New macro.
18005 (YYSTACK_RELOCATE): Use it.
18006 Remove Type arg; no longer needed. All callers changed.
18007 (yymemcpy): Remove; no longer needed.
18008
9ffbeca7
PE
18009 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18010 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18011
642cb8f8
AD
180122002-03-19 Akim Demaille <akim@epita.fr>
18013
18014 Test and fix the #line outputs.
18015
18016 * tests/atlocal.at (GCC): New.
18017 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 18018 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
18019 (Action synch line, Epilogue synch line): New tests.
18020 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18021 * data/bison.simple, data/bison.c++: Use it.
18022
3c31a486
AD
180232002-03-19 Akim Demaille <akim@epita.fr>
18024
18025 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18026 (Solved SR Conflicts, %expect not enough, %expect right)
18027 (%expect too much): Move to...
18028 * tests/conflicts.at: this new file.
18029
0d8bed56
AD
180302002-03-19 Akim Demaille <akim@epita.fr>
18031
18032 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18033 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18034 that we can move to enums for instance.
18035 * src/output.c (token_definitions_output): Output a list of
18036 `token-name, token-number' instead of the #define.
18037 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18038
9208d17f
AD
180392002-03-14 Akim Demaille <akim@epita.fr>
18040
18041 Use Gettext 0.11.1.
18042
af27eacb
RA
180432002-03-09 Robert Anisko <robert@lrde.epita.fr>
18044
18045 * data/bison.c++: Make the user able to add members to the generated
18046 parser by subclassing.
18047
9101a310
RA
180482002-03-05 Robert Anisko <robert@lrde.epita.fr>
18049
18050 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18051 a character.
18052 Reported by Nicolas Tisserand and Nicolas Burrus.
18053
fff9bf0b
RA
180542002-03-04 Robert Anisko <robert@lrde.epita.fr>
18055
18056 * src/reader.c: Warn about lacking semi-colons, do not complain.
18057
64dba31e
RA
180582002-03-04 Robert Anisko <robert@lrde.epita.fr>
18059
18060 * data/bison.c++: Remove a debug line.
18061
374f5a14
RA
180622002-03-04 Robert Anisko <robert@lrde.epita.fr>
18063
18064 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18065 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18066 provide a default implementation.
18067
bfcf1f3a
AD
180682002-03-04 Akim Demaille <akim@epita.fr>
18069
18070 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18071 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18072 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18073 * tests/semantic.at (Parsing Guards): Similarly.
18074 * src/reader.at (readgram): Complain if the last rule is not ended
18075 with a semi-colon.
18076
65ccf9fc
AD
180772002-03-04 Akim Demaille <akim@epita.fr>
18078
18079 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18080 * src/closure.c: here.
18081 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18082 RTC.
18083 * src/warshall.h, src/warshall.c: Remove.
18084 * tests/sets.at (Broken Closure): Adjust.
18085
d0039cbc
AD
180862002-03-04 Akim Demaille <akim@epita.fr>
18087
18088 * src/output.c (output_skeleton): tempdir is const.
18089 bytes_read is unused.
18090
345cea78
AD
180912002-03-04 Akim Demaille <akim@epita.fr>
18092
18093 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18094 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18095 Update.
18096 From Michael Hayes.
18097
564801f7
AD
180982002-03-04 Akim Demaille <akim@epita.fr>
18099
18100 * src/closure.c (closure): `r' is unused.
18101
e5352bc7
AD
181022002-03-04 Akim Demaille <akim@epita.fr>
18103
18104 * tests/sets.at (Broken Closure): Add the ending `;'.
18105 * src/reader.at (readgram): Complain if a rule is not ended with a
18106 semi-colon.
18107
914feea9
AD
181082002-03-04 Akim Demaille <akim@epita.fr>
18109
18110 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18111 (count_sr_conflicts): Use bitset_count.
18112 * src/reduce.c (inaccessable_symbols): Ditto.
18113 (bits_size): Remove.
18114 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18115
f0250de6
AD
181162002-03-04 Akim Demaille <akim@epita.fr>
18117
18118 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18119 * src/reduce.c: Remove the `bitset_zero's following the
18120 `bitset_create's, as now it is performed by the latter.
18121
ef017502
AD
181222002-03-04 Akim Demaille <akim@epita.fr>
18123
18124 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18125 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18126 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18127 latest sources from Michael.
18128
76514394
AD
181292002-03-04 Akim Demaille <akim@epita.fr>
18130
18131 * src/output.c (output): Don't free the grammar.
18132 * src/reader.c (grammar_free): New.
18133 * src/main.c (main): Call it and don't free symtab here.
18134
55024580
AD
181352002-03-04 Akim Demaille <akim@epita.fr>
18136
18137 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18138 before returning.
18139 Reported by Benoit Perrot.
18140
f9abaa2c
AD
181412002-03-04 Akim Demaille <akim@epita.fr>
18142
18143 Use bitset operations when possible, not loops over bits.
18144
18145 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18146 bitset_or.
18147 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18148 * src/reduce.c (useless_nonterminals): Formatting changes.
18149 * src/warshall.c (TC): Use bitset_or.
18150
0e721e75
AD
181512002-03-04 Akim Demaille <akim@epita.fr>
18152
18153 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18154 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18155 Ditto.
18156
0fb1ffb1
AD
181572002-03-04 Akim Demaille <akim@epita.fr>
18158
18159 * src/lalr.c (F): Now a bitset*.
18160 Adjust all dependencies.
18161
b86796bf
AD
181622002-03-04 Akim Demaille <akim@epita.fr>
18163
18164 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18165 Adjust all dependencies.
18166
602bbf31
AD
181672002-03-04 Akim Demaille <akim@epita.fr>
18168
18169 * src/L0.c, src/LR0.h (nstates): Be size_t.
18170 Adjust comparisons (signed vs unsigned).
18171 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18172 bitset*.
18173 Adjust all dependencies.
18174
d8a0245c
AD
181752002-03-04 Akim Demaille <akim@epita.fr>
18176
18177 * src/closure.c (firsts): Now, also a bitset.
18178 Adjust all dependencies.
18179 (varsetsize): Remove, now unused.
18180 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18181
34ba9743
AD
181822002-03-04 Akim Demaille <akim@epita.fr>
18183
18184 * src/print.c: Convert to use bitset.h, not hand coded iterations
18185 over ints.
18186
ed86e78c
AD
181872002-03-04 Akim Demaille <akim@epita.fr>
18188
18189 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18190
dfdb1797
AD
181912002-03-04 Akim Demaille <akim@epita.fr>
18192
18193 * src/closure.c (ruleset): Be a bitset.
18194 (rulesetsize): Remove.
18195
7086e707
AD
181962002-03-04 Akim Demaille <akim@epita.fr>
18197
18198 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18199 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18200 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18201 * src/closure.c (fderives): Be an array of bitsets.
18202
98254360
RA
182032002-02-28 Robert Anisko <robert@lrde.epita.fr>
18204
18205 * data/bison.c++: Merge the two generated headers. Insert a copyright
18206 notice in each output file.
18207
a75c057f
AD
182082002-02-28 Akim Demaille <akim@epita.fr>
18209
18210 * data/bison.c++: Copy the prologue of bison.simple to fetch
18211 useful M4 definitions, such as b4_header_guard.
18212
06b00abc
AD
182132002-02-25 Akim Demaille <akim@epita.fr>
18214
18215 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18216 translator friendly scheme for the bgr
18217 copyright notice.
06b00abc 18218
70e7d534
AD
182192002-02-25 Akim Demaille <akim@epita.fr>
18220
18221 * src/output.c (header_output): Remove, now handled completely via
18222 M4.
18223
abe017f6
AD
182242002-02-25 Akim Demaille <akim@epita.fr>
18225
18226 * m4/m4.m4: New, from CVS Autoconf.
18227 * configure.in: Invoke it.
18228 * src/output.c (output_skeleton): Use its result instead of the
18229 hard coded name.
18230
381fb12e
AD
182312002-02-25 Akim Demaille <akim@epita.fr>
18232
18233 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18234 Fileutils 4.1.5.
18235 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18236 * src/output.c (output_skeleton): Use mkstemp to create a real
18237 temporary file.
18238 Move the filling of `skeleton' and its muscle to...
18239 (prepare): here.
18240 (output): Move the definition of the prologue muscle to...
18241 (prepare): here.
18242 * src/system.h (DEFAULT_TMPDIR): New.
18243
6f38107f
PE
182442002-02-14 Paul Eggert <eggert@twinsun.com>
18245
18246 Remove the support for C++ namespace cleanliness; it was
18247 causing more problems than it was curing, since it didn't work
18248 properly on some nonstandard C++ compilers. This can wait
18249 for a proper C++ parser.
18250
18251 * NEWS: Document this.
18252 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18253 of C++, as it's treated like C now.
18254 * src/bison.simple (YYSTD): Remove.
18255 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18256 Treat C++ just like Standard C instead of trying to support
18257 namespace cleanliness.
18258
80cce3da
AD
182592002-02-14 Akim Demaille <akim@epita.fr>
18260
18261 * tests/regression.at (else): Adjust to Andreas' change.
18262
842e8679
AD
182632002-02-14 Akim Demaille <akim@epita.fr>
18264
18265 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18266
4bda3f10
AD
182672002-02-13 Andreas Schwab <schwab@suse.de>
18268
18269 * src/output.c (output_rule_data): Don't output NULL, it might
18270 not be defined yet.
18271
4162fa07 182722002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18273
4162fa07
RA
18274 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18275 (Copyright notice): Update.
b418ecd8 18276
bd16a5dc
AD
182772002-02-11 Akim Demaille <akim@epita.fr>
18278
18279 * tests/regression.at (%nonassoc and eof): Don't include
18280 nonportable headers.
18281
8d69a1a3
RA
182822002-02-08 Robert Anisko <robert@lrde.epita.fr>
18283
18284 * data/bison.c++: Correct error recovery. Make the user able to
18285 initialize the starting location.
18286
9b2d0677
AD
182872002-02-07 Akim Demaille <akim@epita.fr>
18288
18289 * tests/input.at: New.
18290
69e2658b
RA
182912002-02-07 Robert Anisko <robert@lrde.epita.fr>
18292
18293 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18294 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18295 directives around tables only needed for debugging.
18296
4aacc3a7
RA
182972002-02-07 Robert Anisko <robert@lrde.epita.fr>
18298
18299 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18300 C++ parsers.
18301 (yy::b4_name::parse): Use print_.
18302
762a801e
RA
183032002-02-07 Robert Anisko <robert@lrde.epita.fr>
18304
18305 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18306
4bb2bc3f
RA
183072002-02-07 Robert Anisko <robert@lrde.epita.fr>
18308
18309 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18310 C++ parsers.
18311 (yy::b4_name::parse): Build verbose error messages, and use error_.
18312
6b45a3ca
RA
183132002-02-06 Robert Anisko <robert@lrde.epita.fr>
18314
18315 * data/bison.c++: Fix m4 quoting in comments.
18316
50997c6e
RA
183172002-02-06 Robert Anisko <robert@lrde.epita.fr>
18318
18319 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18320 not expanded by m4.
18321
3f3eed27
AD
183222002-02-05 Akim Demaille <akim@epita.fr>
18323
18324 * data/bison.c++: Adjust to the M4 back end.
18325 More is certainly needed.
18326
be2a1a68
AD
183272002-02-05 Akim Demaille <akim@epita.fr>
18328
18329 Give a try to M4 as a back end.
18330
18331 * lib/readpipe.c: New, from wdiff.
18332 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18333 BISON_HAIRY.
18334 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18335 specific values. Now it is m4 that performs the lookup.
18336 * src/parse-skel.y: Remove.
18337 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18338 * src/output.c (actions_output, guards_output)
18339 (token_definitions_output): No longer keeps track of the output
18340 line number, hence remove the second argument.
18341 (guards_output): Check against the guard member of a rule, not the
18342 action member.
18343 Adjust callers.
18344 (output_skeleton): Don't look for the skeleton location, let m4 do
18345 that.
18346 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18347 file will be used.
18348 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18349 (prepare): Given that for the time being changesyntax is not
18350 usable in M4, rename the muscles using `-' to `_'.
18351 Define `defines_flag', `output_parser_name' and `output_header_name'.
18352 * src/output.h (actions_output, guards_output)
18353 (token_definitions_output): Adjust prototypes.
18354 * src/scan-skel.l: Instead of scanning the skeletons, it now
18355 processes the output of m4: `__oline__' and `#output'.
18356 * data/bison.simple: Adjust to be used by M4(sugar).
18357 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18358 to date.
18359 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18360 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18361 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18362 shamelessly stolen from CVS Autoconf.
18363
beda758b
AD
183642002-02-05 Akim Demaille <akim@epita.fr>
18365
18366 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18367 * configure.in: Check for the declarations of free and malloc.
18368 * src/muscle_tab.c: Adjust.
18369
5ece6d43
AD
183702002-02-05 Akim Demaille <akim@epita.fr>
18371
18372 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18373 which have no values.
18374
5bb18f9a
AD
183752002-02-05 Akim Demaille <akim@epita.fr>
18376
18377 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18378 * data/: here.
18379
894dd62e
PE
183802002-01-29 Paul Eggert <eggert@twinsun.com>
18381
18382 * src/bison.simple (YYSIZE_T): Do not define merely because
18383 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18384 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18385
82841af7
AD
183862002-01-27 Akim Demaille <akim@epita.fr>
18387
18388 Fix `%nonassoc and eof'.
18389
18390 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18391 which were not properly copied! Replace
18392 memcpy (res->errs, src->errs, src->nerrs);
18393 with
18394 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18395 !!!
18396 * tests/regression.at (%nonassoc and eof): Adjust to newest
18397 Autotest: `.' is not in the PATH.
18398
318b76e9
AD
183992002-01-27 Akim Demaille <akim@epita.fr>
18400
18401 * tests/sets.at (AT_EXTRACT_SETS): New.
18402 (Nullable): Use it.
18403 (Firsts): New.
18404
30d2f3d5
AD
184052002-01-26 Akim Demaille <akim@epita.fr>
18406
18407 * tests/actions.at, tests/calc.at, tests/headers.at,
18408 * tests/torture.at: Adjust to the newest Autotest which no longer
18409 forces `.' in the PATH.
18410
30f8c395
AD
184112002-01-25 Akim Demaille <akim@epita.fr>
18412
18413 * tests/regression.at (%nonassoc and eof): New.
18414 Suggested by Robert Anisko.
18415
29ae55f1
AD
184162002-01-24 Akim Demaille <akim@epita.fr>
18417
18418 Bison dumps core when trying to complain about broken input files.
18419 Reported by Cris van Pelt.
18420
18421 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18422 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18423 into...
18424 (Invalid inputs): Strengthen: exercise parse_percent_token.
18425
2b548aa6
RA
184262002-01-24 Robert Anisko <robert.anisko@epita.fr>
18427
18428 * src/Makefile.am: Add bison.c++.
18429 * src/bison.c++: New skeleton.
18430
bb0146c2
AD
184312002-01-21 Paolo Bonzini <bonzini@gnu.org>
18432
18433 * po/it.po: New.
18434
bec30531
AD
184352002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18436
18437 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18438
fc6edc45
MA
184392002-01-20 Marc Autret <marc@gnu.org>
18440
18441 * src/files.c (compute_output_file_names): Fix
18442
5e5d5415
MA
184432002-01-20 Marc Autret <marc@gnu.org>
18444
18445 * tests/output.at: New test.
18446 * src/files.c (compute_base_names): Don't map extensions when
18447 the YACC flag is set, use defaults.
18448 Reported by Evgeny Stambulchik.
18449
44ea3fbd
MA
184502002-01-20 Marc Autret <marc@gnu.org>
18451
ba0fe3c7
PE
18452 * src/system.h: Need to define __attribute__ away for non-GCC
18453 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
18454 Suggested by Albert Chin-A-Young.
18455
338963d1
TVH
184562002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18457
18458 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18459 canonical definition.
18460 * src/system.h: Use the canonical definition for PARAMS (avoids
18461 a conflict with the macro from lib/hash.h).
18462
c57b2479
AD
184632002-01-11 Akim Demaille <akim@epita.fr>
18464
18465 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 18466 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 18467
b85810ae
AD
184682002-01-09 Akim Demaille <akim@epita.fr>
18469
18470 * src/files.c, src/files.h (output_infix): New.
18471 (tab_extension): Remove.
18472 (compute_base_names): Compute the former, drop the latter.
18473 * src/output.c (prepare): Insert the muscles `output-infix', and
18474 `output-suffix'.
18475 * src/parse-skel.y (string, string.1): New.
18476 (section.header): Use it.
18477 (section.yacc): Remove.
18478 (prefix): Remove too.
18479 * src/scan-skel.l: Adjust.
18480 * src/bison.simple, src/bison.hairy: Adjust.
18481
cae60122
AD
184822002-01-09 Akim Demaille <akim@epita.fr>
18483
18484 * configure.in (WERROR_CFLAGS): Compute it.
18485 * src/Makefile.am (CFLAGS): Pass it.
18486 * tests/atlocal.in (CFLAGS): Idem.
18487 * src/files.c: Fix a few warnings.
18488 (get_extension_index): Remove, unused.
18489
ae404801
AD
184902002-01-08 Akim Demaille <akim@epita.fr>
18491
18492 * src/getargs.c (AS_FILE_NAME): New.
18493 (getargs): Use it to convert DOSish file names.
18494 * src/files.c (base_name): Rename as full_base_name to avoid
18495 clashes with `base_name ()'.
18496 (filename_split): New.
18497 (compute_base_names): N-th rewrite, using filename_split.
18498
22312b71
AD
184992002-01-08 Akim Demaille <akim@epita.fr>
18500
18501 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18502 New, stolen from the Fileutils 4.1.
18503 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18504 * configure.in: Check for the presence of memrchr, and of its
18505 prototype.
18506
a67cef01
TVH
185072002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18508
18509 * lib/hash.h (__P): Added definition for this macro.
18510 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18511 BUILT_SOURCES, to ensure they are generated first.
18512 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18513 %error-verbose to allow bootstrapping with bison 1.30x.
18514
2b25d624
AD
185152002-01-06 Akim Demaille <akim@epita.fr>
18516
18517 * src/reader.c (parse_braces): Don't fetch the next char, the
18518 convention is to fetch on entry.
18519 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18520 'switch' without a following semicolon.
18521 * tests/regression.at (braces parsing): New.
18522
3460813b
AD
185232002-01-06 Akim Demaille <akim@epita.fr>
18524
18525 Bison is dead wrong in its RR conflict reports.
18526
18527 * tests/torture.at (GNU Cim Grammar): New.
18528 * src/conflicts.c (count_rr_conflicts): Fix.
18529
73784c64
AD
185302002-01-06 Akim Demaille <akim@epita.fr>
18531
18532 Creating package.m4 from configure.ac causes too many problems.
18533
18534 * tests/Makefile.am (package.m4): Create it by hand,
18535 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18536
25d81090
AD
185372002-01-06 Akim Demaille <akim@epita.fr>
18538
18539 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18540 skeleton.h.
18541
a9b8959e
PE
185422002-01-04 Paul Eggert <eggert@twinsun.com>
18543
18544 * doc/bison.texinfo (Debugging):
18545 Remove YYSTDERR; it's no longer defined or used.
18546 Also, s/cstdio.h/cstdio/.
18547
25d81090
AD
185482002-01-03 Akim Demaille <akim@epita.fr>
18549
18550 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18551
1109455c
AD
185522002-01-03 Akim Demaille <akim@epita.fr>
18553
18554 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18555 tracing code to --trace, wait for a better --trace option, with
18556 args.
18557
7ea5e977
AD
185582002-01-03 Akim Demaille <akim@epita.fr>
18559
18560 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18561 The ISO C++ standard is extremely clear about it: stderr is
18562 considered a macro, not a regular symbol (see table 94 `Header
18563 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18564 Therefore std:: does not apply to it. It still does with fprintf.
18565 Also, s/cstdio.h/cstdio/.
18566
fab5b110
AD
185672002-01-03 Akim Demaille <akim@epita.fr>
18568
18569 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18570 for non system headers.
18571
aed7fd9b
AD
185722002-01-02 Akim Demaille <akim@epita.fr>
18573
18574 Equip the skeleton chain with location tracking, runtime trace,
18575 pure parser and scanner.
18576
18577 * src/parse-skel.y: Request a pure parser, locations, and prefix
18578 renaming.
18579 (%union): Having several members with the same type does not help
18580 type mismatches, simplify.
18581 (YYPRINT, yyprint): New.
18582 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18583 (skel_error): this.
18584 Handle locations.
18585 * src/scan-skel.l: Adjust to these changes.
18586 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18587 (LOCATION_PRINT, skel_control_t): New.
18588
24fad99e
AD
185892001-12-30 Akim Demaille <akim@epita.fr>
18590
18591 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18592 replace `gb' with BLANKS.
18593 * src/scan-skel.l: Adjust.
18594
a4b36db4
AD
185952001-12-30 Akim Demaille <akim@epita.fr>
18596
18597 * src/system.h: We don't need nor want bcopy.
18598 Throw away MS-DOS crap: we don't need getpid.
18599 * configure.in: We don't need strndup. It was even causing
18600 problems: because Flex includes the headers *before* us,
18601 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18602 not visible.
18603 * lib/xstrndup.c: New.
18604 * src/scan-skel.l: Use it.
18605 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18606 * src/parse-skel.y: Use %directives instead of #defines.
18607
1239777d
AD
186082001-12-30 Akim Demaille <akim@epita.fr>
18609
18610 * src/skeleton.h: New.
18611 * src/output.c (output_parser, output_master_parser): Remove, dead
18612 code.
18613 * src/output.h (get_lines_number, actions_output, guards_output)
18614 (token_definitions_output): Prototype them.
18615 * src/parse-skel.y: Add the license notice.
18616 Include output.h and skeleton.h.
18617 (process_skeleton): Returns void, and takes a single parameter.
18618 * src/scan-skel.l: Add the license notice.
18619 Include skeleton.h.
18620 Don't use %option yylineno: it seems that then Flex imagines
18621 REJECT has been used, and therefore it won't reallocate its
18622 buffers (which makes no other sense to me than a bug). It results
18623 in warnings for `unused: yy_flex_realloc'.
18624
9b3add5b
RA
186252001-12-30 Robert Anisko <robert.anisko@epita.fr>
18626
18627 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18628 (MUSCLE_INSERT_PREFIX): ...to there.
18629 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18630 (MUSCLE_INSERT_PREFIX): Move from here...
18631
18632 * src/bison.hairy: Add a section directive. Put braces around muscle
18633 names. This parser skeleton is still broken, but Bison should not
18634 choke on a bad muscle 'syntax'.
18635 * src/bison.simple: Add a section directive. Put braces around muscle
18636 names.
18637
18638 * src/files.h (strsuffix, stringappend): Add declarations.
18639 (tab_extension): Add declaration.
18640 (short_base_name): Add declaration.
18641
18642 * src/files.c (strsuffix, stringappend): No longer static. These
18643 functions are used in the skeleton parser.
18644 (tab_extension): New.
18645 (compute_base_names): Use the computations done in this function
fab5b110 18646 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
18647 names.
18648 (short_base_name): No longer static.
18649
18650 * src/output.c (output_skeleton): New.
18651 (output): Disable call to output_master_parser, and give a try to
18652 a new skeleton handling system.
18653 (guards_output, actions_output): No longer static.
18654 (token_definitions_output, get_lines_number): No longer static.
18655
18656 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18657
fab5b110 18658 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
18659 parse-skel.y.
18660
18661 * src/parse-skel.y: New file.
18662 * src/scan-skel.l: New file.
18663
b5b61c61
AD
186642001-12-29 Akim Demaille <akim@epita.fr>
18665
18666 %name-prefix is broken.
18667
18668 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18669 Adjust all dependencies.
18670 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18671 %name-prefix.
18672
18673 Renaming yylval but not yylloc is not consistent. Now we do.
18674
18675 * src/bison.simple: Prefix yylloc if used.
18676 * doc/bison.texinfo (Decl Summary): Document that.
18677
8c9a50be
AD
186782001-12-29 Akim Demaille <akim@epita.fr>
18679
18680 * doc/bison.texinfo: Promote `%long-directive' over
18681 `%long_directive'.
18682 Remove all references to fixed-output-files, yacc is enough.
18683
d99361e6
AD
186842001-12-29 Akim Demaille <akim@epita.fr>
18685
18686 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18687 user prologue. These are defaults.
18688 * tests/actions.at (Mid-rule actions): Make sure the user can
18689 define YYDEBUG and YYERROR_VERBOSE.
18690
b9cecb91
AD
186912001-12-29 Akim Demaille <akim@epita.fr>
18692
18693 * src/output.c (header_output): Don't forget to export YYLTYPE and
18694 yylloc.
18695 * tests/headers.at (export YYLTYPE): New, make sure it does.
18696 * tests/regression.at (%union and --defines, Invalid CPP headers):
18697 Move to...
18698 * tests/headers.at: here.
18699
aea13e97
AD
187002001-12-29 Akim Demaille <akim@epita.fr>
18701
18702 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18703
931394cb
AD
187042001-12-29 Akim Demaille <akim@epita.fr>
18705
18706 * tests/actions.at (Mid-rule actions): Output on a single line
18707 instead of several.
18708
704a47c4
AD
187092001-12-29 Akim Demaille <akim@epita.fr>
18710
18711 * doc/bison.texinfo: Formatting changes.
18712
091e20bb
AD
187132001-12-29 Akim Demaille <akim@epita.fr>
18714
18715 Don't store the token defs in a muscle, just be ready to output it
18716 on command. Now possible via `symbols'. Fixes a memory leak.
18717
18718 * src/output.c (token_definitions_output): New.
18719 (output_parser, header_output): Use it.
18720 * src/reader.c (symbols_save): Remove.
18721
cce71710
AD
187222001-12-29 Akim Demaille <akim@epita.fr>
18723
18724 * src/bison.simple: Do not provide a default for YYSTYPE and
18725 YYLTYPE before the user's prologue. Otherwise it's hardly... a
18726 default.
18727
82c035a8
AD
187282001-12-29 Akim Demaille <akim@epita.fr>
18729
18730 Mid-rule actions are simply... ignored!
18731
18732 * src/reader.c (readgram): Be sure to attach mid-rule actions to
18733 the empty-rule associated to the dummy symbol, not to the host
18734 rule.
18735 * tests/actions.at (Mid-rule actions): New.
18736
8419d367
AD
187372001-12-29 Akim Demaille <akim@epita.fr>
18738
18739 Memory leak.
18740
18741 * src/reader.c (reader): Free grammar.
18742
375d5806
AD
187432001-12-29 Akim Demaille <akim@epita.fr>
18744
18745 Memory leak.
18746
18747 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
18748 since it allocates it for each state, although only one is needed.
18749 (allocate_storage): Do it here.
18750
f51cb8ff
AD
187512001-12-29 Akim Demaille <akim@epita.fr>
18752
18753 * src/options.h, src/options.c (create_long_option_table): Rename
18754 as...
18755 (long_option_table_new): this, with a clearer prototype.
18756 (percent_table): Remove, unused,
18757 * src/getargs.c (getargs): Adjust.
18758
29e88316
AD
187592001-12-29 Akim Demaille <akim@epita.fr>
18760
18761 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
18762 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
18763 as states.
18764
b9f71f19
AD
187652001-12-29 Akim Demaille <akim@epita.fr>
18766
18767 * src/lalr.c (build_relations): Rename `states' as `states1'.
18768 Sorry, I don't understand exactly what it is, no better name...
18769
1a2b5d37
AD
187702001-12-29 Akim Demaille <akim@epita.fr>
18771
18772 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
18773 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
18774 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
18775 as rules.
18776
1cca533e
AD
187772001-12-29 Akim Demaille <akim@epita.fr>
18778
18779 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
18780 ago.
18781
c03ae966
AD
187822001-12-29 Akim Demaille <akim@epita.fr>
18783
18784 * src/reader.c, src/reader.h (user_toknums): Remove.
18785 Adjust all users to use symbols[i]->user_token_number.
18786
5a670b1e
AD
187872001-12-29 Akim Demaille <akim@epita.fr>
18788
18789 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
18790 Adjust all users to use symbols[i]->prec or ->assoc.
18791
ad949da9
AD
187922001-12-29 Akim Demaille <akim@epita.fr>
18793
18794 * src/reader.c, src/reader.h (tags): Remove.
18795 Adjust all users to use symbols[i]->tag.
18796
0e78e603
AD
187972001-12-29 Akim Demaille <akim@epita.fr>
18798
18799 * src/gram.h, src/gram.c (symbols): New, similar to state_table
18800 and rule_table.
18801 * src/reader.c (packsymbols): Fill this table.
18802 Drop sprec.
18803 * src/conflicts.c (resolve_sr_conflict): Adjust.
18804 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
18805 single table.
18806 Use symbols[i]->tag instead of tags[i].
18807
213e640e
AD
188082001-12-29 Akim Demaille <akim@epita.fr>
18809
18810 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
18811 In addition, put a comment in there, to replace...
18812 * tests/regression.at (%union and C comments): Remove.
18813
e7b8bef1
AD
188142001-12-29 Akim Demaille <akim@epita.fr>
18815
18816 * tests/regression.at (Web2c Actions): Blindly move the actual
18817 output as expected output. The contents *seem* right to me, but I
18818 can't pretend reading perfectly parser tables... Nonetheless, all
18819 the other tests pass correctly, the table look OK, even though the
18820 presence of `$axiom' is to be noted: AFAICS it is useless (but
18821 harmless).
18822
b68e7744
AD
188232001-12-29 Akim Demaille <akim@epita.fr>
18824
18825 * src/reader.c (readgram): Don't add the rule 0 if there were no
18826 rules read. In other words, add it _after_ having performed
18827 grammar sanity checks.
18828 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
18829
78d5bae9
AD
188302001-12-29 Akim Demaille <akim@epita.fr>
18831
18832 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
18833 visible, and some states have now a different number.
18834
ff442794
AD
188352001-12-29 Akim Demaille <akim@epita.fr>
18836
18837 * src/reader.c (readgram): Bind the initial rule's lineno to that
18838 of the first rule.
18839 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
18840 (Solved SR Conflicts): Adjust rule 0's line number.
18841
610ab194
AD
188422001-12-29 Akim Demaille <akim@epita.fr>
18843
18844 Fix the `GAWK Grammar' failure.
18845
18846 * src/LR0.c (final_state): Initialize to -1 so that we do compute
18847 the reductions of the first state which was mistakenly confused
18848 with the final state because precisely final_state was initialized
18849 to 0.
18850 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
18851 now noticed by Bison.
18852 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
18853 have a reduction on $default.
18854
29d29c8f
AD
188552001-12-29 Akim Demaille <akim@epita.fr>
18856
18857 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
18858 rule line numbers.
18859 * src/closure.c (print_closure): Likewise.
18860 * src/derives.c (print_derives): Likewise.
18861 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
18862 now.
18863
7c6b64d0
AD
188642001-12-29 Akim Demaille <akim@epita.fr>
18865
18866 * src/lalr.c (lookaheads_print): New.
18867 (lalr): Call it when --trace-flag.
18868 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
18869 are dumped.
18870
3d4daee3
AD
188712001-12-29 Akim Demaille <akim@epita.fr>
18872
18873 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
18874 when walking through ritem, even via rule->rhs.
18875 * src/reduce.c (dump_grammar, useful_production, reduce_output)
18876 (useful_production, useless_nonterminals): Likewise.
18877 (reduce_grammar_tables): Likewise, plus update nritems.
18878 * src/nullable.c (set_nullable): Likewise.
18879 * src/lalr.c (build_relations): Likewise.
18880 * tests/sets.at (Nullable): Adjust.
18881 Fortunately, now, the $axiom is no longer nullable.
18882
9e7f6bbd
AD
188832001-12-29 Akim Demaille <akim@epita.fr>
18884
18885 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
18886 the 0-sentinel.
18887 * src/gram.c (ritem_longest_rhs): Likewise.
18888 * src/reduce.c (nonterminals_reduce): Likewise.
18889 * src/print_graph.c (print_graph): Likewise.
18890 * src/output.c (output_rule_data): Likewise.
18891 * src/nullable.c (set_nullable): Likewise.
18892
255ef638
AD
188932001-12-29 Akim Demaille <akim@epita.fr>
18894
18895 * src/output.c: Comment changes.
18896
0d8a7363
AD
188972001-12-27 Paul Eggert <eggert@twinsun.com>
18898
18899 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
18900 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
18901 Sparc, as they were causing more porting problems than the
18902 (minor) performance improvement was worth.
18903
18904 Also, catch up with 1.31's YYSTD.
18905
3db472b9
AD
189062001-12-27 Akim Demaille <akim@epita.fr>
18907
18908 * src/output.c (output_gram): Rely on nritems, not the
18909 0-sentinel. See below.
18910 Use -1 as separator, not 0.
18911 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
18912 Rely on -1 as separator in yyrhs, instead of 0.
18913 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
18914 twice `Now at end of input', therefore there are two lines less to
18915 expect.
18916
b365aa05
AD
189172001-12-27 Akim Demaille <akim@epita.fr>
18918
18919 * tests/regression.at (Unresolved SR Conflicts):
18920 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
18921 below.
18922
30171f79
AD
189232001-12-27 Akim Demaille <akim@epita.fr>
18924
18925 * src/LR0.c (new_state): Recognize the final state by the fact it
18926 is reached by eoftoken.
18927 (insert_start_shifting_state, insert_eof_shifting_state)
18928 (insert_accepting_state, augment_automaton): Remove, since now
18929 these states are automatically computed from the initial state.
18930 (generate_states): Adjust.
18931 * src/print.c: When reporting a rule number to the user, substract
18932 1, so that the axiom rule is rule 0, and the first user rule is 1.
18933 * src/reduce.c: Likewise.
18934 * src/print_graph.c (print_core): For the time being, just as for
18935 the report, depend upon --trace-flags to dump the full set of
18936 items.
18937 * src/reader.c (readgram): Once the grammar read, insert the rule
18938 0: `$axiom: START-SYMBOL $'.
18939 * tests/set.at: Adjust: rule 0 is now displayed, and since the
18940 number of the states has changed (the final state is no longer
18941 necessarily the last), catch up.
18942
75142d45
AD
189432001-12-27 Akim Demaille <akim@epita.fr>
18944
18945 Try to make the use of the eoftoken valid. Given that its value
18946 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
18947 is used instead of > 0 where appropriate, (ii), depend upon nritems
18948 instead of the 0-sentinel.
18949
18950 * src/gram.h, src/gram.c (nritems): New.
18951 Expected to be duplication of nitems, but for the time being...
18952 * src/reader.c (packgram): Assert nritems and nitems are equal.
18953 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
18954 * src/closure.c (print_closure, print_fderives): Likewise.
18955 * src/gram.c (ritem_print): Likewise.
18956 * src/print.c (print_core, print_grammar): Likewise.
18957 * src/print_graph.c: Likewise.
18958
b7c49edf
AD
189592001-12-27 Akim Demaille <akim@epita.fr>
18960
18961 * src/main.c (main): If there are complains after grammar
18962 reductions, then output the report anyway if requested, then die.
18963 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
18964 * src/reader.c (eoftoken): New.
18965 (parse_token_decl): If the token being defined has value `0', it
18966 is the eoftoken.
18967 (packsymbols): No longer hack `tags' to insert `$' by hand.
18968 Be sure to preserve the value of the eoftoken.
18969 (reader): Make sure eoftoken is defined.
18970 Initialize nsyms to 0: now eoftoken is created just like the others.
18971 * src/print.c (print_grammar): Don't special case the eof token.
18972 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
18973 lie anyway, albeit pleasant.
18974 * tests/calc.at: Exercise error messages with eoftoken.
18975 Change the grammar so that empty input is invalid.
18976 Adjust expectations.
18977 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
18978
ec2da99f
AD
189792001-12-27 Akim Demaille <akim@epita.fr>
18980
18981 * configure.in: Check the protos of strchr ans strspn.
18982 Replace strchr if needed.
18983 * src/system.h: Provide the protos of strchr, strspn and memchr if
18984 missing.
18985 * lib/strchr.c: New.
18986 * src/reader.c (symbols_save): Use strchr.
18987
8adfa272
AD
189882001-12-27 Akim Demaille <akim@epita.fr>
18989
18990 * src/print.c, src/print_graph.c (escape): New.
18991 Use it to quote the TAGS outputs.
18992 * src/print_graph.c (print_state): Now errors are in red, and
18993 reductions in green.
18994 Prefer high to wide: output the state number on a line of its own.
18995
80dac38c
AD
189962001-12-27 Akim Demaille <akim@epita.fr>
18997
18998 * src/state.h, src/state.c (reductions_new): New.
18999 * src/LR0.c (set_state_table): Let all the states have a
19000 `reductions', even if reduced to 0.
19001 (save_reductions): Adjust.
19002 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19003 * src/print.c (print_reductions, print_actions): Adjust.
19004 * src/output.c (action_row): Adjust.
19005
2cec70b9
AD
190062001-12-27 Akim Demaille <akim@epita.fr>
19007
19008 * src/state.h, src/state.c (errs_new, errs_dup): New.
19009 * src/LR0.c (set_state_table): Let all the states have an errs,
19010 even if reduced to 0.
19011 * src/print.c (print_errs, print_reductions): Adjust.
19012 * src/output.c (output_actions, action_row): Adjust.
19013 * src/conflicts.c (resolve_sr_conflict): Adjust.
19014
13ca549a
AD
190152001-12-27 Akim Demaille <akim@epita.fr>
19016
19017 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19018
5092aba5
AD
190192001-12-27 Akim Demaille <akim@epita.fr>
19020
19021 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19022 * src/print.c: here.
19023 (lookaheadset, shiftset): New, used as additional storage by
19024 print_reductions.
19025 (print_results): Adjust.
19026 (print_shifts, print_gotos, print_errs): New, extracted from...
19027 (print_actions): here.
19028 * src/print_graph.c (print_actions): Remove dead code.
19029
11e2beca
AD
190302001-12-27 Akim Demaille <akim@epita.fr>
19031
19032 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19033 `$n' and `@n'.
19034
dac3c910
AD
190352001-12-27 Akim Demaille <akim@epita.fr>
19036
19037 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19038 (build_relations): Adjust.
19039
d0b0fefa
AD
190402001-12-27 Akim Demaille <akim@epita.fr>
19041
19042 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19043 duplication.
19044
adc8c848
AD
190452001-12-27 Akim Demaille <akim@epita.fr>
19046
19047 * src/reader.c (packgram): Catch nitems overflows.
19048
14d293ac
AD
190492001-12-27 Akim Demaille <akim@epita.fr>
19050
19051 * src/files.c, src/files.h (guard_obstack): Remove.
19052 * src/output.c (output): Adjust.
19053 * src/reader.c (parse_braces): New, factoring...
19054 (copy_action, copy_guard): these two which are renamed as...
19055 (parse_action, parse_guard): these.
19056 As a voluntary consequence, using braces around guards is now
19057 mandatory.
19058
f499b062
AD
190592001-12-27 Akim Demaille <akim@epita.fr>
19060
19061 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19062 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19063 members.
19064 (symbol_list_new): Adjust.
19065 (copy_action): action_line is the first line, not the last.
19066 (copy_guard): Just as for actions, store the `action' only, not
19067 the switch/case/break flesh.
19068 Don't parse the user action that might follow the guard, let...
19069 (readgram): do it, i.e., now, there can be an action after a
19070 guard.
19071 In other words the guard is just explicitly optional.
19072 (packgram): Adjust.
19073 * src/output.c (guards_output): New.
19074 (output_parser): Call it when needed.
19075 (output): Also free the guard and attrs obstacks.
19076 * src/files.c, src/files.h (obstack_save): Remove.
19077 (output_files): Remove.
19078 As a result, if one needs the former `.act' file, using an
19079 appropriate skeleton which requires actions and guards is now
19080 required.
19081 * src/main.c (main): Adjust.
19082 * tests/semantic.at: New.
19083 * tests/regression.at: Use `input.y' as input file name.
19084 Avoid 8+3 problems by requiring input.c when the test needs the
19085 parser.
19086
d945f5cd
AD
190872001-12-27 Akim Demaille <akim@epita.fr>
19088
19089 * src/reader.c (symbol_list_new): Be sure to initialize all the
19090 fields.
19091
d200e455
AD
190922001-12-27 Akim Demaille <akim@epita.fr>
19093
19094 All the hacks using a final pseudo state are now useless.
19095
19096 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19097 * src/lalr.c (nLA): New.
19098 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19099 instead of lookaheadsp from the pseudo state (nstate + 1).
19100
f9507c28
AD
191012001-12-27 Akim Demaille <akim@epita.fr>
19102
19103 * src/output.c (action_row, token_actions): Use a state_t instead
19104 of a integer, and nlookaheads instead of the following state's
19105 lookaheadsp.
19106
065fbd27
AD
191072001-12-27 Akim Demaille <akim@epita.fr>
19108
19109 * src/conflicts.c (log_resolution, flush_shift)
19110 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19111 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19112 (conflicts_print, print_reductions): Use a state_t instead of an
19113 integer when referring to a state.
19114 As much as possible, depend upon nlookaheads, instead of the
19115 `lookaheadsp' member of the following state (since lookaheads of
19116 successive states are successive, the difference between state n + 1
19117 and n served as the number of lookaheads for state n).
19118 * src/lalr.c (add_lookback_edge): Likewise.
19119 * src/print.c (print_core, print_actions, print_state)
19120 (print_results): Likewise.
19121 * src/print_graph.c (print_core, print_actions, print_state)
19122 (print_graph): Likewise.
19123 * src/conflicts.h: Adjust.
19124
1b177bd7
AD
191252001-12-27 Akim Demaille <akim@epita.fr>
19126
19127 * src/bison.hairy: Formatting/comment changes.
19128 ANSIfy.
19129 Remove `register' indications.
19130 Add plenty of `static'.
19131
7742ddeb
AD
191322001-12-27 Akim Demaille <akim@epita.fr>
19133
19134 * src/output.c (prepare): Drop the muscle `ntbase' which
19135 duplicates ntokens.
19136 * src/bison.simple: Formatting/comment changes.
19137 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19138 is an undocumented synonym.
19139
1fa14068
AD
191402001-12-22 Akim Demaille <akim@epita.fr>
19141
19142 * src/output.c (output_table_data): Change the prototype to use
19143 `int' for array ranges: some invocations do pass an int, not a
19144 short.
19145 Reported by Wayne Green.
19146
b9752825
AD
191472001-12-22 Akim Demaille <akim@epita.fr>
19148
19149 Some actions of web2c.y are improperly triggered.
19150 Reported by Mike Castle.
19151
19152 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19153 * tests/regression.at (Web2c): Rename as...
19154 (Web2c Report): this.
19155 (Web2c Actions): New.
19156
776209d6
AD
191572001-12-22 Akim Demaille <akim@epita.fr>
19158
19159 Reductions in web2c.y are improperly reported.
19160 Reported by Mike Castle.
19161
19162 * src/conflicts.c (print_reductions): Fix.
19163 * tests/regression.at (Web2c): New.
19164
275fc3ad
AD
191652001-12-18 Akim Demaille <akim@epita.fr>
19166
19167 Some host fail on `assert (!"foo")', which expands to
19168 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19169 Reported by Nelson Beebee.
19170
19171 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19172 `#define it_succeeded 0' and `assert (it_succeeded)'.
19173
897668ee
MA
191742001-12-17 Marc Autret <autret_m@epita.fr>
19175
19176 * src/bison.simple: Don't hard code the skeleton line and filename.
19177 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19178 New line counter 'skeleton_line' (skeleton-line muscle).
19179
ab3399e0
PE
191802001-12-17 Paul Eggert <eggert@twinsun.com>
19181
19182 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19183 YYDEBUG must be defined to a nonzero value.
19184
19185 * src/bison.simple (yytname): Do not assume that the user defines
19186 YYDEBUG to a properly parenthesized expression.
19187
3877f72b
AD
191882001-12-17 Akim Demaille <akim@epita.fr>
19189
19190 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19191 nlookaheads is a new member.
19192 Adjust all users.
19193 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19194 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19195 state.
776209d6 19196
331dbc1b
AD
191972001-12-17 Akim Demaille <akim@epita.fr>
19198
19199 * src/files.h, src/files.c (open_files, close_files): Remove.
19200 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19201 let...
19202 * src/reader.c (reader): Do it.
776209d6 19203
be750e4c
AD
192042001-12-17 Akim Demaille <akim@epita.fr>
19205
19206 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19207
709ae8c6
AD
192082001-12-17 Akim Demaille <akim@epita.fr>
19209
19210 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19211 (flush_reduce): New.
19212 (resolve_sr_conflict): Adjust.
776209d6 19213
f87685c3
AD
192142001-12-17 Akim Demaille <akim@epita.fr>
19215
19216 * src/output.c (output_obstack): Be static and rename as...
19217 (format_obstack): this, to avoid any confusion with files.c's
19218 output_obstack.
19219 * src/reader.h (muscle_obstack): Move to...
19220 * src/output.h: here, since it's defined in output.c.
19221
837491d8
AD
192222001-12-17 Akim Demaille <akim@epita.fr>
19223
19224 * src/output.c (action_row, save_column, default_goto)
19225 (sort_actions, matching_state, pack_vector): Better variable
19226 locality.
19227
796d61fb
AD
192282001-12-17 Akim Demaille <akim@epita.fr>
19229
19230 * src/output.c: Various formatting changes.
776209d6 19231
64d15509
AD
192322001-12-17 Akim Demaille <akim@epita.fr>
19233
19234 * src/files.c (output_files): Free the output_obstack.
19235 * src/main.c (main): Call print and print_graph conditionally.
19236 * src/print.c (print): Work unconditionally.
19237 * src/print_graph.c (print_graph): Work unconditionally.
19238 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19239
fbc8ecb7
MA
192402001-12-16 Marc Autret <autret_m@epita.fr>
19241
19242 * src/output.c (actions_output): Fix. When we use %no-lines,
19243 there is one less line per action.
19244
f0440388
MA
192452001-12-16 Marc Autret <autret_m@epita.fr>
19246
19247 * src/bison.simple: Remove a useless #line directive.
19248 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19249 * src/output.c (get_lines_number): New.
776209d6 19250 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19251 output muscles.
19252 Fix line numbering.
19253 (actions_output): Computes the number of lines taken by actions.
19254 (output_master_parser): Insert new skeleton which is the name of
19255 the output parser file name.
19256
a79986b8
MA
192572001-12-15 Marc Autret <autret_m@epita.fr>
19258
19259 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19260
4ec8e00f
MA
192612001-12-15 Marc Autret <autret_m@epita.fr>
19262
19263 * src/output.c (output_gram): Keep track of the hairy one.
19264
1a4648ff
AD
192652001-12-15 Akim Demaille <akim@epita.fr>
19266
19267 Make `make distcheck' work.
19268
19269 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19270 system.h which uses libgettext.h.
19271
9c2c67e6
AD
192722001-12-15 Akim Demaille <akim@epita.fr>
19273
19274 * src/nullable.c (set_nullable): Useless rules must be skipped,
19275 otherwise, since we range over their symbols, we might look at a
19276 nonterminal which no longer ``exists'', i.e., it is not counted in
19277 `nvars', hence we overflow our arrays.
19278
93ede233
AD
192792001-12-15 Akim Demaille <akim@epita.fr>
19280
19281 The header can also be produced directly, without any obstack!
19282 Yahoo!
19283
19284 * src/files.c, src/files.h (defines_obstack): Remove.
19285 (compute_header_macro): Global.
19286 (defines_obstack_save): Remove.
19287 * src/reader.c (parse_union_decl): No longer output to
19288 defines_obstack: its content can be found in the `stype' muscle
19289 anyway.
19290 (output_token_translations): Merge into...
19291 (symbols_output): this.
19292 Rename as...
19293 (symbols_save): this.
19294 (reader): Adjust.
19295 * src/output.c (header_output): New.
19296 (output): Call it.
19297
2666f928
AD
192982001-12-15 Akim Demaille <akim@epita.fr>
19299
19300 * src/reader.c (parse_union_decl): Instead of handling two obstack
19301 simultaneously, use one to define the `stype' muscle, and use the
19302 value of the latter to fill defines_obstack.
19303 (copy_comment): Remove.
19304 (copy_comment2): Work for a single obstack.
19305 Rename as...
19306 (copy_comment): this.
19307
428046f8
AD
193082001-12-15 Akim Demaille <akim@epita.fr>
19309
19310 * src/lex.c, src/lex.h (xgetc): No longer static.
19311 * src/reader.c (parse_union_decl): Revamp.
19312
ea52d706
AD
193132001-12-15 Akim Demaille <akim@epita.fr>
19314
19315 Still making progress in separating Bison into (i) input, (ii)
19316 process, (iii) output: now we can directly output the parser file
19317 without using table_obstack at all.
19318
19319 * src/files.c, src/files.h (table_obstack): Bye bye.
19320 (parser_file_name): New.
19321 * src/files.c (compute_output_file_names): Compute it.
19322 * src/output.c (actions_output, output_parser)
19323 (output_master_parser): To a file instead of an obstack.
19324
3f96f4dc
AD
193252001-12-15 Akim Demaille <akim@epita.fr>
19326
19327 Attach actions to rules, instead of pre-outputting them to
19328 actions_obstack.
19329
19330 * src/gram.h (rule_t): action and action_line are new members.
19331 * src/reader.c (symbol_list): Likewise.
19332 (copy_action): Save the actions within the rule.
19333 (packgram): Save them in rule_table.
19334 * src/output.c (actions_output): New.
19335 (output_parser): Use it on `%%actions'.
19336 (output_rule_data): Don't free rule_table.
19337 (output): Do it.
19338 (prepare): Don't save the `action' muscle.
19339 * src/bison.simple: s/%%action/%%actions/.
19340
51576fb3
AD
193412001-12-15 Akim Demaille <akim@epita.fr>
19342
19343 * src/reader.c (copy_action): When --yacc, don't append a `;'
19344 to the user action: let it fail if lacking.
dee049eb 19345 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 19346
2648a72d
AD
193472001-12-14 Akim Demaille <akim@epita.fr>
19348
19349 * src/lex.c (literalchar): Simply return the char you decoded, non
19350 longer mess around with obstacks and int pointers.
19351 Adjust all callers.
19352
92790e5b
AD
193532001-12-14 Akim Demaille <akim@epita.fr>
19354
19355 * src/lex.c (literalchar): Don't escape the special characters,
19356 just decode them, and keep them as char (before, eol was output as
19357 the 2 char string `\n' etc.).
19358 * src/output.c (output_rule_data): Use quotearg to output the
19359 token strings.
19360
927c1557
PE
193612001-12-13 Paul Eggert <eggert@twinsun.com>
19362
19363 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19364 Do not infringe on the global user namespace when using C++.
19365 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19366 All uses of `fprintf' and `stderr' changed.
19367
19368 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19369
ed8e1f68
AD
193702001-12-13 Akim Demaille <akim@epita.fr>
19371
19372 The computation of nullable is broken: it doesn't handle empty
19373 RHS's properly.
19374
19375 * tests/torture.at (GNU AWK Grammar): New.
19376 * tests/sets.at (Nullable): New.
19377 * src/nullable.c (set_nullable): Instead of blindly looping over
19378 `ritems', loop over the rules, and then over their rhs's.
19379
19380 Work around Autotest bugs.
19381
19382 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19383 frame, because Autotest understand lines starting with a `+' as
19384 traces from the shell. Then, they are not processed properly.
19385 Admittedly an Autotest bug, but we don't have time to wait for
19386 Autotest to catch up.
19387 * tests/regression.at (Broken Closure): Adjust to the new table
19388 frames.
19389 Move to...
19390 * tests/sets.at: here.
19391
cb581495
AD
193922001-12-13 Akim Demaille <akim@epita.fr>
19393
19394 * src/closure.c (closure): Use nrules instead of playing tricks
19395 with BITS_PER_WORD.
19396
2e729273
AD
193972001-12-13 Akim Demaille <akim@epita.fr>
19398
19399 * src/print.c (print_actions): Output the handling of `$' as the
19400 traces do: shifting the token EOF. Before EOF was treated as a
19401 nonterminal.
19402 * tests/regression.at: Adjust some tests.
19403 * src/print_graph.c (print_core): Complete the set of items via
19404 closure. The next-to-final and final states are still unsatisfying,
19405 but that's to be addressed elsewhere.
19406 No longer output the rule numbers, but do output the state number.
19407 A single loop for the shifts + gotos is enough, but picked a
19408 distinct color for each.
19409 (print_graph): Initialize and finalize closure.
19410
107f7dfb
AD
194112001-12-13 Akim Demaille <akim@epita.fr>
19412
19413 * src/reader.c (readgram): Remove dead code, an strip useless
19414 braces.
19415 (get_type): Remove, unused.
19416
9b53a24f
AD
194172001-12-12 Akim Demaille <akim@epita.fr>
19418
19419 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19420 on that of lib/error.c.
19421
dbfb6dcd
AD
194222001-12-12 Akim Demaille <akim@epita.fr>
19423
19424 Some hosts don't like `/' in includes.
19425
19426 * src/system.h: Include libgettext.h without qualifying the path.
19427 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19428 $(top_srcdir).
19429
c25fb648
MA
194302001-12-11 Marc Autret <autret_m@epita.fr>
19431
19432 * src/output.c (output_parser): Remove useless muscle.
19433
710ddc4f
MA
194342001-12-11 Marc Autret <autret_m@epita.fr>
19435
19436 * src/bison.simple: Remove #line just before %%epilogue. It
19437 is now handled in ...
19438 * src/reader.c (read_additionnal_code): Add the output of a
19439 #line for the epilogue.
19440
e83d80b8
MA
194412001-12-10 Marc Autret <autret_m@epita.fr>
19442
927c1557 19443 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
19444 replace precedent remove.
19445 * src/bison.simple: Remove #line before %%prologue because
19446 %%input-line is wrong at this time.
19447
971d5158
MA
194482001-12-10 Marc Autret <autret_m@epita.fr>
19449
19450 * src/reader.c (symbols_output): Clean up.
927c1557 19451 * src/output.c (output_gram, output): Clean up.
971d5158 19452
5edafffd
AD
194532001-12-10 Akim Demaille <akim@epita.fr>
19454
19455 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19456 * src/LR0.c (set_state_table): here.
19457 * src/lalr.c (lalr): Call it.
19458
0279f8e9
AD
194592001-12-10 Akim Demaille <akim@epita.fr>
19460
19461 * src/state.h (shifts): Remove the `number' member: shifts are
19462 attached to state, hence no longer need to be labelled with a
19463 state number.
19464
190c4f5f
AD
194652001-12-10 Akim Demaille <akim@epita.fr>
19466
19467 Now that states have a complete set of members, the linked list of
19468 shifts is useless: just fill directly the state's shifts member.
19469
19470 * src/state.h (shifts): Remove the `next' member.
19471 * src/LR0.c (first_state, last_state): Remove.
19472 Adjust the callers.
19473 (augment_automaton): Don't look for the shifts that must be added
19474 a shift on EOF: it is those of the state we looked for! But now,
19475 since shifts are attached, it is no longer needed to looking
19476 merely by its id: its number.
19477
2a73b93d
AD
194782001-12-10 Akim Demaille <akim@epita.fr>
19479
19480 * src/LR0.c (augment_automaton): Better variable locality.
19481 Remove an impossible branch: if there is a state corresponding to
19482 the start symbol being shifted, then there is shift for the start
19483 symbol from the initial state.
19484
74392f6a
AD
194852001-12-10 Akim Demaille <akim@epita.fr>
19486
19487 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19488 only when appropriate: when insert_start_shifting_state' is not
19489 invoked.
19490 * tests/regression.at (Rule Line Numbers): Adjust.
19491
37c82725
AD
194922001-12-10 Akim Demaille <akim@epita.fr>
19493
19494 * src/LR0.c (augment_automaton): Now that all states have shifts,
19495 merge the two cases addition shifts to the initial state.
19496
6a164e0c
AD
194972001-12-10 Akim Demaille <akim@epita.fr>
19498
19499 * src/lalr.c (set_state_table): Move to...
19500 * src/LR0.c: here.
19501 * src/lalr.c (lalr): Don't call it...
19502 * src/LR0.c (generate_states): do it.
19503 * src/LR0.h (first_state): Remove, only the table is used.
19504
7215de24
AD
195052001-12-10 Akim Demaille <akim@epita.fr>
19506
19507 * src/LR0.h (first_shift, first_reduction): Remove.
19508 * src/lalr.c: Don't use first_shift: find shifts through the
19509 states.
19510
80e25d4d
AD
195112001-12-10 Akim Demaille <akim@epita.fr>
19512
19513 * src/LR0.c: Attach shifts to states as soon as they are
19514 computed.
19515 * src/lalr.c (set_state_table): Instead of assigning shifts to
19516 state, just assert that the mapping was properly done.
19517
0ab3728b
AD
195182001-12-10 Akim Demaille <akim@epita.fr>
19519
19520 * src/LR0.c (insert_start_shift): Rename as...
19521 (insert_start_shifting_state): this.
19522 (insert_eof_shifting_state, insert_accepting_state): New.
19523 (augment_automaton): Adjust.
19524 Better locality of the variables.
19525 When looking if the start_symbol is shifted from the initial
19526 state, using `while (... symbol != start_symbol ...)' sounds
19527 better than `while (... symbol < start_symbol ...)': If fail
19528 to see how the order between symbols could be relevant!
19529
78af9bbc
AD
195302001-12-10 Akim Demaille <akim@epita.fr>
19531
19532 * src/getargs.h: Don't declare `spec_name_prefix' and
19533 `spec_file_prefix', declared by src/files.h.
19534 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19535 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19536 * src/output.c (prepare): Adjust.
19537 * src/reader.c (symbols_output): Likewise.
19538 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19539
bdef2a41
AD
195402001-12-10 Akim Demaille <akim@epita.fr>
19541
19542 * src/muscle_tab.c (muscle_init): NULL is a better default than
19543 `"0"'.
19544
3735969c
AD
195452001-12-10 Akim Demaille <akim@epita.fr>
19546
19547 * src/reader.c (reader): Calling symbols_output once is enough.
19548
49701457
AD
195492001-12-10 Akim Demaille <akim@epita.fr>
19550
19551 Now that states have a complete set of members, the linked list of
19552 reductions is useless: just fill directly the state's reductions
19553 member.
19554
19555 * src/state.h (struct reductions): Remove member `number' and
19556 `next'.
19557 * src/LR0.c (first_reduction, last_reduction): Remove.
19558 (save_reductions): Don't link the new reductions, store them in
19559 this_state.
19560 * src/lalr.c (set_state_table): No need to attach reductions to
19561 states, it's already done.
19562 * src/output.c (output_actions): No longer free the shifts, then
19563 the reductions, then the states: free all the states and their
19564 members.
19565
0edad749
AD
195662001-12-10 Akim Demaille <akim@epita.fr>
19567
19568 * src/options.c (OPTN, DRTV, BOTH): New.
19569 (option_table): Use them.
19570
0edad749
AD
19571 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19572 the job of system.h.
19573 * src/options.c: Don't include stdio.h and xalloc.h for the same
19574 reasons.
19575
5449dd0f
AD
195762001-12-10 Akim Demaille <akim@epita.fr>
19577
19578 * src/output.c (output, prepare): Make sure the values of the
19579 muscles `action' and `prologue' are 0-terminated.
19580
a870c567
AD
195812001-12-10 Akim Demaille <akim@epita.fr>
19582
19583 Clean up GCC warnings.
19584
19585 * src/reader.c (copy_action): `buf' is not used.
19586 (parse_skel_decl): Be static.
19587 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19588 * src/options.h (create_long_option_table): Have a real prototype.
19589 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19590 (hash_delete_at): Return const void *.
19591 Adjust casts to preserve the const.
19592
80df8768
AD
195932001-12-10 Akim Demaille <akim@epita.fr>
19594
19595 * configure.in: Require 2.52g.
19596 M4 is not needed, but AUTOM4TE is.
19597 * m4/m4.m4: Remove.
19598 * tests/Makefile.am: Adjust.
19599
f693ad14
AD
196002001-12-10 Akim Demaille <akim@epita.fr>
19601
19602 One structure for states is enough, even though theoretically
19603 there are LR(0) states and LALR(1) states.
19604
19605 * src/lalr.h (state_t): Remove.
19606 (state_table): Be state_t **, not state_t *.
19607 * src/state.h (core, CORE_ALLOC): Rename as...
19608 (state_t, STATE_ALLOC): this.
19609 Add the LALR(1) members: shifts, reductions, errs.
19610 * src/LR0.c (state_table): Rename as...
19611 (state_hash): this, to avoid name clashes with the global
19612 `state_table'.
19613 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19614 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19615
74ffbcb6
AD
196162001-12-10 Akim Demaille <akim@epita.fr>
19617
19618 Bison dumps core on bash.y.
19619 Reported by Pascal Bart.
19620
19621 * src/warshall.c (bitmatrix_print): New.
19622 (TC): Use it.
ba0fe3c7 19623 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
19624 j must be the outer loop.
19625 * tests/regression.at (Broken Closure): New.
19626
07708e19
AD
196272001-12-05 Akim Demaille <akim@epita.fr>
19628
19629 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19630 its argument.
ba1ecc07 19631 Reported by Peter Hamorsky.
07708e19 19632
92b16366
AD
196332001-12-05 Akim Demaille <akim@epita.fr>
19634
19635 * src/conflicts.c (err_table): Remove.
19636 (resolve_sr_conflict): Adjust.
19637 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19638 Rename as...
19639 (state_t.reductions, state_t.shifts): this.
19640
076ab033
AD
196412001-12-05 Akim Demaille <akim@epita.fr>
19642
19643 * src/reduce.c (reduce_grammar_tables): No longer disable the
19644 removal of useless rules via CPP but via `if (0)', so that the
19645 compiler still check the code is valid.
19646 For instance, it should have noticed `rline' no longer exists: use
19647 the `line' member of rule_t.
19648 * src/gram.c (dummy, rline): Remove, unused.
19649
3843c413
AD
196502001-12-05 Akim Demaille <akim@epita.fr>
19651
19652 * src/output.c (pack_vector): Use assert, not berror.
19653 * src/main.c (berror): Remove, unused.
19654
43168960
AD
196552001-12-05 Akim Demaille <akim@epita.fr>
19656
19657 New experimental feature: if --verbose --trace output all the
19658 items of a state, not only its kernel.
19659
19660 * src/print.c (print_core): If `trace_flag', then invoke closure
19661 before outputting the items of the state (print_core is no longer
19662 a correct name them).
19663 (print_results): Invoke new_closure/free_closure if needed.
19664
b2872512
AD
196652001-12-05 Akim Demaille <akim@epita.fr>
19666
19667 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19668 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19669 (nitemset): for consistency with the rest of the project.
19670
23cbcc6c
AD
196712001-12-05 Akim Demaille <akim@epita.fr>
19672
19673 * src/closure.c (print_closure): Improve.
19674 (closure): Use it for printing input and output.
19675
03ec521c
AD
196762001-12-05 Akim Demaille <akim@epita.fr>
19677
19678 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19679 indexed by nonterminals.
19680
3a7456dd
AD
196812001-12-05 Akim Demaille <akim@epita.fr>
19682
19683 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19684 what it was!).
19685 * src/warshall.h: Remove accidental duplication of the content.
19686
1cbcf2e7
AD
196872001-12-05 Akim Demaille <akim@epita.fr>
19688
19689 * src/closure.c (set_fderives): De-obfuscate.
19690
84182270
AD
196912001-12-05 Akim Demaille <akim@epita.fr>
19692
19693 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19694
3f6f053c
AD
196952001-12-05 Akim Demaille <akim@epita.fr>
19696
19697 * src/closure.c (set_firsts): De-obfuscate.
19698
7a5350ba
AD
196992001-12-05 Akim Demaille <akim@epita.fr>
19700
19701 * src/output.c (action_row): De-obfuscate
19702 using the good o' techniques: arrays not pointers, variable
19703 locality, BITISSET, RESETBIT etc.
19704
d954473d
AD
197052001-12-05 Akim Demaille <akim@epita.fr>
19706
19707 Pessimize the code to simplify it: from now on, all the states
19708 have a valid SHIFTS, which NSHIFTS is possibly 0.
19709
19710 * src/LR0.c (shifts_new): Be global and move to..
19711 * src/state.c, src/state.h: here.
19712 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19713 * src/print_graph: Adjust.
19714
9839bbe5
AD
197152001-12-05 Akim Demaille <akim@epita.fr>
19716
19717 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
19718 * src/conflicts.c: Use it.
19719 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
19720 incorrectly ``simplified''.
19721
9f136c07
AD
197222001-12-05 Akim Demaille <akim@epita.fr>
19723
19724 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
19725 using the good o' techniques: arrays not pointers, variable
19726 locality, BITISSET, RESETBIT etc.
19727
b608206e
AD
197282001-12-05 Akim Demaille <akim@epita.fr>
19729
19730 * src/state.h (SHIFT_SYMBOL): New.
19731 * src/conflicts.c: Use it to deobfuscate.
19732
52afa962
AD
197332001-12-05 Akim Demaille <akim@epita.fr>
19734
19735 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
19736 (print_reductions): De-obfuscate using the good o' techniques:
19737 arrays not pointers, variable locality, BITISSET.
19738
e74dc321
AD
197392001-12-05 Akim Demaille <akim@epita.fr>
19740
19741 * src/conflicts.c (print_reductions): Arrays, not pointers.
19742 Use BITISSET.
19743
768fca83
AD
197442001-12-05 Akim Demaille <akim@epita.fr>
19745
19746 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19747
a17e599f
AD
197482001-12-05 Akim Demaille <akim@epita.fr>
19749
19750 * src/conflicts.c (print_reductions): Improve variable locality.
19751
a04bc341
AD
197522001-12-05 Akim Demaille <akim@epita.fr>
19753
19754 * src/conflicts.c (print_reductions): Pessimize, but clarify.
19755
c8ea038e
AD
197562001-12-05 Akim Demaille <akim@epita.fr>
19757
19758 * src/conflicts.c (print_reductions): Improve variable locality.
19759
aa2aab3c
AD
197602001-12-05 Akim Demaille <akim@epita.fr>
19761
19762 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
19763 * src/lalr.c: Use them.
19764
b178c8cc
AD
197652001-12-05 Akim Demaille <akim@epita.fr>
19766
19767 * src/LR0.c (augment_automaton): Formatting changes.
19768 Better variable locality.
19769
f67d13aa
AD
197702001-12-05 Akim Demaille <akim@epita.fr>
19771
19772 * src/lalr.c (matrix_print): New.
19773 (transpose): Use it.
19774 Use arrays instead of pointers.
19775
c2713865
AD
197762001-12-05 Akim Demaille <akim@epita.fr>
19777
19778 * src/lalr.c (maxrhs): Move to...
19779 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
19780 * src/lalr.c (build_relations): Adjust.
19781
9887c18a
AD
197822001-12-05 Akim Demaille <akim@epita.fr>
19783
19784 * src/lalr.c (transpose): Free the memory allocated to the
19785 argument, as it is replaced by the results by the unique caller.
19786 (build_relations): Merely invoke transpose: it handles the memory
19787 deallocation.
19788 Improve variable locality.
19789 Avoid variables used as mere abbreviations.
19790 (compute_lookaheads): Use arrays instead of pointers.
19791
4d4f699c
AD
197922001-12-05 Akim Demaille <akim@epita.fr>
19793
19794 * src/lalr.c (initialize_F): Improve variable locality.
19795 Avoid variables used as mere abbreviations.
19796
80a69750
AD
197972001-12-05 Akim Demaille <akim@epita.fr>
19798
19799 * src/derives.c (print_derives): Display the ruleno.
19800 * src/lalr.c (initialize_F, transpose): Better variable locality
19801 to improve readability.
19802 Avoid variables used as mere abbreviations.
19803
fe961097
AD
198042001-12-05 Akim Demaille <akim@epita.fr>
19805
19806 * src/lalr.c (traverse): Use arrays instead of pointers.
19807
e3e4e814
AD
198082001-12-05 Akim Demaille <akim@epita.fr>
19809
19810 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
19811 the handling of squeue.
19812 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19813
630e182b
AD
198142001-12-05 Akim Demaille <akim@epita.fr>
19815
19816 Because useless nonterminals are now kept alive (instead of being
19817 `destroyed'), we now sometimes examine them, and store information
19818 related to them. Hence we need to know their number, and adjust
19819 memory allocations.
19820
19821 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
19822 static.
19823 * src/LR0.c (allocate_itemsets): The memory allocated to
19824 `symbol_count' was used for two different purpose: once to count
19825 the number of occurrences of each symbol, and later reassigned to
19826 `shift_symbol', containing the symbol that can be shifted from a
19827 given state.
19828 Deobfuscate, i.e., allocate, use and free `symbol_count' here
19829 only, and...
19830 (new_itemsets): Allocate `shift_symbol' here.
19831 (allocate_itemsets): symbol_count includes useless nonterminals.
19832 Make room for them.
19833 (free_storage): Use `free', not `XFREE', for pointers that cannot
19834 be null.
19835
81b51460
AD
198362001-12-05 Akim Demaille <akim@epita.fr>
19837
19838 * src/nullable.c (set_nullable): Deobfuscate the handling of
19839 ritem.
19840 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
19841
3067fbef
AD
198422001-12-05 Akim Demaille <akim@epita.fr>
19843
19844 * src/gram.c, src/gram.h (ritem_print): New.
19845 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
19846 (This useless function was defined only to work around VMS linkers
19847 that can't handle compilation units with variables only).
19848 * src/reduce.c (dump_grammar): Use it to trace the construction of
19849 ritem.
19850
c2bea5f9
PE
198512001-12-04 Paul Eggert <eggert@twinsun.com>
19852
7d27c823
PE
19853 * src/bison.simple (union yyalloc): Change member names
19854 to be the same as the stack names.
19855 (yyparse): yyptr is now union yyalloc *, not char *.
19856 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
19857 and may generate better code on some machines.
c2bea5f9
PE
19858 (yystpcpy): Use prototype if __STDC__ is defined, not just
19859 if __cplusplus is defined.
35687a9d 19860
2c8a9dfa
AD
198612001-11-30 Akim Demaille <akim@epita.fr>
19862
19863 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
19864 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
19865 Gettext doesn't compile cleanly, and dies with -Werror.
19866 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
19867 Include WARNING_CFLAGS here.
19868 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
19869 before being defined.
19870
f4e421e6
AD
198712001-11-27 Paul Eggert <eggert@twinsun.com>
19872
19873 * lib/quotearg.h (quotearg_n, quotearg_n_style):
19874 First arg is int, not unsigned.
19875 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
19876 (SIZE_MAX, UINT_MAX): New macros.
19877 (quotearg_n_options): Abort if N is negative.
19878 Avoid overflow check on hosts where size_t is 64 bits and int
19879 is 32 bits, as overflow is impossible there.
19880 Fix off-by-one typo that caused unnecessary reallocation.
19881
7093d0f5
AD
198822001-11-29 Paul Eggert <eggert@twinsun.com>
19883
19884 Name space cleanup in generated parser.
19885
19886 * doc/bison.texinfo (Bison Parser): Discuss system headers
19887 and their effect on the user name space.
19888
19889 * src/bison.simple:
19890 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
19891 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
19892 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
19893
19894 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
19895 on user names when possible.
19896
19897 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
19898 Simplify test for whather <alloca.h> exists.
19899
19900 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
19901
19902 (<stdio.h>): Include if YYDEBUG.
19903
19904 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
19905 ! defined (yyoverflow) && ! defined (yymemcpy).
19906
19907 (yymemcpy, yyparse): Rename local variables as needed so that
19908 they all begin with 'yy'.
19909
19910 (yystrlen, yystpcpy): New functions.
19911
19912 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
19913 All uses changed.
19914
19915 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
19916 instead of relying on string.h functions. Use YYSTACK_ALLOC
19917 and YYSTACK_FREE instead of malloc and free.
19918
fd51e5ff
AD
199192001-11-30 Akim Demaille <akim@epita.fr>
19920
19921 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
19922 before their first uses.
19923 (YYBISON, YYPURE): Move to the top of the output.
19924
7d13ff5f
AD
199252001-11-30 Akim Demaille <akim@epita.fr>
19926
19927 * tests/reduce.at (Useless Nonterminals): Fix.
19928
892a3995
AD
199292001-11-30 Akim Demaille <akim@epita.fr>
19930
19931 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
19932 if body instead of `;' to pacify GCC's warnings.
19933
68f1e3ed
AD
199342001-11-30 Akim Demaille <akim@epita.fr>
19935
19936 Instead of mapping the LHS of unused rules to -1, keep the LHS
19937 valid, but flag the rules as invalid.
19938
19939 * src/gram.h (rule_t): `useful' is a new member.
19940 * src/print.c (print_grammar): Adjust.
19941 * src/derives.c (set_derives): Likewise.
19942 * src/reader.c (packgram, reduce_output): Likewise.
19943 * src/reduce.c (reduce_grammar_tables): Likewise.
19944 * tests/reduce.at (Underivable Rules, Useless Rules): New.
19945
d2d1b42b
AD
199462001-11-30 Akim Demaille <akim@epita.fr>
19947
19948 * src/reduce.c (reduce_output): Formatting changes.
19949 * src/print.c (print_results, print_grammar): Likewise.
19950 * tests/regression.at (Rule Line Numbers)
19951 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
19952
760b53a8
AD
199532001-11-30 Akim Demaille <akim@epita.fr>
19954
19955 * src/reduce.c (nonterminals_reduce): Instead of throwing away
19956 useless nonterminals, move them at the end of the symbol arrays.
19957 (reduce_output): Adjust.
19958 * tests/reduce.at (Useless Nonterminals): Adjust.
19959
00238958
AD
199602001-11-30 Akim Demaille <akim@epita.fr>
19961
19962 * src/reduce.c: Various comment/formatting changes.
19963 (nonterminals_reduce): New, extracted from...
19964 (reduce_grammar_tables): here.
19965 (reduce_grammar): Call nonterminals_reduce.
19966
396452de
PE
199672001-11-29 Paul Eggert <eggert@twinsun.com>
19968
19969 * src/bison.simple (YYSTACK_REALLOC): Remove.
19970 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
19971 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
19972 New macros.
19973 (union yyalloc): New type.
19974 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
19975 an arbitrary restriction on hosts where size_t is wider than int.
19976
19977 (yyparse): Don't dump core if alloca or malloc fails; instead, report
19978 a parser stack overflow. Allocate just one block of memory for all
19979 three stacks, instead of allocating three blocks; this typically is
19980 faster and reduces fragmentation.
19981
19982 Do not limit the number of items in the stack to a value that fits
19983 in 'int', as this is an arbitrary limit on hosts with 64-bit
19984 size_t and 32-bit int.
19985
147e184c
MA
199862001-11-29 Marc Autret <autret_m@epita.fr>
19987
19988 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
19989 of defining YYERROR_VERBOSE.
19990 [AT_DATA]: $4 is now out of C declarations in the prologue.
19991
426cf563
MA
199922001-11-28 Marc Autret <autret_m@epita.fr>
19993
19994 * src/reader.c (parse_dquoted_param): New.
19995 (parse_skel_decl): Use it.
19996 * src/lex.h: Add its prototype.
19997 * src/lex.c (literalchar): Become not static.
19998
c7925b99
MA
199992001-11-28 Marc Autret <autret_m@epita.fr>
20000
20001 * src/output.h: And put its extern declaration here.
20002 * src/output.c (error_verbose): Define here.
20003 (prepare): Echo name modification.
20004 * src/getargs.h: Clean its extern declaration.
20005 * src/getargs.c (error_verbose_flag): Remove.
20006 (getargs): Remove case 'e'.
20007 * src/options.c (option_table): 'error-verbose' is now seen as simple
20008 percent option.
20009 Include output.h.
20010
20011 * src/reader.c (read_declarations): Remove case tok_include.
20012 (parse_include_decl): Remove.
20013 * src/lex.h (token_t): Remove tok_include.
20014 * src/options.c (option_table): 'include' is now a simple command line
20015 option.
20016
5b5d1929
MA
200172001-11-28 Marc Autret <autret_m@epita.fr>
20018
20019 * src/bison.simple: Adjust muscle names.
20020 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20021 * src/output.c (prepare): s/_/-/ for the muscles names.
20022 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20023
8850be4b
MA
200242001-11-28 Marc Autret <autret_m@epita.fr>
20025
20026 * src/bison.simple: Fix debug.
20027 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20028
4a38e613
AD
200292001-11-28 Akim Demaille <akim@epita.fr>
20030
20031 * src/LR0.c (shifts_new): New.
20032 (save_shifts, insert_start_shift, augment_automaton): Use it.
20033
4b35e1c1
AD
200342001-11-28 Akim Demaille <akim@epita.fr>
20035
20036 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20037 keep ruleno only.
20038
d2b04478
AD
200392001-11-28 Akim Demaille <akim@epita.fr>
20040
20041 * src/closure.c (closure): Instead of looping over word in array
20042 then bits in words, loop over bits in array.
20043
2c4c30aa
AD
200442001-11-28 Akim Demaille <akim@epita.fr>
20045
20046 * src/closure.c (closure): No longer optimize the special case
20047 where all the bits of `ruleset[r]' are set to 0, to make the code
20048 clearer.
20049
576890b7
AD
200502001-11-28 Akim Demaille <akim@epita.fr>
20051
20052 * src/closure.c (closure): `r' and `c' are new variables, used to
20053 de-obfuscate accesses to RULESET and CORE.
20054
cb487d7d
AD
200552001-11-28 Akim Demaille <akim@epita.fr>
20056
20057 * src/reduce.c (reduce_print): Use ngettext.
20058 (dump_grammar): Improve the trace accuracy.
20059
6013d43f
AD
200602001-11-28 Akim Demaille <akim@epita.fr>
20061
20062 * src/reduce.c (dump_grammar): Don't translate trace messages.
20063
cb4956ee
AD
200642001-11-28 Akim Demaille <akim@epita.fr>
20065
20066 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20067 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20068 as all tags are free'ed afterwards.
20069 From Enrico Scholz.
20070
648185ab
PE
200712001-11-27 Paul Eggert <eggert@twinsun.com>
20072
20073 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20074 use alloca when we didn't want to, and vice versa.
20075
68254a03
MA
200762001-11-27 Marc Autret <autret_m@epita.fr>
20077
9113b58f
AD
20078 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20079 initialization.
68254a03
MA
20080 * src/output.c (prepare): Remove its update.
20081
04d843a2
MA
200822001-11-27 Marc Autret <autret_m@epita.fr>
20083
20084 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20085 Use %error-verbose.
20086
d2079671 200872001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
20088
20089 * src/bison.simple: Remove YYERROR_VERBOSE using.
20090 Use %%error_verbose.
20091 (yyparse): Likewise.
20092 * src/output.c (prepare): Give its final value.
20093 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20094 * src/getargs.h: Add its extern declaration.
20095 * src/getargs.c (error_verbose_flag): New int.
20096 (getargs): Update to catch new case.
20097 * src/options.c (option_table): 'error-verbose' is a new option.
20098 (shortopts): Update.
20099
e0327bc8
AD
201002001-11-27 Akim Demaille <akim@epita.fr>
20101
20102 * src/system.h: Use intl/libgettext.h.
20103 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20104
000f1a3c
AD
201052001-11-27 Akim Demaille <akim@epita.fr>
20106
20107 * tests/torture.at (Exploding the Stack Size with Malloc):
20108 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20109
26cfe0be
AD
201102001-11-27 Akim Demaille <akim@epita.fr>
20111
20112 * src/files.c: Include error.h.
20113 Reported by Hans Aberg.
20114
f6bd5427
MA
201152001-11-26 Marc Autret <autret_m@epita.fr>
20116
d2079671 20117 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
20118 (read_declarations): Add case tok_include.
20119 * src/getargs.h (include): Add its extern definition.
20120 * src/getargs.c (include): New const char *.
20121 (getargs): Add case '-I'.
20122 * src/options.c (option_table): Add include as command line and
20123 percent option.
20124 * src/lex.h (token_t): Add tok_include.
20125
2ca209c1
AD
201262001-11-26 Akim Demaille <akim@epita.fr>
20127
20128 * src/reader.c (readgram): Make sure rules for mid-rule actions
20129 have a lineno equal to that of their host rule.
20130 Reported by Hans Aberg.
20131 * tests/regression.at (Rule Line Numbers): New.
20132
0e41b407
AD
201332001-11-26 Akim Demaille <akim@epita.fr>
20134
20135 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20136 size_ts.
20137
201382001-11-26 Akim Demaille <akim@epita.fr>
20139
20140 * src/complain.c, src/complain.h (error): Remove, provided by
20141 lib/error.[ch].
20142
e0c40012
AD
201432001-11-26 Akim Demaille <akim@epita.fr>
20144
20145 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20146 issue an error message.
20147 * tests/regression.at (Invalid %directive): New.
20148 Reported by Hans Aberg.
20149
5e147124
AD
201502001-11-26 Akim Demaille <akim@epita.fr>
20151
20152 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20153 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20154
a034c8b8
AD
201552001-11-26 Akim Demaille <akim@epita.fr>
20156
20157 * src/conflicts.c (conflicts_print): Don't complain at all when
20158 there are no reduce/reduce conflicts, and as many shift/reduce
20159 conflicts as expected.
20160 * tests/regression.at (%expect right): Adjust.
20161
c64a20f3
AD
201622001-11-23 Akim Demaille <akim@epita.fr>
20163
20164 * lib/alloca.c: Update, from fileutils.
20165
5b0d29bb
AD
201662001-11-23 Akim Demaille <akim@epita.fr>
20167
20168 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20169
722c4bfe
AD
201702001-11-23 Akim Demaille <akim@epita.fr>
20171
20172 * src/system.h: Include alloca.h.
20173 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20174
6255b435
AD
201752001-11-23 Akim Demaille <akim@epita.fr>
20176
20177 * src/print_graph.c (print_actions): Remove `rule', unused.
20178 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20179 pacify GCC's signed < unsigned warnings.
20180 * src/closure.c (itemsetsize): Likewise.
20181 * src/reader.c (symbol_list_new): Static.
20182
b29b2ed5
AD
201832001-11-23 Akim Demaille <akim@epita.fr>
20184
20185 Attaching lineno to buckets is stupid, since only one copy of each
20186 symbol is kept, only the line of the first occurrence is kept too.
20187
20188 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20189 * src/reader.c (rline_allocated): Remove, unused.
20190 (symbol_list): Have a `line' member.
20191 (symbol_list_new): New.
20192 (readgram): Use it.
20193 * src/print.c (print_grammar): Output the rule line numbers.
20194 * tests/regression.at (Solved SR Conflicts)
20195 (Unresolved SR Conflicts): Adjust.
20196 Reported by Hans Aberg.
20197
a81b1d4a
MA
201982001-11-22 Marc Autret <autret_m@epita.fr>
20199
20200 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20201
c1ecb3c1
MA
202022001-11-22 Marc Autret <autret_m@epita.fr>
20203
20204 * src/muscle_tab.c (muscle_init): Remove initialization of
20205 skeleton muscle.
20206 * src/output.c (output_master_parser): Do it here.
20207
fbe01355
AD
202082001-11-20 Akim Demaille <akim@epita.fr>
20209
20210 * po/sv.po: New.
20211 * configure.in (ALL_LINGUAS): Adjust.
20212 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20213 longer contains strings to translate.
20214
81e895c0
AD
202152001-11-19 Akim Demaille <akim@epita.fr>
20216
20217 * src/conflicts.c (conflicts_print): Add a missing \n.
20218
6bb1878b
AD
202192001-11-19 Akim Demaille <akim@epita.fr>
20220
20221 * src/nullable.c (nullable_print): New.
20222 (set_nullable): Call it when tracing.
20223 Better locality of variables.
20224
d9ec2d07
AD
202252001-11-19 Akim Demaille <akim@epita.fr>
20226
20227 * src/print.c (print_actions): Better locality of variables.
20228
720e5c1b
AD
202292001-11-19 Akim Demaille <akim@epita.fr>
20230
20231 * src/derives.c (print_derives): Fix and enrich.
20232 * src/closure.c (print_fderives): Likewise.
20233
fb908786
AD
202342001-11-19 Akim Demaille <akim@epita.fr>
20235
20236 * src/closure.c (itemsetend): Remove, replaced with...
20237 (itemsetsize): new.
20238
125ecb56
AD
202392001-11-19 Akim Demaille <akim@epita.fr>
20240
20241 * src/LR0.c (kernel_end): Remove, replaced with...
20242 (kernel_size): new.
20243
d8cf039f
AD
202442001-11-19 Akim Demaille <akim@epita.fr>
20245
20246 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20247 to clarify.
20248
7bec0760
AD
202492001-11-19 Akim Demaille <akim@epita.fr>
20250
20251 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20252
c87d4863
AD
202532001-11-19 Akim Demaille <akim@epita.fr>
20254
20255 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20256 trace messages.
20257 * src/LR0.c: Likewise.
20258 (allocate_itemsets): Use arrays instead of pointers to clarify.
20259
9bfe901c
AD
202602001-11-19 Akim Demaille <akim@epita.fr>
20261
20262 * src/getargs.c (statistics_flag): Replace with...
20263 (trace_flag): New.
20264 (longopts): Accept --trace instead of --statistics.
20265 * src/getargs.h, src/options.c: Adjust.
20266 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20267 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20268
97db7bd4
AD
202692001-11-19 Akim Demaille <akim@epita.fr>
20270
cc72668c 20271 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20272 pointers to clarify the code.
20273 (save_reductions, save_shifts): Factor common parts of alternatives.
20274
2c5f66ed
AD
202752001-11-19 Akim Demaille <akim@epita.fr>
20276
20277 * src/LR0.c (new_state, get_state): Complete TRACE code.
20278 * src/closure.c: Include `reader.h' to get `tags', needed by the
20279 trace code.
20280 Rename the conditional DEBUG as TRACE.
20281 Output consistently TRACEs to stderr, not stdout.
20282 * src/derives.c: Likewise.
20283 * src/reduce.c: (inaccessable_symbols): Using if is better style
20284 than goto.
20285 Use `#if TRACE' instead of `#if 0' for tracing code.
20286
300f275f
AD
202872001-11-19 Akim Demaille <akim@epita.fr>
20288
20289 * src/system.h (LIST_FREE, shortcpy): New.
20290 * src/LR0.c: Use them.
20291 * src/output.c (free_itemsets, free_reductions, free_shifts):
20292 Remove, replaced by LIST_FREE.
20293
f59c437a
AD
202942001-11-19 Akim Demaille <akim@epita.fr>
20295
20296 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20297 (REDUCTIONS_ALLOC): New.
20298 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20299 allocation.
20300
6986fd9e
AD
203012001-11-19 Akim Demaille <akim@epita.fr>
20302
20303 * src/LR0.c (new_state): Complete trace code.
20304 * src/nullable.c (set_nullable): Don't translate traces.
20305
4bc30f78
AD
203062001-11-19 Akim Demaille <akim@epita.fr>
20307
20308 * src/print_graph.c (print_core): Better locality of variables.
20309 * src/print.c (print_core): Likewise.
20310
08a946e0
AD
203112001-11-19 Akim Demaille <akim@epita.fr>
20312
20313 * src/vcg.c: You do the output, so you are responsible of the
20314 handling of VCG syntax, in particular: use quotearg.
20315 * src/print_graph.c: Don't.
20316 (print_actions): Don't output the actions as part of the nodes,
20317 since that's the job of the edges.
20318 (print_state): Don't output by hand: fill the node description,
9bfe901c 20319 and ask for its output.
08a946e0 20320
f0473484
AD
203212001-11-19 Akim Demaille <akim@epita.fr>
20322
cc72668c
AD
20323 * src/bison.simple (yyparse): When verbosely reporting an error,
20324 no longer put additional quotes around token names.
f0473484
AD
20325 * tests/calc.at: Adjust.
20326
e41dc700
AD
203272001-11-19 Akim Demaille <akim@epita.fr>
20328
20329 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20330 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20331 * src/output.c: Adjust.
20332
652a871c
AD
203332001-11-19 Akim Demaille <akim@epita.fr>
20334
20335 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20336 (rule_t): this.
20337 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20338
b2ed6e58
AD
203392001-11-19 Akim Demaille <akim@epita.fr>
20340
20341 * src/gram.h (rule_t): New.
20342 (rule_table): New.
20343 (rrhs, rlhs): Remove, part of state_t.
20344 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20345 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20346 * src/reader.c, src/reduce.c: Adjust.
20347
edad7067
AD
203482001-11-19 Akim Demaille <akim@epita.fr>
20349
20350 * src/reader.c (symbols_output): New, extracted from...
20351 (packsymbols): Here.
20352 (reader): Call it.
20353
3feec034
AD
203542001-11-19 Akim Demaille <akim@epita.fr>
20355
20356 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20357 (maxrhs): this new function.
20358
ddcd5fdf
AD
203592001-11-19 Akim Demaille <akim@epita.fr>
20360
cc72668c 20361 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
20362 Adjust.
20363
bb527fc2
AD
203642001-11-19 Akim Demaille <akim@epita.fr>
20365
cc72668c 20366 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
20367 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20368 * src/lalr.c: Adjust.
20369
a845a697
AD
203702001-11-19 Akim Demaille <akim@epita.fr>
20371
20372 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20373 (set_state_table): handle the `lookaheads' members.
20374
f004bf6a
AD
203752001-11-19 Akim Demaille <akim@epita.fr>
20376
cc72668c
AD
20377 * src/lalr.h (lookaheads): Removed array, whose contents is now
20378 a member of...
f004bf6a
AD
20379 (state_t): this structure.
20380 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20381 Adjust.
20382
de326cc0
AD
203832001-11-19 Akim Demaille <akim@epita.fr>
20384
cc72668c
AD
20385 * src/lalr.h (consistent): Removed array, whose contents is now
20386 a member of...
de326cc0
AD
20387 (state_t): this structure.
20388 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20389 Adjust.
20390
90b4416b
AD
203912001-11-19 Akim Demaille <akim@epita.fr>
20392
cc72668c
AD
20393 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20394 contents are now members of...
90b4416b
AD
20395 (state_t): this structure.
20396 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20397 Adjust.
20398
9703cc49
AD
203992001-11-19 Akim Demaille <akim@epita.fr>
20400
20401 * src/lalr.h (state_t): New.
20402 (state_table): Be a state_t * instead of a core **.
20403 (accessing_symbol): Remove, part of state_t.
20404 * src/lalr.c: Adjust.
20405 (set_accessing_symbol): Merge into...
20406 (set_state_table): this.
20407 * src/print_graph.c, src/conflicts.c: Adjust.
20408
d803322e
AD
204092001-11-14 Akim Demaille <akim@epita.fr>
20410
20411 * tests/calc.at, tests/output.at, tests/regression.at,
20412 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20413 now the tests are run in private dirs, therefore AC_CLEANUP and
20414 family can be simplified to 0-ary.
20415 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20416 use abs. path to find config.h.
20417 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20418 stderr, there can be way too much random noise.
20419 Instead pass -Werror to GCC and rely on the exit status.
20420 Reported by Wolfram Wagner.
20421
3d76b07d
AD
204222001-11-14 Akim Demaille <akim@epita.fr>
20423
20424 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20425 defined only if yyoverflow is defined, to avoid `warning: unused
20426 variable `yyvs1''.
20427 Reported by The Test Suite.
20428
09b503c8
AD
204292001-11-14 Akim Demaille <akim@epita.fr>
20430
20431 * src/print.c: Include reduce.h.
20432 Reported by Hans Aberg.
20433
204342001-11-14 Akim Demaille <akim@epita.fr>
20435
20436 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20437 Revert a previous patch: these are really const.
20438 * src/conflicts.c (conflict_report): Additional useless pair of
20439 braces to pacify GCC's warnings for `if () if () {} else {}'.
20440 * src/lex.c (parse_percent_token): Replace equal_offset with
20441 arg_offset.
20442 arg is const.
20443 Be sure to strdup `arg' when used, since there is no reason for
20444 token_buffer not to change.
20445
0f37a994
AD
204462001-11-14 Akim Demaille <akim@epita.fr>
20447
20448 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20449 definition.
20450 * src/main.c (main): Use them.
20451 Suggested by Hans Aberg.
20452
d39d93b8
AD
204532001-11-12 Akim Demaille <akim@epita.fr>
20454
20455 * src/system.h (ngettext): Now that we use ngettext, be sure to
20456 provide a default definition when NLS are not used.
20457
9edcd895
AD
204582001-11-12 Akim Demaille <akim@epita.fr>
20459
20460 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20461 Use @kbd to denote user input.
20462 (Language and Grammar): ANSIfy the example.
20463 Adjust its layout for info/notinfo.
20464 (Location Tracking Calc): Output error messages to stderr.
20465 Output locations in a more GNUtically correct way.
20466 Fix a couple of Englishos.
20467 Adjust @group/@end group pairs.
20468
7da99ede
AD
204692001-11-12 Akim Demaille <akim@epita.fr>
20470
e3aa65c5 20471 %expect was not functioning at all.
7da99ede
AD
20472
20473 * src/conflicts.c (expected_conflicts): Set to -1.
20474 (conflict_report): Use ngettext.
20475 (conflicts_print): Check %expect and make its violation an error.
20476 * doc/bison.texinfo (Expect Decl): Adjust.
20477 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20478 * tests/regression.at (%expect not enough, %expect right)
20479 (%expect too much): New.
20480
ba9dda1a
AD
204812001-11-12 Akim Demaille <akim@epita.fr>
20482
20483 * tests/regression.at (Conflicts): Rename as...
20484 (Unresolved SR Conflicts): this.
20485 (Solved SR Conflicts): New.
20486
337c5bd1
AD
204872001-11-12 Akim Demaille <akim@epita.fr>
20488
20489 * src/reduce.c (print_results): Rename as...
20490 (reduce_output): This.
20491 Output to OUT, passed as argument, instead of output_obstack.
20492 (dump_grammar): Likewise.
20493 (reduce_free): New.
20494 Also free V1.
20495 (reduce_grammar): No longer call reduce_output, since...
20496 * src/print.c (print_results): do it.
20497 * src/main.c (main): Call reduce_free;
20498
c73a41af
AD
204992001-11-12 Akim Demaille <akim@epita.fr>
20500
20501 * src/conflicts.c (print_reductions): Accept OUT as argument.
20502 Output to it, not to output_obstack.
20503 * src/print.c (print_actions): Adjust.
20504
0df87bb6
AD
205052001-11-12 Akim Demaille <akim@epita.fr>
20506
20507 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20508 the result instead of using...
20509 (src_total, rrc_total, src_count, rrc_count): Remove.
20510 (any_conflicts): Remove.
20511 (print_conflicts): Split into...
20512 (conflicts_print, conflicts_output): New.
20513 * src/conflicts.h: Adjust.
20514 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 20515 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
20516 * tests/regression.at (Conflicts): New.
20517 Reported by Tom Lane.
20518
e4d3d4de
AD
205192001-11-12 Akim Demaille <akim@epita.fr>
20520
20521 * tests/regression.at (Invalid input): Remove, duplicate with
20522 ``Invalid input: 1''.
20523
6d7d248e
AD
205242001-11-12 Akim Demaille <akim@epita.fr>
20525
20526 * tests/torture.at (AT_DATA_STACK_TORTURE)
20527 (Exploding the Stack Size with Alloca)
20528 (Exploding the Stack Size with Malloc): New.
20529
e9e4c321
AD
205302001-11-12 Akim Demaille <akim@epita.fr>
20531
20532 * src/bison.simple (YYSTACK_REALLOC): New.
20533 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 20534 Reported by Per Allansson.
e9e4c321 20535
5f7e0832
AD
205362001-11-12 Pascal Bart <pascal.bart@epita.fr>
20537
20538 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20539 define CPP macro, which substitute YYSTYPE by yystype.
20540 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20541 with yyltype/YYLTYPE. This allows inclusion of the generated
20542 header within the parser if the compiler, such as GGC, accepts
20543 multiple equivalent #defines.
20544 From Akim.
20545
e3f1699f
AD
205462001-11-05 Akim Demaille <akim@epita.fr>
20547
20548 * src/reader.c (symbols_output): New, extracted from...
20549 (packsymbols): here.
20550 (reader): Adjust.
20551
65be0866
AD
205522001-11-05 Akim Demaille <akim@epita.fr>
20553
20554 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20555
e4d910bf
AD
205562001-11-05 Akim Demaille <akim@epita.fr>
20557
20558 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20559 pattern.
20560
951366c1
AD
205612001-11-05 Akim Demaille <akim@epita.fr>
20562
20563 * src/options.h (struct option_table_struct): set_flags is void*.
20564 * src/options.c (longopts): Support `--output' and `%output'.
20565 (usage): Adjust.
20566 * src/lex.h (tok_setopt): Remove, replaced with...
20567 (tok_intopt, tok_stropt): these new guys.
20568 * src/lex.c (getopt.h): Not needed.
20569 (token_buffer, unlexed_token_buffer): Not const.
20570 (percent_table): Promote `-' over `_' in directive names.
20571 Active `%name-prefix', `file-prefix', and `output'.
20572 (parse_percent_token): Accept possible arguments to directives.
20573 Promote `-' over `_' in directive names.
20574
d8988b2f
AD
205752001-11-04 Akim Demaille <akim@epita.fr>
20576
20577 * doc/bison.texinfo (Decl Summary): Split the list into
20578 `directives for grammars' and `directives for bison'.
20579 Sort'em.
20580 Add description of `%name-prefix', `file-prefix', and `output'.
20581 Promote `-' over `_' in directive names.
20582 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20583 Simplify the description of `--name-prefix'.
20584 Promote `-' over `_' in directive names.
20585 Promote `--output' over `--output-file'.
20586 Fix the description of `--defines'.
20587 * tests/output.at: Exercise %file-prefix and %output.
20588
6468d18e
AD
205892001-11-02 Akim Demaille <akim@epita.fr>
20590
20591 * doc/refcard.tex: Update.
20592
6b7e85b9
AD
205932001-11-02 Akim Demaille <akim@epita.fr>
20594
20595 * src/symtab.h (SUNDEF): New.
20596 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20597 stand for `uninitialized', instead of 0.
20598 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20599 * src/lex.c (lex): Adjust.
20600
20601 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20602 Number it 0.
20603 Let yylex return it instead of a plain 0.
20604 Reported by Dick Streefland.
20605
cd5aafcf
AD
206062001-11-02 Akim Demaille <akim@epita.fr>
20607
20608 * tests/regression.at (Mixing %token styles): New test.
20609
037ca2f1
AD
206102001-11-02 Akim Demaille <akim@epita.fr>
20611
20612 * src/reader.c (parse_thong_decl): Formatting changes.
20613 (token_translations_init): New, extracted from...
20614 (packsymbols): Here.
20615 Adjust.
20616
270a173c
AD
206172001-11-01 Akim Demaille <akim@epita.fr>
20618
20619 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20620 Check that `9foo.y' produces correct cpp guards.
20621 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20622 guards.
20623 Reported by Wwp.
20624
561f9a30
AD
206252001-11-01 Akim Demaille <akim@epita.fr>
20626
20627 * tests/regression.at (Invalid input: 2): New.
20628 * src/lex.c (unlexed_token_buffer): New.
20629 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20630 too.
20631 Reported by Wwp.
20632
f987e9d2
AD
206332001-11-01 Akim Demaille <akim@epita.fr>
20634
20635 * tests/calc.at: Catch up with 1.30.
20636 * configure.in: Bump to 1.49a.
20637 Adjust to newer Autotest.
20638
0846f581
PB
206392001-10-19 Pascal Bart <pascal.bart@epita.fr>
20640
20641 * src/conflicts.c: Move global variables rrc_total and src_total ...
20642 (print_conflicts): here.
20643 * src/output.c (output): Free global variable user_toknums.
20644 * src/lex.c (token_obstack): Become static.
20645
3c1a79b3
AD
206462001-10-18 Akim Demaille <akim@epita.fr>
20647
20648 * tests/atlocal.in (GCC): Add.
20649 * tests/calc.at: s/m4_match/m4_bmatch/.
20650 s/m4_patsubst/m4_bpatsubst/.
20651 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20652 * configure.in: AC_SUBST(GCC).
20653
5d52e7d0
MA
206542001-10-14 Marc Autret <autret_m@epita.fr>
20655
20656 * src/options.c (create_long_option_table): Fix.
20657
631aa1d3
AD
206582001-10-10 Akim Demaille <akim@epita.fr>
20659
20660 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20661
f6ec6d13
AD
206622001-10-04 Akim Demaille <akim@epita.fr>
20663
20664 * src/reader.c (parse_union_decl): Push the caracters in
20665 union_obstack, not attrs_obstack.
20666
342b8b6e
AD
206672001-10-04 Akim Demaille <akim@epita.fr>
20668
20669 Merge in the branch 1.29.
20670
20671 * src/reader.c (packsymbols): Use a temporary obstack for
20672 `%%tokendef', since output_stack is already used elsewhere.
20673
20674 2001-10-02 Akim Demaille <akim@epita.fr>
20675
20676 Bump 1.29d.
20677
20678 2001-10-02 Akim Demaille <akim@epita.fr>
20679
20680 Version 1.29c.
20681
20682 2001-10-02 Akim Demaille <akim@epita.fr>
20683
20684 * tests/regression.at (Invalid CPP headers): New.
20685 From Alexander Belopolsky.
20686 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20687
20688 2001-10-02 Akim Demaille <akim@epita.fr>
20689
20690 * tests/regression.at (Invalid input): New.
20691 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20692 Reported by Shura.
20693
20694 2001-10-02 Akim Demaille <akim@epita.fr>
20695
20696 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20697
20698 2001-10-02 Akim Demaille <akim@epita.fr>
20699
20700 * src/output.c (output_parser): Assert `skeleton'.
20701 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20702 systems.
20703 From Shura.
20704
20705 2001-10-01 Marc Autret <autret_m@epita.fr>
20706
20707 * src/lex.h: Echo modifications.
20708 * src/lex.c (unlex): Parameter is now token_t.
20709 From Hans Aberg.
20710
20711 2001-10-01 Marc Autret <autret_m@epita.fr>
20712
20713 * src/main.c: Include lex.h.
20714 From Hans Aberg.
20715
20716 2001-09-29 Akim Demaille <akim@epita.fr>
20717
20718 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
20719
20720 2001-09-28 Akim Demaille <akim@epita.fr>
20721
20722 * tests/testsuite.at: Update to newer Autotest.
20723 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
20724
20725 2001-09-27 Akim Demaille <akim@epita.fr>
20726
20727 Position independent wrapper.
20728
20729 * tests/bison: Remove.
20730 * tests/bison.in: New.
20731 * configure.in: Adjust.
20732
20733 2001-09-27 Paul Eggert <eggert@twinsun.com>
20734
20735 Port quotearg fixes from tar 1.13.24.
20736
20737 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
20738 tm to be declared.
20739 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
20740 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
20741
20742 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
20743 * m4/mbrtowc.m4: New file.
20744 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
20745 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
20746
20747 2001-09-27 Akim Demaille <akim@epita.fr>
20748
20749 Bump to 1.29c.
20750
20751 2001-09-27 Akim Demaille <akim@epita.fr>
20752
20753 Version 1.29b.
20754
20755 2001-09-25 Akim Demaille <akim@epita.fr>
20756
20757 * src/system.h: Include `xalloc.h'.
20758 Remove it from the C files.
20759 * src/files.c (output_files): Free the obstacks.
20760 * src/lex.c (init_lex): Rename as...
20761 (lex_init): this.
20762 (lex_free): New.
20763 * src/main.c (main): Use it.
20764
20765 2001-09-24 Marc Autret <autret_m@epita.fr>
20766
20767 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
20768 to output informations in fout (FILE*).
20769 (open_graph, close_graph): Likewise.
20770 (output_graph, output_edge, output_node): Likewise.
20771 * src/vcg.h: Update function prototypes.
20772 * src/print_graph.c (print_graph): Open output graph file.
20773 (print_actions): Adjust.
20774 * src/files.h: Remove extern declaration.
20775 * src/files.c: Remove graph_obstack declaration.
20776 (open_files): Remove graph_obstack initialization.
20777 (output_files): Remove graph_obstack saving.
20778
20779 2001-09-24 Marc Autret <autret_m@epita.fr>
20780
20781 * src/files.c (compute_output_file_names): Fix.
20782
20783 2001-09-24 Marc Autret <autret_m@epita.fr>,
20784 Akim Demaille <akim@epita.fr>
20785
20786 * src/reader.c (reader): Remove call to free_symtab ().
20787 * src/main.c (main): Call it here.
20788 Include symtab.h.
20789 * src/conflicts.c (initialize_conflicts): Rename as...
20790 (solve_conflicts): this.
20791 * src/print.c (print_core, print_actions, print_state)
20792 (print_grammar): Dump to a file instead a `output_obstack'.
20793 (print_results): Dump `output_obstack', and then proceed with the
20794 FILE *.
20795 * src/files.c (compute_output_file_names, close_files): New.
20796 (output_files): Adjust.
20797 * src/main.c (main): Adjust.
20798
20799 2001-09-23 Marc Autret <autret_m@epita.fr>
20800
20801 * src/files.c (compute_header_macro): Computes header macro name
20802 from spec_defines_file when given.
20803
20804 2001-09-23 Marc Autret <autret_m@epita.fr>
20805
20806 * src/files.c (output_files): Add default extensions.
20807
20808 2001-09-22 Akim Demaille <akim@epita.fr>
20809
20810 * src/conflicts.c (finalize_conflicts): Rename as...
20811 (free_conflicts): this.
20812
20813 2001-09-22 Akim Demaille <akim@epita.fr>
20814
20815 * src/gram.c (gram_free): Rename back as...
20816 (dummy): this.
20817 (output_token_translations): Free `token_translations'.
20818 * src/symtab.c (free_symtab): Free the tag field.
20819
20820 2001-09-22 Akim Demaille <akim@epita.fr>
20821
20822 Remove `translations' as it is always set to true.
20823
20824 * src/gram.h: Adjust.
20825 * src/reader.c (packsymbols, parse_token_decl): Adjust
20826 * src/print.c (print_grammar): Adjust.
20827 * src/output.c (output_token_translations): Adjust.
20828 * src/lex.c (lex): Adjust.
20829 * src/gram.c: Be sure the set pointers to NULL.
20830 (dummy): Rename as...
20831 (gram_free): this.
20832
20833 2001-09-22 Akim Demaille <akim@epita.fr>
20834
20835 * configure.in: Invoke AM_LIB_DMALLOC.
20836 * src/system.h: Use dmalloc.
20837 * src/LR0.c: Be sure to have pointers initialized to NULL.
20838 (allocate_itemsets): Allocate kernel_items only if needed.
20839
20840 2001-09-22 Akim Demaille <akim@epita.fr>
20841
20842 * configure.in: Bump to 1.29b.
20843 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
20844 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
20845 need xmalloc.c in calc.y.
20846 From Pascal Bart.
20847
20848 2001-09-21 Akim Demaille <akim@epita.fr>
20849
20850 Version 1.29a.
20851 * Makefile.maint, config/config.guess, config/config.sub,
20852 * config/missing: Update from masters.
20853 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
20854 upon package.m4.
20855 * configure.in (ALL_LINGUAS): Add `tr'.
20856
20857 2001-09-21 Akim Demaille <akim@epita.fr>
20858
20859 * tests/Makefile.am (package.m4): Move to...
20860 ($(srcdir)/$(TESTSUITE)): here.
20861
20862 2001-09-20 Akim Demaille <akim@epita.fr>
20863
20864 * src/complain.c: No longer try to be standalone: use system.h.
20865 Don't assume __STDC__ is defined to 1. Just test if it is defined.
20866 * src/complain.h: Likewise.
20867 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
20868 Remove the unused variable `n'.
20869 From Albert Chin-A-Young.
20870
20871 2001-09-18 Marc Autret <autret_m@epita.fr>
20872
20873 * doc/bison.1: Update.
20874 * doc/bison.texinfo (Bison Options): Update --defines and --graph
20875 descriptions.
20876 (Option Cross Key): Update.
20877 Add --graph.
20878
20879 2001-09-18 Marc Autret <autret_m@epita.fr>
20880
20881 * tests/regression.at: New test (comment in %union).
20882
20883 2001-09-18 Marc Autret <autret_m@epita.fr>
20884
20885 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
20886 do that.
20887 Reported by Keith Browne.
20888
20889 2001-09-18 Marc Autret <autret_m@epita.fr>
20890
20891 * tests/output.at: Add tests for --defines and --graph.
20892
20893 2001-09-18 Marc Autret <autret_m@epita.fr>
20894
20895 * tests/output.at: Removes tests of %{header,src}_extension features.
20896
20897 2001-09-18 Akim Demaille <akim@epita.fr>
20898
20899 * tests/Makefile.am (package.m4): New.
20900 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
20901 (_AT_CHECK_CALC_ERROR): Likewise.
20902 Factor the `, ' part of verbose error messages.
20903
20904 2001-09-18 Marc Autret <autret_m@epita.fr>
20905
20906 * src/getargs.c (longopts): Declare --defines and --graph as options
20907 with optional arguments.
20908 * src/files.h: Add extern declarations.
20909 * src/files.c (spec_graph_file, spec_defines_file): New.
20910 (output_files): Update.
20911 Remove CPP-outed code.
20912
20913 2001-09-18 Marc Autret <autret_m@epita.fr>
20914
20915 Turn off %{source,header}_extension feature.
20916
20917 * src/files.c (compute_exts_from_gf): Update.
20918 (compute_exts_from_src): Update.
20919 (output_files): CPP-out useless code.
20920 * src/files.h: Remove {header,source}_extension extern declarations.
20921 * src/reader.c (parse_dquoted_param): CPP-out.
20922 (parse_header_extension_decl): Remove.
20923 (parse_source_extension_decl): Remove.
20924 (read_declarations): Remove cases tok_{hdrext,srcext}.
20925 * src/lex.c (percent_table): Remove {header,source}_extension entries.
20926 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
20927
20928 2001-09-10 Akim Demaille <akim@epita.fr>
20929
20930 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
20931 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
20932 (AT_CHECK_OUTPUT): this.
20933 Merely check ls' exit status, its output is useless.
20934
20935 2001-09-10 Akim Demaille <akim@epita.fr>
20936
20937 * tests/calc.at: Use m4_match.
20938 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
20939
20940 2001-09-10 Marc Autret <autret_m@epita.fr>,
20941 Akim Demaille <akim@epita.fr>
20942
20943 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
20944 enum color_e.
20945 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
20946 to `normal'.
20947 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
20948 * src/lex.h: Adjust prototype.
20949 (token_t): Add `tok_undef'.
20950 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
20951 (parse_percent_token): Now returns token_t.
20952 Add default statement in switch.
20953 (lex): Separate `c' as an input variable, from the token_t result
20954 part.
20955 (unlexed): Is a token_t.
20956
20957 2001-09-10 Akim Demaille <akim@epita.fr>
20958
20959 * configure.in: Bump to 1.29a.
20960
20961 2001-09-07 Akim Demaille <akim@epita.fr>
20962
20963 Version 1.29.
20964
20965 2001-08-30 Akim Demaille <akim@epita.fr>
20966
20967 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
20968 * m4/atconfig.m4: Remove.
20969 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
20970 * tests/bison: New.
20971 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
20972 m4_if, m4_patsubst, and m4_regexp.
20973 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
20974 `input' file instead of echo.
20975
20976 2001-08-29 Akim Demaille <akim@epita.fr>
20977
20978 Bump to 1.28e.
20979
20980 2001-08-29 Akim Demaille <akim@epita.fr>
20981
20982 Version 1.28d.
20983
20984 2001-08-29 Paul Eggert <eggert@twinsun.com>
20985
20986 * src/bison.simple (yyparse): Don't take the address of an
20987 item before the start of an array, as that doesn't conform to
20988 the C Standard.
20989
20990 2001-08-29 Robert Anisko <anisko_r@epita.fr>
20991
20992 * doc/bison.texinfo (Location Tracking Calc): New node.
20993
20994 2001-08-29 Paul Eggert <eggert@twinsun.com>
20995
20996 * src/output.c (output): Do not define const, as this now
20997 causes more problems than it cures.
20998
20999 2001-08-29 Akim Demaille <akim@epita.fr>
21000
21001 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21002 the nodes.
21003 Be sure to tag the `detailmenu'.
21004
21005 2001-08-29 Akim Demaille <akim@epita.fr>
21006
21007 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21008 download in a tmp dir.
21009
21010 2001-08-28 Marc Autret <autret_m@epita.fr>
21011
21012 * config/depcomp: New file.
21013
21014 2001-08-28 Marc Autret <autret_m@epita.fr>
21015
21016 * doc/bison.1 (mandoc): Adjust.
21017 From Juan Manuel Guerrero.
21018
21019 2001-08-28 Marc Autret <autret_m@epita.fr>
21020
21021 * src/print_graph.c (print_state): Fix.
21022
21023 2001-08-27 Marc Autret <autret_m@epita.fr>
21024
21025 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21026 char * members.
21027 Echo modifications to the functions prototypes.
21028 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21029
21030 2001-08-27 Marc Autret <autret_m@epita.fr>
21031
21032 * src/vcg.c: Include `xalloc.h'.
21033 (add_colorentry): New.
21034 (add_classname): New.
21035 (add_infoname): New.
21036 * src/vcg.h: Add new prototypes.
21037
21038 2001-08-27 Akim Demaille <akim@epita.fr>
21039
21040 * Makefile.maint: Sync. again with CVS Autoconf.
21041
21042 2001-08-27 Akim Demaille <akim@epita.fr>
21043
21044 * Makefile.maint: Formatting changes.
21045 (po-update, cvs-update, update): New targets.
21046 (AMTAR): Remove.
21047
21048 2001-08-27 Akim Demaille <akim@epita.fr>
21049
21050 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21051 * Makefile.maint: Sync. with CVS Autoconf.
21052
21053 2001-08-27 Marc Autret <autret_m@epita.fr>
21054
21055 * src/vcg.h (struct infoname_s): New.
21056 (struct colorentry_s): New.
21057 (graph_s): New fields {vertical,horizontal}_order in structure.
21058 Add `infoname' field.
21059 Add `colorentry' field;
21060 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21061 (G_HORIZONTAL_ORDER): New.
21062 (G_INFONAME): New.
21063 (G_COLORENTRY): New.
21064 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21065 Add output of `infoname'.
21066 Add output of `colorentry'.
21067
21068 2001-08-27 Marc Autret <autret_m@epita.fr>
21069
21070 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21071 This one shadowed a global parameter.
21072
21073 2001-08-24 Marc Autret <autret_m@epita.fr>
21074
21075 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21076 instead of `unsigned'.
21077 (print_state): Do not call obstack_object_size () in obstack_grow ()
21078 to avoid macro variables shadowing.
21079
21080 2001-08-23 Marc Autret <autret_m@epita.fr>
21081
21082 * src/lex.c (percent_table): Typo: s/naem/name/.
21083 Add graph option.
21084 Normalize new options declarations.
21085
21086 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21087
21088 * tests/suite.at: Exercise %header_extension and %source_extension.
21089
21090 2001-08-16 Marc Autret <autret_m@epita.fr>
21091
21092 * src/reader.c (parse_dquoted_param): New.
21093 (parse_header_extension_decl): Use it.
21094 (parse_source_extension_decl): Likewise.
21095
21096 2001-08-16 Marc Autret <autret_m@epita.fr>
21097
21098 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21099 (get_xxxx_str): Use assert () instead of complain ().
21100 Remove return invokations in default cases.
21101 (get_decision_str): Modify default behaviour. Remove second argument.
21102 Echo modifications on calls.
21103 (output_graph): Fix.
21104
21105 2001-08-16 Marc Autret <autret_m@epita.fr>
21106
21107 * src/getargs.c (usage): Update with ``-g, --graph''.
21108
21109 2001-08-16 Marc Autret <autret_m@epita.fr>
21110
21111 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21112 (Option Cross Key): Likewise.
21113 * doc/bison.1: Update.
21114
1c8c2190
PB
211152001-09-25 Pascal Bart <pascal.bart@epita.fr>
21116
21117 * src/output.c (output_master_parser): Don't finish action_obstack.
21118 (output_parser): Don't care about the muscle action, here.
21119 (prepare): Copy the action_obstack in the action muscle.
21120 (output): Free action_obstack.
21121
180d45ba
PB
211222001-09-23 Pascal Bart <pascal.bart@epita.fr>
21123
21124 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21125 will contain `%union' declaration.
21126 (parse_union_decl): Delete #line directive output.
21127 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21128 informations about %union.
21129 (parse_union_decl): Copy the union_obstack in the muscle stype.
21130 * src/bison.simple: Add new #line directive.
21131 Add typdef %%stype YYSTYPE.
21132
c51d1a19
PB
211332001-09-23 Pascal Bart <pascal.bart@epita.fr>
21134
21135 * src/bison.simple: Add new `#line' directive.
21136
6f9344da
PB
211372001-09-22 Pascal Bart <pascal.bart@epita.fr>
21138
21139 * src/bison.simple: New `#line' directive.
21140 * src/output.c (output_parser): Support new dynamic muscle input_line.
21141
652def80
MA
211422001-09-22 Marc Autret <autret_m@epita.fr>
21143
21144 * src/output.c (output_master_parser): New.
21145 (output_parser): Be more re-entrant.
21146
25b222fa
MA
211472001-09-21 Marc Autret <autret_m@epita.fr>
21148
21149 * src/reader.c (copy_definition, parse_union_decl): Update and use
21150 `linef' muscle.
21151 (copy_action): Likewise.
21152 Use obstack_1grow ().
21153 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21154
6bc35ae5
MA
211552001-09-21 Marc Autret <autret_m@epita.fr>
21156
21157 * src/options.c (option_table): Adjust.
21158 * src/lex.c (parse_percent_token): Fix.
21159
c0629aa1
PB
211602001-09-20 Pascal Bart <pascal.bart@epita.fr>
21161
21162 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21163
82b6d266
PB
211642001-09-20 Pascal Bart <pascal.bart@epita.fr>
21165
21166 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21167 is now an option_table_struct*.
21168 (option_strcmp): New function option_strcmp.
21169 (parse_percent_token): Call option_strcmp.
21170 * src/getargs.c (xalloc.h, options.h): Include it.
21171 (getargs): Call create_long_option_table.
21172 (getargs): Free longopts at the end of the function.
21173 (shortopts): Move in options.c.
21174 * src/options.c (create_long_option_table): New function. Convert
21175 information from option_table to option structure.
21176 * src/reader.c (options.h): Include it.
21177
21178 * src/Makefile.am: Adjust.
21179 * src/options.c (option_table): Create from longopts and percent_table.
21180 * src/getargs.c (longopts): Delete.
21181 * src/lex.c (struct percent_table_struct): Delete.
21182 (percent_table): Delete.
21183 (options.h): Include it.
21184 * src/options.c: Create.
21185 * src/options.h: Create.
21186 Declare enum opt_access_e.
21187 Define struct option_table_struct.
21188
75f5aaea
MA
211892001-09-20 Marc Autret <autret_m@epita.fr>
21190
21191 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21192 sections of Bison.
21193
f508cb0a
PB
211942001-09-19 Pascal Bart <pascal.bart@epita.fr>
21195
21196 * src/bison.simple: s/%%filename/%%skeleton.
21197 * src/muscle_tab.c (getargs.h): Include it.
21198 (muscle_init): Insert new muscle skeleton.
21199
13105fc1
PB
212002001-09-18 Pascal Bart <pascal.bart@epita.fr>
21201
21202 * src/output.c (output_parser): Delete unused variable actions_dumped.
21203
b0c4483e
PB
212042001-09-07 Pascal Bart <pascal.bart@epita.fr>
21205
21206 * src/output.c (output): Delete call to reader_output_yylsp.
21207 * src/reader.c (reader): Likewise.
ba0fe3c7 21208 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21209
11d82f03
MA
212102001-09-02 Marc Autret <autret_m@epita.fr>
21211
21212 * src/reader.c: Include muscle_tab.h.
21213 (parse_union_decl): Update.
21214 (parse_macro_decl): Rename parse_muscle_decl.
21215 Update to use renamed functions and variable.
21216 (read_declarations, copy_action, read_additionnal_code, : Updated
21217 with correct variables and functions names.
21218 (packsymbols, reader): Likewise.
342b8b6e 21219
11d82f03 21220 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21221
11d82f03
MA
21222 * src/output.c: Include muscle_tab.h
21223 In all functions using macro_insert, change by using muscle_insert ().
21224 (macro_obstack): Rename muscle_obstack.
21225 Echo modifications in the whole file.
21226 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21227 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21228 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21229
21230 * src/muscle_tab.h: Update double inclusion macros.
21231 (macro_entry_s): Rename muscle_entry_s.
21232 Update prototypes.
342b8b6e 21233
11d82f03
MA
21234 * src/muscle_tab.c: Include muscle_tab.h.
21235 Rename macro_tabble to muscle_table.
21236 (mhash1, mhash2, mcmp): Use muscle_entry.
21237 (macro_init): Rename muscle_init. Update.
21238 (macro_insert): Rename muscle_insert. Update.
21239 (macro_find): Rename muscle_find. Update.
21240
21241 * src/main.c: Include muscle_tab.h.
21242 (main): Call muscle_init ().
21243 * src/Makefile.am (bison_SOURCES): Echo modifications.
21244
93a37297
MA
212452001-09-02 Marc Autret <autret_m@epita.fr>
21246
f753cd62 21247 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21248
f753cd62
MA
21249 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21250
212512001-09-02 Marc Autret <autret_m@epita.fr>
21252
21253 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21254
682d48cd
PB
212552001-09-01 Pascal Bart <pascal.bart@epita.fr>
21256
342b8b6e 21257 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21258 filename.
21259
087c8fda
MA
212602001-09-01 Marc Autret <autret_m@epita.fr>
21261
21262 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21263 to an explicit value to activate the feature. We do it here.
21264
dda680cb
PB
212652001-08-31 Pascal Bart <pascal.bart@epita.fr>
21266
21267 * src/output.c (prepare): Delete the `filename' muscule insertion.
21268 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21269 (parse_union_decl): Likewise.
21270 * src/macrotab.c (macro_init): Initialize filename by infile.
21271
9e644e64
MA
212722001-08-31 Marc Autret <autret_m@epita.fr>
21273
21274 * src/bison.simple (YYLSP_NEEDED): New definition.
21275 * src/output.c (prepare): Add macro insertion of `locations_flag'
21276
17da6427
PB
212772001-08-31 Pascal Bart <pascal.bart@epita.fr>
21278
21279 * src/output.c (prepare): Delete insertion of previous muscles,
21280 and insert the `prefix' muscles.
21281 * src/macrotab.c (macro_init): Likewise.
21282 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21283 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21284 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21285 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21286 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21287 name_prefix.
21288
e8cb70b9
PB
212892001-08-31 Pascal Bart <pascal.bart@epita.fr>
21290
21291 * src/main.c (main): Standardize.
21292 * src/output.c (output_table_data, output_parser): Likewise.
21293 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21294
63c2d5de
MA
212952001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21296
342b8b6e 21297 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21298 %%epilogue.
21299 * src/output.c (output): Rename %%declarations to %%prologue.
21300 * src/bison.simple: Echo modifications.
342b8b6e 21301
d8cb5183
MA
213022001-08-31 Marc Autret <autret_m@epita.fr>
21303
21304 * src/reader.c (readgram): CleanUp.
21305 (output_token_defines): Likewise.
21306 (packsymbols): Likewise.
21307 (reader): Likewise.
21308 * src/output.c (output): CPP-out useless code.
21309
6c686258
PB
213102001-08-31 Pascal Bart <pascal.bart@epita.fr>
21311
342b8b6e 21312 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21313 output_trailers and output_headers.
21314 * src/output.h: Remove obsolete functions prototypes of output_headers
21315 and output_trailers.
21316
8f451ef7
PB
213172001-08-30 Pascal Bart <pascal.bart@epita.fr>
21318
21319 * src/main.c: Include macrotab.h.
342b8b6e 21320 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
21321 Adjust functions prototypes.
21322 * src/macrotab.c (macro_insert): Constify key and value.
21323 (macro_find): Constify key.
21324 (macro_insert): Include 'xalloc.h'
21325 (macro_insert): Use XMALLOC.
21326 (macro_find): Constify return value.
21327 * src/output.c (output_table_data): Rename table to table_data.
21328 (output_parser): Constify macro_key, macro_value.
21329
997b6fd0 213302001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
21331
21332 * src/reader.c (parse_skel_decl): New.
342b8b6e 21333 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
21334 * src/lex.h (token_t): New token `tok_skel'.
21335 * src/lex.c (percent_table): Add skeleton option entry.
21336 Standardize.
21337
ff48177d
MA
213382001-08-29 Marc Autret <autret_m@epita.fr>
21339
21340 * src/bison.simple: Add %%user_code directive at the end.
21341 * src/reader.c (read_additionnal_code): New.
21342 (reader): Use it.
21343 * src/output.c (output_program): Remove.
21344 (output): Update.
21345
b33160bf
MA
213462001-08-28 Marc Autret <autret_m@epita.fr>
21347
21348 * src/output.c (output_actions): Clean up.
4e5caae2 21349 (output_gram): CPP-out useless code.
b33160bf
MA
21350 * src/reader.c (reader): Clean up, CPP-out useless code.
21351
d1a2daf7
PB
213522001-08-28 Pascal Bart <pascal.bart@epita.fr>
21353
342b8b6e 21354 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 21355 directive.
d1a2daf7
PB
21356 * src/bison.simple: Add `%%definitions'.
21357
2b763dfe
MA
213582001-08-28 Marc Autret <autret_m@epita.fr>
21359
21360 * config/depcomp: New file.
21361
f1a87ef6
PE
213622001-08-27 Paul Eggert <eggert@twinsun.com>
21363
21364 * src/bison.simple (yyparse): Don't take the address of an
21365 item before the start of an array, as that doesn't conform to
21366 the C Standard.
21367
82e236e2
RA
213682001-08-27 Robert Anisko <robert.anisko@epita.fr>
21369
f1a87ef6 21370 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
21371 obstack. It was done too late here.
21372
21373 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21374 completely wrong.
21375 (reader): Initialize the macro obstack here, since we need it to grow
21376 '%define' directives.
21377
21378 * src/reader.h: Declare the macro obstack as extern.
21379
b0cfa28a
RA
213802001-08-27 Robert Anisko <robert.anisko@epita.fr>
21381
21382 * src/output.c (output_parser): Fix. Store single '%' characters in
21383 the output obstack instead of throwing them away.
21384
6fc74234
AD
213852001-08-27 Akim Demaille <akim@epita.fr>
21386
21387 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21388
9c76d118
RA
213892001-08-25 Robert Anisko <robert.anisko@epita.fr>
21390
21391 * lib/Makefile.am: Adjust.
21392
a8289c62
RA
213932001-08-25 Robert Anisko <robert.anisko@epita.fr>
21394
21395 * src/bison.simple: Update and add '%%' directives.
21396
b6610515
RA
213972001-08-25 Robert Anisko <robert.anisko@epita.fr>
21398
21399 * src/reader.c (reader): Remove calls to 'output_headers' and
21400 'output_trailers'. Remove some C output.
21401 (readgram): Disable a piece of code that was writing a default
21402 definition for 'YYSTYPE'.
21403 (reader_output_yylsp): Remove.
21404 (packsymbols): Output token defintions to a macro.
21405 (copy_definition): Disable C output.
6fc74234 21406
b6610515
RA
21407 * src/reader.c (parse_macro_decl): New function used to parse macro
21408 declarations.
21409 (copy_string2): Put the body of copy_string into this new function.
21410 Add a parameter to let the caller choose whether he wants to copy the
21411 string delimiters or not.
21412 (copy_string): Be a simple call to copy_string2 with the last argument
21413 bound to true.
21414 (read_declarations): Add case for macro definition.
21415 (copy_identifier): New.
6fc74234 21416 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
21417 rather than lex.
21418
26f609ff
RA
214192001-08-25 Robert Anisko <robert.anisko@epita.fr>
21420
21421 * src/output.c (prepare): Add prefixed names.
21422 (output_parser): Output semantic actions.
21423 (output_parser): Fix bug on '%%line' directives.
6fc74234 21424
26f609ff
RA
21425 * src/output.c (output_headers): Remove. The C code printed by this
21426 function should now be in the skeletons.
21427 (output_trailers): Remove.
21428 (output): Disable call to 'reader_output_yylsp'.
21429 (output_rule_data): Do not output tables to the table obstack.
21430
21431 * src/output.c: Remove some C dedicated output.
21432 Improve the use of macro and output obstacks.
21433 (output_defines): Remove.
6fc74234 21434
26f609ff
RA
21435 * src/output.c (output_token_translations): Associate 'translate'
21436 table with a macro. No output to the table obstack.
21437 (output_gram): Same for 'rhs' and 'prhs'.
21438 (output_stos): Same for 'stos'.
21439 (output_rule_data): Same for 'r1' and 'r2'.
21440 (token_actions): Same for 'defact'.
21441 (goto_actions): Same for 'defgoto'.
21442 (output_base): Same for 'pact' and 'pgoto'.
21443 (output_table): Same for 'table'.
21444 (output_check): Same for 'check'.
6fc74234 21445
26f609ff
RA
21446 * src/output.c (output_table_data): New function.
21447 (output_short_table): Remove.
21448 (output_short_or_char_table): Remove.
6fc74234 21449
26f609ff
RA
21450 * src/output.c (output_parser): Replace most of the skeleton copy code
21451 with something new. Skeletons are now processed character by character
21452 rather than line by line, and Bison looks for '%%' macros. This is the
21453 first step in making Bison's output process (a lot) more flexible.
21454 (output_parser): Use the macro table.
21455
6f43b113
RA
214562001-08-25 Robert Anisko <robert.anisko@epita.fr>
21457
21458 * src/main.c (main): Initialize the macro table.
21459
dd3127cf
RA
214602001-08-25 Robert Anisko <robert.anisko@epita.fr>
21461
21462 * src/lex.c (percent_table): Add tok_define.
21463 * src/lex.h: Add tok_define.
21464
aa321494
RA
214652001-08-25 Robert Anisko <robert.anisko@epita.fr>
21466
21467 * src/macrotab.c: New file.
21468 * src/macrotab.h: New file.
21469 * src/Makefile.am: Update.
21470
68bd3b6b
RA
214712001-08-25 Robert Anisko <robert.anisko@epita.fr>
21472
21473 * lib/hash.c: New file.
21474 * lib/hash.h: New file.
21475 * lib/Makefile.am: Update.
21476
45f8dd1e
AD
214772001-08-15 Akim Demaille <akim@epita.fr>
21478
21479 Version 1.28c.
21480
40a64a7a 214812001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
21482
21483 * src/reader.c (readgram): Indent output macro YYSTYPE.
21484 (packsymbols): Likewise.
21485 (output_token_defines): Likewise.
21486 * src/files.c: Standardize.
21487 (compute_header_macro): New.
21488 (defines_obstack_save): New. Use compute_header_macro.
21489 (output_files): Update. Use defines_obstack_save.
21490
f9a8293a
AD
214912001-08-15 Akim Demaille <akim@epita.fr>
21492
21493 * doc/bison.texinfo (Table of Symbols): Document
21494 YYSTACK_USE_ALLOCA.
21495
150ca7a7
AD
214962001-08-15 Akim Demaille <akim@epita.fr>
21497
21498 * missing: Update from CVS Automake.
21499 * config/config.guess, config/config.sub, config/texinfo.tex:
21500 Update from gnu.org.
21501
69b5cec4
AD
215022001-08-15 Akim Demaille <akim@epita.fr>
21503
21504 * Makefile.maint: Sync with CVS Autoconf.
21505
f2b5126e
PB
215062001-08-14 Pascal Bart <pascal.bart@epita.fr>
21507
69b5cec4 21508 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
21509 `fdl.texi'.
21510 * doc/fdl.texi: Add to package.
21511
4ecbf796
MA
215122001-08-14 Marc Autret <autret_m@epita.fr>
21513
21514 Turn on %{source,header}_extension features.
21515
69b5cec4 21516 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
21517 source_extension.
21518 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 21519 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
21520 between options.
21521
95fb5662
MA
215222001-08-14 Marc Autret <autret_m@epita.fr>
21523
21524 * src/files.c (compute_base_names): Add extensions computing when
21525 `--file-prefix' used.
21526 Standardize function calls.
21527
78d09da9
MA
215282001-08-13 Marc Autret <autret_m@epita.fr>
21529
69b5cec4 21530 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
21531 defining it (defined but null disables alloca).
21532
5a009f2c
MA
215332001-08-13 Marc Autret <autret_m@epita.fr>
21534
21535 * src/bison.simple (_yy_memcpy): CPP reformat.
21536
1e41465a
PB
215372001-08-13 Pascal Bart <pascal.bart@epita.fr>
21538
21539 * tests/atconfig.in (CPPFLAGS): Fix.
21540
c67a198d
PB
215412001-08-10 Pascal Bart <pascal.bart@epita.fr>
21542
79282c6c 21543 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
21544 `gpl.texi'.
21545 * doc/gpl.texi: Add to package.
21546
09a6de7e
MA
215472001-08-10 Marc Autret <autret_m@epita.fr>
21548
21549 * src/print_graph.h: Fix.
21550 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21551
b77b9ee0
AD
215522001-08-10 Akim Demaille <akim@epita.fr>
21553
21554 * src/system.h: Provide default declarations for stpcpy, strndup,
21555 and strnlen.
21556
3e259915
MA
215572001-08-10 Robert Anisko <anisko_r@epita.fr>
21558
21559 * doc/bison.texinfo (Locations): Update @$ stuff.
21560
ca96bc2d
MA
215612001-08-09 Robert Anisko <anisko_r@epita.fr>
21562
21563 * src/bison.simple (YYLLOC_DEFAULT): Update.
21564 (yyparse): Adjust.
21565
fdc6758b
MA
215662001-08-08 Marc Autret <autret_m@epita.fr>
21567
b77b9ee0 21568 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
21569 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21570 Reported by Fabrice Bauzac.
957d4dbf 21571
600cad3b
MA
215722001-08-08 Marc Autret <autret_m@epita.fr>
21573
21574 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21575 * src/vcg.c (output_node): Fix.
21576 * src/vcg.h: Cleanup.
21577 * src/print_graph.c: Add comments.
b77b9ee0 21578 (node_output_size): New global variable. Simplify the formatting of
600cad3b 21579 the VCG graph output.
b77b9ee0 21580 (print_actions): Unused code is now used. It notifies the final state
600cad3b 21581 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 21582 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
21583 blue.
21584 Get the current node name and node_obstack by argument.
21585 (node_obstack): New variable.
21586 (print_state): Manage node_obstack.
21587 (print_core): Use node_obstack given by argument.
21588 A node is not only computed here but in print_actions also.
21589 (print_graph): CPP out useless code instead of commenting it.
21590
976e528f
AD
215912001-08-07 Pascal Bart <pascal.bart@epita.fr>
21592
21593 * tests/atconfig.in (CPPFLAGS): Fix.
21594
20e8e5ca
AD
215952001-08-07 Akim Demaille <akim@epita.fr>
21596
21597 * src/print_graph.c (quote): New.
21598 (print_core): Use it.
21599
957d4dbf 216002001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 21601
3e3da797
AD
21602 * src/vcg.c (complain.h): Include it.
21603 Unepitaize `return' invocations.
c4b66126 21604 [NDEBUG] (main): Remove.
79282c6c 21605 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
21606 * src/files.c (open_files): Initialize graph_obstack.
21607 * src/print_graph.c (print_actions): CPP out useless code.
21608 (print_core): Don't output the last `\n' in labels.
21609 Use `quote'.
21610 * src/files.c (output_files): Output the VCG file.
21611 * src/main.c (main): Invoke print_graph ();
3e3da797 21612
957d4dbf 216132001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
21614
21615 Automaton VCG graph output.
21616 Using option ``-g'' or long option ``--graph'', you can generate
21617 a gram_filename.vcg file containing a VCG description of the LALR (1)
21618 automaton of your grammar.
21619
21620 * src/main.c: Call to print_graph() function.
21621 * src/getargs.h: Update.
21622 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21623 (graph_flag): New flag.
21624 (longopts): Update.
21625 (getargs): Add case `g'.
21626 * src/files.c (graph_obstack): New obstack struct.
21627 (open_files): Initialize new obstack.
21628 (output_files): Saves graph_obstack if required.
21629 * src/files.h (graph_obstack): New extern declaration.
21630 * src/Makefile.am: Add new source files.
21631
927c1557 216322001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
21633
21634 * src/print_graph.c, src/print_graph.h (graph): New.
21635 * src/vcg.h: New file.
21636 * src/vcg.c: New file, VCG graph handling.
21637
7333d403
AD
216382001-08-06 Marc Autret <autret_m@epita.fr>
21639
21640 Add of %source_extension and %header_extension which specify
21641 the source or/and the header output file extension.
21642
21643 * src/files.c (compute_base_names): Remove initialisation of
21644 src_extension and header_extension.
21645 (compute_exts_from_gf): Update.
21646 (compute_exts_from_src): Update.
21647 (output_files): Update.
21648 * src/reader.c (parse_header_extension_decl): New.
21649 (parse_source_extension_decl): New.
21650 (read_declarations): New case statements for the new tokens.
21651 * src/lex.c (percent_table): Add entries for %source_extension
21652 and %header_extension.
21653 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21654
84163231
AD
216552001-08-06 Marc Autret <autret_m@epita.fr>
21656
21657 * configure.in: Bump to 1.28c.
21658 * doc/bison.texinfo: Texinfo thingies.
21659
8303fc42
AD
216602001-08-04 Pascal Bart <pascal.bart@epita.fr>
21661
21662 * tests/atconfig.in (CPPFLAGS): Add.
21663 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21664
70a84437
AD
216652001-08-03 Akim Demaille <akim@epita.fr>
21666
21667 Version 1.28b.
21668
2ce10144
AD
216692001-08-03 Akim Demaille <akim@epita.fr>
21670
21671 * tests/Makefile.am (check-local): Ship testsuite.
21672 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21673 Include `string.h'.
21674
1e3e4bc1
AD
216752001-08-03 Akim Demaille <akim@epita.fr>
21676
21677 * configure.in: Try using -Wformat when compiling.
21678
42b45b7f
AD
216792001-08-03 Akim Demaille <akim@epita.fr>
21680
21681 * configure.in: Bump to 1.28b.
21682
8f13fe33
AD
216832001-08-03 Akim Demaille <akim@epita.fr>
21684
21685 * src/complain.c: Adjust strerror_r portability issues.
21686
b37ba92c
AD
216872001-08-03 Akim Demaille <akim@epita.fr>
21688
21689 Version 1.28a.
21690
b0ce6046
AD
216912001-08-03 Akim Demaille <akim@epita.fr>
21692
21693 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21694 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21695 * src/getargs.c: Include complain.h.
21696 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21697 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21698
d01c415b
AD
216992001-08-03 Akim Demaille <akim@epita.fr>
21700
21701 * src/reader.c (readgram): Display hidden chars in error messages.
21702
459dd1a6
AD
217032001-08-03 Akim Demaille <akim@epita.fr>
21704
21705 Update to gettext 0.10.39.
21706
53b74c0c
AD
217072001-08-03 Akim Demaille <akim@epita.fr>
21708
21709 * lib/strspn.c: New.
21710
234a3be3
AD
217112001-08-01 Marc Autret <autret_m@epita.fr>
21712
21713 * doc/bison.texinfo: Update.
21714 * doc/bison.1 (mandoc): Update.
21715 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
21716 * src/files.c: Support output files extensions computing.
21717 (src_extension): New static variable.
21718 (header_extension): New static variable.
21719 (tr): New function.
21720 (get_extension_index): New function, gets the index of an extension
21721 filename in a string.
21722 (compute_exts_from_gf): New function, computes extensions from the
21723 grammar file extension.
21724 (compute_exts_from_src): New functions, computes extensions from the
21725 C source file extension, file given by ``-o'' option.
21726 (compute_base_names): Update.
21727 (output_files): Update.
21728
847bf1f5
AD
217292001-08-01 Robert Anisko <anisko_r@epita.fr>
21730
d995fee7 21731 * doc/bison.texi: Document @$.
847bf1f5
AD
21732 (Locations): New section.
21733
d074a105
AD
217342001-07-18 Akim Demaille <akim@epita.fr>
21735
21736 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
21737 * config/prev-version.txt, config/move-if-change: New.
21738 * Makefile.am: Adjust.
21739
3419715d
AD
217402001-07-08 Pascal Bart <pascal.bart@epita.fr>
21741
21742 * src/bison.simple (yyparse): Suppress warning `comparaison
21743 between signed and unsigned'.
21744
62ab6972
AD
217452001-07-05 Pascal Bart <pascal.bart@epita.fr>
21746
21747 * src/getargs.h (raw_flag): Remove.
21748 * src/getargs.c: Die on `-r'/`--raw'.
21749 * src/lex.c (parse_percent_token): Die on `%raw'.
21750 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
21751 * tests/calc.at: Suppress test with option `--raw'.
21752
1e24cc5b
AD
217532001-07-14 Akim Demaille <akim@epita.fr>
21754
21755 * config/: New.
21756 * configure.in: Require Autoconf 2.50.
21757 Update to gettext 0.10.38.
21758
32dfccf8
AD
217592001-03-16 Akim Demaille <akim@epita.fr>
21760
21761 * doc/bison.texinfo: ANSIfy the examples.
21762
cd5bd6ac
AD
217632001-03-16 Akim Demaille <akim@epita.fr>
21764
21765 * getargs.c (skeleton): New variable.
21766 (longopts): --skeleton is a new option.
21767 (shortopts, getargs): -S is a new option.
21768 * getargs.h: Declare skeleton.
21769 * output.c (output_parser): Use it.
21770
5141b016
AD
217712001-03-16 Akim Demaille <akim@epita.fr>
21772
21773 * m4/strerror_r.m4: New.
21774 * m4/error.m4: Run AC_FUNC_STRERROR_R.
21775 * lib/error.h, lib/error.c: Update.
21776
447992b9
AD
217772001-03-16 Akim Demaille <akim@epita.fr>
21778
21779 * src/getargs.c (longopts): Clean up.
21780
274d42ce
AD
217812001-02-21 Akim Demaille <akim@epita.fr>
21782
21783 * src/reader.c (gensym): `gensym_count' is your own.
21784 Use a static buf to create the symbol name, as token_buffer is no
21785 longer a buffer.
21786
22c821f3
AD
217872001-02-08 Akim Demaille <akim@epita.fr>
21788
21789 * src/conflicts.c (conflict_report): Be sure not to append to res
21790 between two calls, which could happen if both first sprintf were
21791 skipped, but not the first cp += strlen.
21792
18569462
AD
217932001-02-08 Akim Demaille <akim@epita.fr>
21794
21795 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
21796 New, from fileutils 4.0.37.
21797 * configure.in: Require Autoconf 2.49c. I took some time before
21798 making this decision. This is the only way out for portability
21799 issues in Bison, it would mean way too much duplicate effort to
21800 import in Bison features implemented in 2.49c since 2.13.
21801 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
21802
0d8f3c8a
AD
218032001-02-02 Akim Demaille <akim@epita.fr>
21804
21805 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 21806 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 21807
f17bcd1f
AD
218082001-01-19 Akim Demaille <akim@epita.fr>
21809
21810 Get rid of the ad hoc handling of token_buffer in the scanner: use
21811 the obstacks.
21812
21813 * src/lex.c (token_obstack): New.
21814 (init_lex): Initialize it. No longer call...
21815 (grow_token_buffer): this. Remove it.
21816 Adjust all the places which used it to use the obstack.
21817
511e79b3
AD
218182001-01-19 Akim Demaille <akim@epita.fr>
21819
21820 * src/lex.h: Rename all the tokens:
21821 s/\bENDFILE\b/tok_eof/g;
21822 s/\bIDENTIFIER\b/tok_identifier/g;
21823 etc.
21824 Let them be enums, not #define, to ease debugging.
21825 Adjust all the code.
21826
0d6508ef
AD
218272001-01-18 Akim Demaille <akim@epita.fr>
21828
21829 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
21830 * src/lex.c (maxtoken, grow_token_buffer): Static.
21831
6deb4447
AD
218322001-01-18 Akim Demaille <akim@epita.fr>
21833
21834 Since we now use obstacks, more % directives can be enabled.
21835
21836 * src/lex.c (percent_table): Also accept `%yacc',
21837 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
21838 `%debug'.
21839 Handle the actions for `%semantic_parser' and `%pure_parser' here,
21840 instead of returning a token.
21841 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
21842 * src/reader.c (read_declarations): Adjust.
21843 * src/files.c (open_files): Don't call `compute_base_names', don't
21844 compute `attrsfile' since they depend upon data which might be
21845 *in* the input file now.
21846 (output_files): Do it here.
21847 * src/output.c (output_headers): Document the fact that this patch
21848 introduces a guaranteed SEGV for semantic parsers.
21849 * doc/bison.texinfo: Document them.
21850 * tests/suite.at: Exercise these %options.
21851
ff4423cc
AD
218522000-12-20 Akim Demaille <akim@epita.fr>
21853
21854 Also handle the output file (--verbose) with obstacks.
21855
21856 * files.c (foutput): Remove.
21857 (output_obstack): New.
21858 Adjust all dependencies.
21859 * src/conflicts.c: Return a string.
21860 * src/system.h (obstack_grow_string): Rename as...
21861 (obstack_sgrow): this. Be ready to work with non literals.
21862 (obstack_fgrow4): New.
21863
956dba3a
AD
218642000-12-20 Akim Demaille <akim@epita.fr>
21865
21866 * src/files.c (open_files): Fix the computation of short_base_name
21867 in the case of `-o foo.tab.c'.
21868
337bab46
AD
218692000-12-20 Akim Demaille <akim@epita.fr>
21870
21871 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
21872 (copy_dollar): Now that everything uses obstacks, get rid of the
21873 FILE * parameters.
21874
5d3214b8
AD
218752000-12-20 Akim Demaille <akim@epita.fr>
21876
21877 * src/files.c (open_files): Actually the `.output' file is based
21878 on the short_base_name, not base_name.
21879 * tests/suite.at (Checking output file names): Adjust.
21880
29092a57
AD
218812000-12-20 Akim Demaille <akim@epita.fr>
21882
21883 * src/bison.s1: Remove, we now use directly...
21884 * src/bison.simple: this.
21885 * src/Makefile.am: Use pkgdata instead of data.
21886
ea5607fd
AD
218872000-12-20 Akim Demaille <akim@epita.fr>
21888
21889 * src/files.c (guard_obstack): New.
21890 (open_files): Initialize it.
21891 (output_files): Dump it...
21892 * src/files.h: Export it.
21893 * src/reader.c (copy_guard): Use it.
21894
27110317
AD
218952000-12-19 Akim Demaille <akim@epita.fr>
21896
21897 * src/files.c (outfile, defsfile, actfile): Removed as global
21898 vars.
21899 (open_files): Don't compute them.
21900 (output_files): Adjust.
21901 (base_name, short_base_name): Be global.
21902 Adjust dependencies.
21903
19c50364
AD
219042000-12-19 Akim Demaille <akim@epita.fr>
21905
21906 * src/files.c (strsuffix): New.
21907 (stringappend): Be just like strcat but allocate.
21908 (base_names): Eve out from open_files.
21909 Try to simplify the rather hairy computation of base_name and
21910 short_base_name.
21911 (open_files): Use it.
21912 * tests/suite.at (Checking output file names): New test.
21913
573c1d9f
AD
219142000-12-19 Akim Demaille <akim@epita.fr>
21915
21916 * src/system.h (obstack_grow_literal_string): Rename as...
21917 (obstack_grow_string): this.
21918 * src/output.c (output_parser): Recognize `%% actions' instead of
21919 `$'.
21920 * src/bison.s1: s/$/%% actions/.
21921 * src/bison.hairy: Likewise.
21922
ef7ddedd
AD
219232000-12-19 Akim Demaille <akim@epita.fr>
21924
21925 * src/output.c (output_parser): Compute the `#line' lines when
21926 there are.
21927 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
21928 Suggested by Hans Aberg.
21929
ff61dabd
AD
219302000-12-19 Akim Demaille <akim@epita.fr>
21931
21932 Let the handling of the skeleton files be local to the procedures
21933 that use it.
21934
21935 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
21936 longer static.
21937 (fparser, open_extra_files): Remove.
21938 (open_files, output_files): Don't take care of fparser.
21939 * src/files.h: Adjust.
21940 * src/output.c (output_parser): Open and close the file to the
21941 skeleton.
21942 * src/reader.c (read_declarations): When %semantic_parser, open
21943 fguard.
21944
55b96341
AD
219452000-12-19 Akim Demaille <akim@epita.fr>
21946
21947 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
21948 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
21949
358c15b7
AD
219502000-12-19 Akim Demaille <akim@epita.fr>
21951
21952 * src/files.c (open_files): Yipee! We no longer need all the code
21953 looking for `/tmp' since we have no tmp file.
21954
7de3329e
AD
219552000-12-19 Akim Demaille <akim@epita.fr>
21956
21957 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
21958 New macros.
21959 * src/files.c (open_files): Less dependency on MSDOS etc.
21960
3abcd459
AD
219612000-12-14 Akim Demaille <akim@epita.fr>
21962
21963 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
21964 Provide a default definition.
21965 Use it when executing the default @ action.
21966 * src/reader.c (reader_output_yylsp): No longer include
21967 `timestamp' and `text' in the default YYLTYPE.
21968
2a91a95e
AD
219692000-12-12 Akim Demaille <akim@epita.fr>
21970
21971 * src/reader.c (copy_definition, parse_union_decl, copy_action)
21972 (copy_guard): Quote the file names.
21973 Reported by Laurent Mascherpa.
21974
14d3eb9b
AD
219752000-12-12 Akim Demaille <akim@epita.fr>
21976
21977 * src/output.c (output_headers, output_program, output): Be sure
21978 to escape special characters when outputting filenames.
21979 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
21980 (output_headers): Don't depend on them, Use ACTSTR.
21981
d7045ec6
AD
219822000-11-17 Akim Demaille <akim@epita.fr>
21983
21984 * lib/obstack.h: Formatting changes.
21985 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
21986 prevents type checking.
21987 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
21988 cast the value to (void *): assigning a `foo *' to a `void *'
21989 variable is valid.
21990 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
21991 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
21992 append characters.
21993
6fd54b73
AD
219942000-11-17 Akim Demaille <akim@epita.fr>
21995
21996 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
21997 as...
21998 (suite.m4, regression.m4, calc.m4): these.
21999 * tests/atgeneral.m4: Update from CVS Autoconf.
22000
4c50eae6
AD
220012000-11-17 Akim Demaille <akim@epita.fr>
22002
22003 * tests/regression.m4 (%union and --defines): New test,
22004 demonstrating a current bug in the obstack implementation.
22005
a35f64ea
AD
220062000-11-17 Akim Demaille <akim@epita.fr>
22007
22008 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22009 macros.
22010 Use them to declare the variables which are global or local to
22011 `yyparse'.
22012
7de23534
AD
220132000-11-17 Akim Demaille <akim@epita.fr>
22014
22015 * acconfig.h: Remove, no longer used.
22016
aa7815f5
AD
220172000-11-07 Akim Demaille <akim@epita.fr>
22018
22019 * src: s/Copyright (C)/Copyright/g.
22020
5af1f549
AD
220212000-11-07 Akim Demaille <akim@epita.fr>
22022
22023 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22024 defining.
22025 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22026
553e2b22
AD
220272000-11-07 Akim Demaille <akim@epita.fr>
22028
22029 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22030 Merge in a single CPP if/else.
22031
8a4f41d6
AD
220322000-11-07 Akim Demaille <akim@epita.fr>
22033
22034 * src/output.c (output): Remove useless variables.
22035 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22036 argument `data' for consistency with the prototypes.
22037 Qualify it `const'.
22038 (obstack_copy, obstack_copy0): Rename the second argument as
22039 `address' for consistency. Qualify it `const'.
22040 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22041 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22042 `const' their input argument (`data' or `address').
22043 Adjust the corresponding macros to include `const' in casts.
22044
095a3fb5
AD
220452000-11-03 Akim Demaille <akim@epita.fr>
22046
22047 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22048 s/PFILE1/BISON_HAIRY/.
22049 Adjust dependencies.
22050
d1cdce7c
AD
220512000-11-03 Akim Demaille <akim@epita.fr>
22052
090c5ebf 22053 For some reason, this was not applied.
d1cdce7c
AD
22054
22055 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22056 `unlink': it's no longer used.
22057
9311529b
AD
220582000-11-03 Akim Demaille <akim@epita.fr>
22059
22060 * src/files.c (skeleton_find): New function, eved out of...
22061 (open_files, open_extra_files): here.
22062
d8880f69
AD
220632000-11-03 Akim Demaille <akim@epita.fr>
22064
22065 Don't use `atexit'.
22066
22067 * src/files.c (obstack_save): New function.
22068 (done): Rename as...
22069 (output_files): this.
22070 Use `obstack_save'.
22071 * src/main.c (main): Don't use `atexit' to register `done', since
22072 it no longer has to remove tmp files, just call `output_files'
22073 when there are no errors.
22074
0dbb648e
AD
220752000-11-02 Akim Demaille <akim@epita.fr>
22076
22077 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22078 `unlink': it's no longer used.
22079 * src/files.h: Formatting changes.
22080
896fe5c1
AD
220812000-11-02 Akim Demaille <akim@epita.fr>
22082
22083 Remove the last uses of mktemp and unlink/delete.
22084
22085 * src/files.c (fdefines, ftable): Removed.
22086 (defines_ostack, table_obstack): New.
22087 Adjust dependencies of the former into uses of the latter.
22088 * src/output.c (output_short_or_char_table, output_short_table):
22089 Convert to using obstacks.
22090 * src/reader.c (copy_comment2): Accept one FILE * and two
22091 obstacks.
22092 (output_token_defines, reader_output_yylsp): Use obstacks.
22093 * src/system.h (obstack_fgrow3): New.
1f65350a 22094 * po/POTFILES.in: Adjust.
896fe5c1 22095
dd60faec
AD
220962000-11-01 Akim Demaille <akim@epita.fr>
22097
22098 Change each use of `fattrs' into a use of `attrs_obstack'.
22099
22100 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22101 * src/files.c (fattrs): Remove.
22102 (attrs_obstack): New.
22103 Adjust all dependencies.
22104 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22105
8c7ebe49
AD
221062000-11-01 Akim Demaille <akim@epita.fr>
22107
22108 Introduce obstacks.
22109 Change each use of `faction' into a use of `action_obstack'.
22110
22111 * lib/obstack.h, lib/obstack.c: New files.
22112 * src/files.c (faction): Remove.
22113 (action_obstack): New.
22114 Adjust all dependencies.
22115
77aee789
AD
221162000-10-20 Akim Demaille <akim@epita.fr>
22117
22118 * lib/quote.h (PARAMS): New macro. Use it.
22119
43591cec
AD
221202000-10-16 Akim Demaille <akim@epita.fr>
22121
22122 * src/output.c (output_short_or_char_table): New function.
22123 (output_short_table, output_token_translations): Use it.
22124 (goto_actions): Use output_short_table.
22125
1e9798d5
AD
221262000-10-16 Akim Demaille <akim@epita.fr>
22127
22128 * src/symtab.c (bucket_new): New function.
22129 (getsym): Use it.
22130
22131 * src/output.c (output_short_table): New argument to display the
22132 comment associated with the table.
22133 Adjust dependencies.
22134 (output_gram): Use it.
22135 (output_rule_data): Nicer output layout for YYTNAME.
22136
f282676b
AD
221372000-10-16 Akim Demaille <akim@epita.fr>
22138
22139 * src/lex.c (read_typename): New function.
22140 (lex): Use it.
22141 * src/reader.c (copy_dollar): Likewise.
22142
550a72a3
AD
221432000-10-16 Akim Demaille <akim@epita.fr>
22144
22145 * src/reader.c (copy_comment2): Expect the input stream to be on
22146 the `/' which is suspected to open a comment, instead of being
22147 called after `//' or `/*' was read.
22148 (copy_comment, copy_definition, parse_union_decl, copy_action)
22149 (copy_guard): Adjust.
22150
131e2fef
AD
221512000-10-16 Akim Demaille <akim@epita.fr>
22152
22153 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22154 `read_signed_integer'.
22155
79282c5a
AD
221562000-10-16 Akim Demaille <akim@epita.fr>
22157
22158 * src/reader.c (copy_dollar): New function.
22159 (copy_guard, copy_action): Use it.
22160
ff4a34be
AD
221612000-10-16 Akim Demaille <akim@epita.fr>
22162
22163 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22164 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22165 New files, from Fileutils 4.0.27.
22166 * src/main.c (printable_version): Remove.
22167 * src/lex.c, src/reader.c: Use `quote'.
22168
221692000-10-04 Akim Demaille <akim@epita.fr>
22170
22171 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22172
14ded682
AD
221732000-10-04 Akim Demaille <akim@epita.fr>
22174
22175 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22176
8e03724b
AD
221772000-10-04 Akim Demaille <akim@epita.fr>
22178
22179 When a literal string is used to define two different tokens,
22180 `bison -v' segfaults.
22181 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22182
22183 * tests/regression.m4: New file.
22184 Include the core of the sample provided by Piotr Gackiewicz.
22185 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22186 properly.
22187
a9e64249
AD
221882000-10-04 Akim Demaille <akim@epita.fr>
22189
22190 * src/reader.c (parse_expect_decl): Keep `count' within the size
22191 of `buffer'.
22192 From Neil Booth.
22193
da9abf43
AD
221942000-10-02 Paul Eggert <eggert@twinsun.com>
22195
22196 * bison.s1 (yyparse): Assign the default value
22197 unconditionally, to avoid a GCC warning and make the parser a
22198 tad smaller.
22199
c33638bb
AD
222002000-10-02 Akim Demaille <akim@epita.fr>
22201
22202 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22203 options.
22204
444c570a
AD
222052000-10-02 Akim Demaille <akim@epita.fr>
22206
22207 * src/derives.c, src/print.c, src/reduce.c: To ease the
22208 translation, move some `\n' out of the translated strings.
22209
89cab50d
AD
222102000-10-02 Akim Demaille <akim@epita.fr>
22211
22212 The location tracking mechanism is precious for parse error
22213 messages. Nevertheless, it is enabled only when `@n' is used in
22214 the grammar, which is a different issue (you can use it in error
22215 message, but not in the grammar per se). Therefore, there should
22216 be another means to enable it.
22217
22218 * src/getargs.c (getargs): Support `--locations'.
22219 (usage): Report it.
22220 * src/getargs.h (locationsflag): Export it.
22221 * src/lex.c (percent_table): Support `%locations'.
22222 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22223 with `locationsflag'.
22224 * doc/bison.texinfo: Document `--locations' and `%locations'.
22225 Sort the options.
22226 * tests/calc.m4: Test it.
22227
22228 For regularity of the names, replace each
22229 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22230 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22231 In addition replace each `flag' with `_flag'.
22232
d6c2cba0
AD
222332000-10-02 Akim Demaille <akim@epita.fr>
22234
22235 Also test parse error messages, including with YYERROR_VERBOSE.
22236
22237 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22238 associative).
22239 Use it to check the computations.
22240 Use it to check `nonassoc' is honored.
22241 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22242 `--yyerror-verbose'.
22243 (_AT_CHECK_CALC): Adjust to this option.
22244 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22245
5a35a6cb
AD
222462000-10-02 Akim Demaille <akim@epita.fr>
22247
22248 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22249 the latter demonstrates a flaw in the handling of non debugging
22250 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22251 was used in order to simplify:
22252
22253 #if YYDEBUG
22254 if (yydebug)
22255 {
22256 ...
22257 }
22258 #endif
22259
22260 into
22261
22262 if (yydebug)
22263 {
22264 ...
22265 }
22266
22267 unfortunately this leads to a CPP conflict when
22268 `--name-prefix=foo' is used since it produces `#define yydebug
22269 foodebug'.
22270
22271 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22272 (YYDPRINTF): New macro.
22273 Spread its use.
22274 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22275 the bison options.
22276 Also test `--verbose', `--defines' and `--name-prefix'.
22277
71da9eea
AD
222782000-10-02 Akim Demaille <akim@epita.fr>
22279
22280 Improve the readability of the produced parsers.
22281
22282 * src/bison.s1: Formatting changes.
22283 Improve the comment related to the `$' mark.
22284 (yydefault): Don't fall through to `yyresume': `goto' there.
22285 * src/output.c (output_parser): When the `$' is met, skip the end
22286 of its line.
22287 New variable, `number_of_dollar_signs', to check there's exactly
22288 one `$' in the parser skeleton.
22289
95e36146
AD
222902000-10-02 Akim Demaille <akim@epita.fr>
22291
22292 * lib/xstrdup.c: New file, from the fileutils.
22293 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22294 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22295 instead of strlen + xmalloc + strcpy.
22296 * src/symtab.c (copys): Remove, use xstrdup instead.
22297
d7020c20
AD
222982000-10-02 Akim Demaille <akim@epita.fr>
22299
22300 * src/gram.h (associativity): New enum type which replaces the
22301 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22302 `right_assoc', `left_assoc' and `non_assoc'.
22303 Adjust all dependencies.
22304 * src/reader.c: Formatting changes.
22305 (LTYPESTR): Don't define it, use it as a literal in
22306 `reader_output_yylsp'.
22307 * src/symtab.h (symbol_class): New enum type which replaces the
22308 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22309 `sunknown', `stoken and `snterm'.
22310
1916f98e
AD
223112000-10-02 Akim Demaille <akim@epita.fr>
22312
22313 * src/getargs.c (fixed_outfiles): Rename as...
22314 (yaccflag): for consistency and accuracy.
22315 Adjust dependencies.
22316
d7913476
AD
223172000-10-02 Akim Demaille <akim@epita.fr>
22318
22319 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22320 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22321 difficult and introduced a lot of core dump. It turns out that
22322 Bison used an implementation of `xmalloc' based on `calloc', and
22323 at various places it does depend upon the initialization to 0. I
22324 have not tried to isolate the pertinent places, and all the former
22325 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22326 someone should address this issue.
22327
22328 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22329 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22330 files.
22331 Adjust dependencies.
22332 * src/warshall.h: New file.
22333 Propagate.
22334
340ef489
AD
223352000-10-02 Akim Demaille <akim@epita.fr>
22336
22337 Various anti-`extern in *.c' changes.
22338
22339 * src/system.h: Include `assert.h'.
22340
b2ca4022
AD
223412000-10-02 Akim Demaille <akim@epita.fr>
22342
22343 * src/state.h (nstates, final_state, first_state, first_shift)
22344 (first_reduction): Move their exportation from here...
22345 * src/LR0.h: to here.
22346 Adjust dependencies.
22347 * src/getargs.c (statisticsflag): New variable.
22348 Add support for `--statistics'.
22349 Adjust dependencies.
22350
22351 Remove a lot of now useless `extern' statements in most files.
22352
403b315b
AD
223532000-10-02 Akim Demaille <akim@epita.fr>
22354
22355 * src/LR0.h: New file.
22356 Propagate its use.
22357
07a58c13
AD
223582000-10-02 Akim Demaille <akim@epita.fr>
22359
22360 * src/print.h: New file.
22361 Propagate its use.
22362 * src/print.c: Formatting and ordering changes.
22363 (verbose, terse): Replace with...
22364 (print_results): this new function.
22365 Adjust dependencies.
22366
0619caf0
AD
223672000-10-02 Akim Demaille <akim@epita.fr>
22368
22369 * src/conflicts.c (conflict_report): New function.
22370 (conflict_log, verbose_conflict_log): Replace with...
22371 (print_conflicts): this function.
22372 Adjust dependencies.
22373 * src/conflicts.h: New file.
22374 Propagate its inclusion.
22375
3519ec76
AD
223762000-10-02 Akim Demaille <akim@epita.fr>
22377
22378 * src/nullable.h: New file.
22379 Propagate its inclusion.
22380 * src/nullable.c: Formatting changes.
22381
015acc48
AD
223822000-10-02 Akim Demaille <akim@epita.fr>
22383
22384 * src/reduce.h: New file.
22385 Propagate its inclusion.
22386 * src/reduce.c: Topological sort and other formatting changes.
22387 (bool, TRUE, FALSE): Move their definition to...
22388 * src/system.h: here.
22389
8963a27b
AD
223902000-10-02 Akim Demaille <akim@epita.fr>
22391
22392 * src/files.c: Formatting changes.
22393 (tryopen, tryclose, openfiles): Rename as...
22394 (xfopen, xfclose, open_files): this.
22395 (stringappend): static.
22396 * src/files.h: Complete the list of exported symbols.
22397 Propagate its use.
22398
a70083a3
AD
223992000-10-02 Akim Demaille <akim@epita.fr>
22400
22401 * src/reader.h: New file.
22402 Propagate its use instead of tedious list of `extern' and
22403 prototypes.
22404 * src/reader.c: Formatting changes, topological sort,
22405 s/register//.
22406
abadc117
AD
224072000-10-02 Akim Demaille <akim@epita.fr>
22408
22409 * src/lex.h: Prototype `lex.c' exported functions.
22410 * src/reader.c: Adjust.
22411 * src/lex.c: Formatting changes.
22412 (safegetc): Rename as...
22413 (xgetc): this.
22414
720d742f
AD
224152000-10-02 Akim Demaille <akim@epita.fr>
22416
22417 * src/lalr.h: New file.
22418 Propagate its inclusion instead of prototypes and `extern'.
22419 * src/lalr.c: Formatting changes, topological sorting etc.
22420
f2acea59
AD
224212000-10-02 Akim Demaille <akim@epita.fr>
22422
22423 * src/output.c (token_actions): Introduce a temporary array,
22424 YYDEFACT, that makes it possible for this function to use
22425 output_short_table.
22426
d019d655
AD
224272000-10-02 Akim Demaille <akim@epita.fr>
22428
22429 `user_toknums' is output as a `short[]' in `output.c', while it is
22430 defined as a `int[]' in `reader.c'. For consistency with the
22431 other output tables, `user_toknums' is now defined as a table of
22432 shorts.
22433
22434 * src/reader.c (user_toknums): Be a short table instead of an int
22435 table.
22436 Adjust dependencies.
22437
22438 Factor the short table outputs.
22439
22440 * src/output.c (output_short_table): New function.
22441 * src/output.c (output_gram, output_stos, output_rule_data)
22442 (output_base, output_table, output_check): Use it.
22443
6c89f1c1
AD
224442000-10-02 Akim Demaille <akim@epita.fr>
22445
22446 * src/output.c (output): Topological sort of the functions, in
22447 order to get rid of the `static' prototypes.
22448 No longer use `register'.
22449 * src/output.h: New file.
22450 Propagate its inclusion in files explicitly prototyping functions
22451 from output.c.
22452
d9efd181
AD
224532000-09-21 Akim Demaille <akim@epita.fr>
22454
22455 * src/atgeneral.m4: Update from Autoconf.
22456
c29240e7 224572000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
22458
22459 * src/closure.h: New file.
22460 * src/closure.c: Formatting changes, topological sort over the
22461 functions, use of closure.h.
22462 (initialize_closure, finalize_closure): Rename as...
22463 (new_closure, free_closure): these. Adjust dependencies.
22464 * src/LR0.c: Formatting changes, topological sort, use of
22465 cloture.h.
22466 (initialize_states): Rename as...
22467 (new_states): this.
22468 * src/Makefile.am (noinst_HEADERS): Adjust.
22469
499daa50
AD
224702000-09-20 Akim Demaille <akim@epita.fr>
22471
22472 * src/acconfig.h: Don't protect config.h against multiple
22473 inclusion.
22474 Don't define PARAMS.
22475 * src/system.h: Define PARAMS.
22476 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22477 purpose of config.h. system.h must not try to fix wrong
22478 definitions in config.h.
22479
cc84fd5d
AD
224802000-09-20 Akim Demaille <akim@epita.fr>
22481
22482 * src/derives.h: New file.
22483 * src/main.c, src/derives.h: Use it.
22484 Formatting changes.
22485 * src/Makefile.am (noinst_HEADERS): Adjust.
22486
db5b3a89
AD
224872000-09-20 Akim Demaille <akim@epita.fr>
22488
22489 * tests/atgeneral.m4: Update from Autoconf.
22490 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22491 (AT_CHECK_CALC): New macros.
22492 Use these macros to test bison with options `', `--raw',
22493 `--debug', `--yacc', `--yacc --debug'.
22494
ceed8467
AD
224952000-09-19 Akim Demaille <akim@epita.fr>
22496
22497 * src/output.c: Formatting changes.
22498 * src/machine.h: Remove, leaving its contents in...
22499 * src/system.h: here.
22500 Include stdio.h.
22501 Adjust all dependencies on stdio.h and machine.h.
22502 * src/getargs.h: New file.
22503 Let all `extern' declarations about getargs.c be replaced with
22504 inclusion of `getargs.h'.
22505 * src/Makefile.am (noinst_HEADERS): Adjust.
22506
22507 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22508 scope.
22509 (yyerror): Returns void, not int.
22510 * doc/bison.texinfo: Formatting changes.
22511
05a1d24b
AD
225122000-09-19 Akim Demaille <akim@epita.fr>
22513
22514 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22515 portable.
22516
cbd25751
AD
225172000-09-18 Akim Demaille <akim@epita.fr>
22518
22519 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22520 * src/Makefile.am (INCLUDES): Don't.
22521 Be ready to fetch headers in lib/.
22522
13863333
AD
225232000-09-18 Akim Demaille <akim@epita.fr>
22524
22525 * doc/bison.texinfo: Update the copyright.
22526 ANSIfy and GNUify the examples.
22527 Remove the old menu.
22528
0d533154
AD
225292000-09-18 Akim Demaille <akim@epita.fr>
22530
22531 First set of tests: use the `calc' example from the documentation.
22532
22533 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22534 is defined only when YYDEBUG is.
22535 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22536 * src/files.c (tryopen, tryclose): Formatting changes.
22537 Move to the top and be static.
22538 * src/reader.c (read_signed_integer): Likewise.
22539 * tests/calc.m4: New file.
22540 * Makefile.am, suite.m4: Adjust.
22541 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22542
e79137ac
AD
225432000-09-18 Akim Demaille <akim@epita.fr>
22544
22545 Add support for an Autotest test suite for Bison.
22546
22547 * m4/m4.m4, m4/atconfig.m4: New files.
22548 * m4/Makefile.am (EXTRA_DIST): Adjust.
22549 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22550 files.
22551 * src/getargs.c: Display a more standard --version message.
22552 * src/reader.c (reader): Formatting changes.
22553 No longer depend upon VERSION_STRING.
22554 * configure.in: No longer use `dnl'.
22555 Set up the test suite and the new directory `tests/.
22556 (VERSION_STRING): Remove.
22557
27821bff
AD
225582000-04-14 Akim Demaille <akim@epita.fr>
22559
22560 * src/reader.c (copy_comment2): New function, same as former
22561 `copy_comment', but outputs into two FILE *.
22562 (copy_comment): Use it.
22563 (parse_union_decl): Use it.
22564 (get_type, parse_start_decl): Use the same `invalid' message.
22565 (parse_start_decl, parse_union_decl): Use the same `multiple'
22566 message.
22567 (parse_union_decl, copy_guard, copy_action): Use the same
22568 `unmatched' message.
22569 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22570
cfe5fbc0
AD
225712000-03-31 Akim Demaille <akim@epita.fr>
22572
22573 * src/files.c (tryopen, tryclose): Move to the top.
22574 Be static.
22575
cb7db13e
AD
225762000-03-31 Akim Demaille <akim@epita.fr>
22577
22578 * src/main.c (main): Don't call `done', exit does it.
22579
a0f6b076
AD
225802000-03-31 Akim Demaille <akim@epita.fr>
22581
36281465
AD
22582 * allocate.c: s/return (foo)/return foo/.
22583 * lalr.c: Likewise.
22584 * LR0.c: Likewise.
22585 * output.c: Likewise.
22586 * reader.c: Likewise.
22587 * symtab.c: Likewise.
22588 * vmsgetargs.c: Likewise.
22589
225902000-03-31 Akim Demaille <akim@epita.fr>
22591
22592 Clean up the error reporting functions.
a0f6b076
AD
22593
22594 * src/report.c: New file.
22595 * src/report.h: Likewise.
22596 * src/Makefile.am: Adjust.
22597 * m4/error.m4: New file.
22598 * m4/Makefile.am: Adjust.
22599 * configure.in (jm_PREREQ_ERROR): Call it.
22600 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22601 Remove.
22602 (fatal, fatals): Remove. All callers use complain.c::fatal.
22603 (warn, warni, warns, warnss, warnss): Remove. All callers use
22604 complain.c::complain.
22605 (toomany): Remove, use fatal instead.
22606 * src/files.c (done): No argument, use complain_message_count.
22607 * src/main.c (main): Register `done' to `atexit'.
22608
22609 * src/getargs.c (usage): More `fputs', less `fprintf'.
22610
18539825
AD
226112000-03-28 Akim Demaille <akim@epita.fr>
22612
22613 * lib/: New directory.
22614 * Makefile.am (SUBDIRS): Adjust.
22615 * configure.in: Adjust.
22616 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22617 useless.
22618 * src/alloca.c: Moved to lib/.
22619 * src/getopt.c: Likewise.
22620 * src/getopt1.c: Likewise.
22621 * src/getopt.h: Likewise.
22622 * src/ansi2knr.c: Likewise.
22623 * src/ansi2knr.1: Likewise.
22624 * src/Makefile.am: Adjust.
22625 * lib/Makefile.am: New file.
22626
9f306f2a
AD
226272000-03-28 Akim Demaille <akim@epita.fr>
22628
22629 * src/getargs.c (usage): Refresh the help message.
22630
0ba347b6
AD
226312000-03-17 Akim Demaille <akim@epita.fr>
22632
22633 * src/getopt1.c: Updated from textutils 2.0e
22634 * src/getopt.c: Likewise.
22635 * src/getopt.h: Likewise.
22636
dbe7f271
AD
226372000-03-17 Akim Demaille <akim@epita.fr>
22638
22639 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22640 the file name, not the whole `#line LINE FILE'.
22641
75bbe78d
AD
226422000-03-17 Akim Demaille <akim@epita.fr>
22643
22644 On syntax errors, report the token on which we choked.
22645
aa5fd0ee
AD
22646 * src/bison.s1 (yyparse): In the label yyerrlab, when
22647 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 22648
7b306f52
AD
226492000-03-17 Akim Demaille <akim@epita.fr>
22650
aa5fd0ee 22651 * src/reader.c (copy_at): New function.
7b306f52
AD
22652 (copy_guard): Use it.
22653 (copy_action): Use it.
22654
e87b5700
AD
226552000-03-17 Akim Demaille <akim@epita.fr>
22656
22657 Be kind to translators, save some useless translations.
22658
aa5fd0ee 22659 * src/main.c (banner): New function.
e87b5700
AD
22660 (fatal_banner): Use it.
22661 (warn_banner): Use it.
22662
ae3c3164
AD
226632000-03-17 Akim Demaille <akim@epita.fr>
22664
aa5fd0ee
AD
22665 * src/reader.c (copy_definition): Use copy_string and
22666 copy_comment. Removed now unused `match', `ended',
22667 `cplus_comment'.
ae3c3164
AD
22668 (copy_comment, copy_string): Moved, to be visible from
22669 copy_definition.
22670
4dc58e7c
AD
226712000-03-17 Akim Demaille <akim@epita.fr>
22672
aa5fd0ee
AD
22673 * src/reader.c (copy_string): Declare `static inline'. No
22674 problems with inline, since it is checked by configure.
4dc58e7c
AD
22675 (copy_comment): Likewise.
22676
0a6384c4
AD
226772000-03-17 Akim Demaille <akim@epita.fr>
22678
aa5fd0ee 22679 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 22680
3cef001a
AD
226812000-03-17 Akim Demaille <akim@epita.fr>
22682
aa5fd0ee 22683 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
22684 (copy_action): Use it. Removed now unused `match', `ended',
22685 `cplus_comment'.
22686 (copy_guard): Likewise.
22687
ca36d2ef
AD
226882000-03-17 Akim Demaille <akim@epita.fr>
22689
aa5fd0ee 22690 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
22691 (copy_action): Use it.
22692 (copy_guard): Likewise.
22693
6666f98f
AD
226942000-03-17 Akim Demaille <akim@epita.fr>
22695
22696 Change the handling of @s so that they behave exactly like $s.
22697 There is now a pseudo variable @$ (readble and writable), location
22698 of the lhs of the rule (by default ranging from the location of
22699 the first symbol of the rhs, to the location of the last symbol,
22700 or, if the rhs is empty, YYLLOC).
22701
22702 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22703 yyval.
22704 (yyparse): When providing a default semantic action, provide a
22705 default location action.
22706 (after the $): No longer change `*YYLSP', just stack YYLOC the
22707 same way you stack YYVAL.
22708 * src/reader.c (read_declarations): Use warns.
22709 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22710 (copy_action, case '@'): Likewise.
22711 Use a standard error message, to save useless work from
22712 translators.
22713
41aca2e0
AD
227142000-03-17 Akim Demaille <akim@epita.fr>
22715
aa5fd0ee
AD
22716 * src/bison.s1: Formatting and cosmetics changes.
22717 * src/reader.c: Likewise.
41aca2e0
AD
22718 Update the Copyright notice.
22719
dc08c1d5
AD
227202000-03-17 Akim Demaille <akim@epita.fr>
22721
aa5fd0ee
AD
22722 * src/bison.s1 (#line): All set to `#line' only, since the
22723 Makefile now handles them.
dc08c1d5 22724
9ee3c97b
AD
227252000-03-16 Akim Demaille <akim@epita.fr>
22726
22727 * src/output.c (output_rule_data): Output the documentation of
22728 some of the tables.
22729 (Copyright notice): Update.
22730 Formatting changes.
22731
0de741ca
AD
227322000-03-16 Akim Demaille <akim@epita.fr>
22733
22734 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
22735 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
22736 One `#if YYDEBUG' remains, since it uses variables which are
22737 defined only if `YYDEBUG != 0'.
22738
bb10be54
AD
227392000-03-16 Akim Demaille <akim@epita.fr>
22740
22741 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
22742 and related variables so that the similarities are highlighted.
22743
b07b484a
AD
227442000-03-16 Akim Demaille <akim@epita.fr>
22745
22746 * src/bison.s1: Properly indent CPP directives.
22747
361f60b3
AD
227482000-03-16 Akim Demaille <akim@epita.fr>
22749
22750 * src/bison.s1: Properly indent the `alloca' CPP section.
22751
8c44d3ec
AD
227522000-03-16 Akim Demaille <akim@epita.fr>
22753
22754 Do not hard code values of directories in `configure.in'.
22755 Update the `configure' tool chain.
22756
22757 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
22758 src/makefile.am.
22759 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
22760 (AC_OUTPUT): Add m4/Makefile.
22761 Bump to bison 1.28a, 1.29 has never been released.
22762 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
22763 handled via src/Makefile.am.
22764 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
22765 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
22766 autoheader.
22767 * Makefile.am (SUBDIRS): Add m4.
22768 (ACLOCAL_AM_FLAGS): New variable.
22769 (AUTOMAKE_OPTIONS): Add check-news.
22770 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
22771 the proper line number and file name.
22772 (DEFS): Propagate the location of bison library files and of the
22773 locale files.
22774 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
22775 builddir.
22776 * acinclude.m4: Remove, replaced by the directory m4.
22777 * m4/Makefile.am (EXTRA_DIST): New variable.
22778 * m4/gettext.m4: New file, from the fileutils.
22779 * m4/lcmessage.m4: Likewise
22780 * m4/progtest.m4: Likewise.
22781 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
22782
f95997e7
AD
227832000-03-10 Akim Demaille <akim@epita.fr>
22784
22785 * src/closure.c:
22786 Formatting changes of various comments.
22787 Respect the GNU coding standards at various places.
22788 Don't use `_()' when no translation is needed.
22789
227901999-12-13 Jesse Thilo <jthilo@gnu.org>
22791
22792 * src/files.c:
22793 OS/2 honors TMPDIR environment variable.
22794
227951999-12-13 Jesse Thilo <jthilo@gnu.org>
22796
22797 * doc/bison.texinfo: Tweaked spelling and grammar.
22798 Updated ISBN.
22799 Removed reference to price of printed copy.
22800 Mention BISON_SIMPLE and BISON_HAIRY.
22801
228021999-12-13 Jesse Thilo <jthilo@gnu.org>
22803
22804 * configure.in, NEWS:
22805 Bison 1.29 released.
22806
228071999-10-27 Jesse Thilo <jthilo@gnu.org>
22808
22809 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
22810 Added reference card.
22811
228121999-07-26 Jesse Thilo <jthilo@gnu.org>
22813
22814 * po/ru.po: Added Russian translation.
22815
228161999-07-26 Jesse Thilo <jthilo@gnu.org>
22817
22818 * configure.in: Added Russian translation.
22819
228201999-07-06 Jesse Thilo <jthilo@gnu.org>
22821
22822 * configure.in, NEWS, README:
22823 Released version 1.28.
22824
228251999-06-14 Jesse Thilo <jthilo@gnu.org>
22826
22827 * src/system.h:
22828 Squashed redefinition warning on some systems.
22829
22830 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
22831 Have configure build version string instead of relying on ANSI string
22832 concatentation.
22833
228341999-06-14 Jesse Thilo <jthilo@gnu.org>
22835
22836 * po/POTFILES.in: Got rid of version.c.
22837
228381999-06-14 Jesse Thilo <jthilo@gnu.org>
22839
22840 * acconfig.h, configure.in:
22841 Have configure build version string instead of relying on ANSI string
22842 concatentation.
22843
228441999-06-08 Jesse Thilo <jthilo@gnu.org>
22845
22846 * doc/bison.1:
22847 Dropped mention of `+' for long-named options.
22848
228491999-05-30 Jesse Thilo <jthilo@gnu.org>
22850
22851 * src/files.c: Added <unistd.h> for unlink().
22852
22853 * src/Makefile.am, src/system.h:
22854 I18n fixes.
22855
228561999-05-30 Jesse Thilo <jthilo@gnu.org>
22857
22858 * README: Added a FAQ list.
22859
22860 * configure.in, acconfig.h:
22861 I18n fixes.
22862
228631999-05-30 Jesse Thilo <jthilo@gnu.org>
22864
22865 * doc/FAQ, doc/Makefile.am:
22866 Added a FAQ list.
22867
228681999-05-19 Jesse Thilo <jthilo@gnu.org>
22869
22870 * src/alloc.h, src/symtab.h, src/version.c:
22871 Protected inclusion of "config.h" with HAVE_CONFIG_H.
22872
228731999-04-18 Jesse Thilo <jthilo@gnu.org>
22874
22875 * src/.cvsignore, src/Makefile.am:
22876 Reorganized: sources in `src', documentation in `doc'.
22877
22878 * src/lex.c (literalchar):
22879 fixed the code for escaping double quotes (thanks
22880 Jonathan Czisny.)
22881
228821999-04-18 Jesse Thilo <jthilo@gnu.org>
22883
22884 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
22885 Adjusted paths to reflect directory reorganization.
22886
228871999-04-18 Jesse Thilo <jthilo@gnu.org>
22888
22889 * doc/.cvsignore, doc/Makefile.am:
22890 Reorganized: sources in `src', documentation in `doc'.
22891
228921999-04-18 Jesse Thilo <jthilo@gnu.org>
22893
22894 * configure.in:
22895 Updated AC_INIT file to reflect directory reorganization.
22896
22897 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
22898 Reorganized: sources in `src', documentation in `doc'.
22899
229001999-04-13 Jesse Thilo <jthilo@gnu.org>
22901
22902 * src/allocate.c:
22903 Don't declare calloc() and realloc() if not necessary.
22904
229051999-04-13 Jesse Thilo <jthilo@gnu.org>
22906
22907 * configure.in, acconfig.h, acinclude.m4:
22908 Don't declare calloc() and realloc() if not necessary.
22909
229101999-03-23 Jesse Thilo <jthilo@gnu.org>
22911
22912 * po/.cvsignore: Added i18n support.
22913
229141999-03-23 Jesse Thilo <jthilo@gnu.org>
22915
22916 * acconfig.h, configure.in, Makefile.am:
22917 Added i18n support.
22918
229191999-03-22 Jesse Thilo <jthilo@gnu.org>
22920
22921 * src/bison.s1: Fixed #line numbers.
22922
229231999-03-15 Jesse Thilo <jthilo@gnu.org>
22924
22925 * po/es.po, po/fr.po, po/nl.po, po/de.po:
22926 Added PO files from Translation Project.
22927
229281999-03-03 Jesse Thilo <jthilo@gnu.org>
22929
22930 * Makefile.am:
22931 Added support for non-ANSI compilers (ansi2knr).
22932
229331999-02-16 Jesse Thilo <jthilo@gnu.org>
22934
22935 * configure.in: Bumped version number to 1.27.
22936
22937 * Makefile.am:
22938 Added `bison.simple' to list of files removed by `make distclean'.
22939
229401999-02-12 Jesse Thilo <jthilo@gnu.org>
22941
22942 * src/files.c, src/files.h:
22943 Defined locations of parser files in config.h instead of Makefile.
22944
229451999-02-12 Jesse Thilo <jthilo@gnu.org>
22946
22947 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
22948 Defined locations of parser files in config.h instead of Makefile.
22949
229501999-02-09 Jesse Thilo <jthilo@gnu.org>
22951
22952 * Makefile.am:
22953 Removed inappropriate use of $< macro.
22954
229551999-02-05 Jesse Thilo <jthilo@gnu.org>
22956
22957 * po/Makefile.in.in, po/POTFILES.in:
22958 Add `po' directory skeleton.
22959
229601999-01-27 Jesse Thilo <jthilo@gnu.org>
22961
22962 * README: Document help-bison list.
22963
22964 * configure.in: Add check for mkstemp().
22965
229661999-01-20 Jesse Thilo <jthilo@gnu.org>
22967
22968 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
22969 Hush a few compiler warnings.
22970
22971 * src/files.c:
22972 Add tryclose(), which verifies that fclose was successful.
22973 Hush a couple of compiler warnings.
22974
229751999-01-20 Jesse Thilo <jthilo@gnu.org>
22976
22977 * Makefile.am, OChangeLog:
22978 ChangeLog is now automatically generated. Include the old version as
22979 OChangeLog.
22980
229811999-01-14 Jesse Thilo <jthilo@gnu.org>
22982
22983 * 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:
22984 Update FSF address.
22985
229861999-01-14 Jesse Thilo <jthilo@gnu.org>
22987
22988 * doc/bison.texinfo: Fix formatting glitch.
22989
22990 * doc/bison.texinfo: Update FSF address.
22991
229921999-01-14 Jesse Thilo <jthilo@gnu.org>
22993
22994 * acconfig.h: Update FSF address.
22995
229961999-01-08 Jesse Thilo <jthilo@gnu.org>
22997
22998 * src/system.h:
22999 Don't define PACKAGE here, since config.h defines it.
23000
230011998-12-30 Jesse Thilo <jthilo@gnu.org>
23002
23003 * src/reader.c: Update copyright date.
23004
23005 * src/main.c:
23006 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23007 favor of output directly to stderr (avoids buffer overruns).
23008
23009 * src/reader.c: Some checks for premature EOF.
23010
23011 * 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:
23012 Use prototypes if the compiler understands them.
23013
23014 * src/files.c: Honor TMPDIR on Unix hosts.
23015 Use prototypes if the compiler understands them.
23016
23017 * src/reader.c:
23018 Fix a couple of buffer overrun bugs.
23019 Use prototypes if the compiler understands them.
23020
23021 * src/system.h: Include unistd.h and ctype.h.
23022 Use #ifdef instead of #if for NLS symbols.
23023
230241998-12-30 Jesse Thilo <jthilo@gnu.org>
23025
23026 * doc/bison.texinfo:
23027 Delete comment "consider using @set for edition number, etc..." since
23028 we now are doing so.
23029
230301998-12-30 Jesse Thilo <jthilo@gnu.org>
23031
23032 * configure.in:
23033 Use prototypes if the compiler understands them.
23034
23035 * NEWS: Document 1.26 highlights.
23036
23037 * Makefile.am: Require Automake 1.3 or later.
23038
23039 * acconfig.h:
23040 Use prototypes if the compiler understands them.
23041
230421998-12-29 Jesse Thilo <jthilo@gnu.org>
23043
23044 * src/version.c:
23045 Use VERSION symbol from automake for version number.
23046
230471998-12-29 Jesse Thilo <jthilo@gnu.org>
23048
23049 * acconfig.h, configure.in, version.cin:
23050 Use VERSION symbol from automake for version number.
23051
230521998-11-28 Jesse Thilo <jthilo@gnu.org>
23053
23054 * Makefile.am:
23055 Distribute original version of simple parser (bison.s1), not built
23056 version (bison.simple).
23057
230581998-11-28 Jesse Thilo <jthilo@gnu.org>
23059
23060 * doc/bison.texinfo: Add info dir entry.
23061
23062 * doc/bison.texinfo:
23063 Let automake put version number into documentation.
23064
230651998-11-26 Jesse Thilo <jthilo@gnu.org>
23066
23067 * src/bison.cld, src/build.com, src/vmshlp.mar:
23068 Add non-RCS files from /gd/gnu/bison.
23069
230701998-11-26 Jesse Thilo <jthilo@gnu.org>
23071
23072 * doc/bison.1:
23073 Document the BISON_HAIRY and BISON_SIMPLE variables.
23074
230751998-11-25 Jesse Thilo <jthilo@gnu.org>
23076
23077 * src/version.c: Build version.c automatically.
23078
23079 * src/reader.c:
23080 Fix token numbering (used to start at 258, not 257).
23081
23082 * src/system.h: Include config.h.
23083
23084 * src/getargs.c: Update bug report address.
23085
23086 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23087 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23088
230891998-11-25 Jesse Thilo <jthilo@gnu.org>
23090
23091 * Makefile.am:
23092 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23093
23094 * configure.in, version.cin:
23095 Build version.c automatically.
23096
23097 * AUTHORS: Add AUTHORS file.
23098
23099 * README: Update bug report address.
23100
23101 * bison.simple:
23102 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23103
23104 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23105 Add automake stuff.
23106
231071998-11-25 Jesse Thilo <jthilo@gnu.org>
23108
23109 * doc/bison.texinfo: Clean up some formatting.
23110
231111998-05-05 Richard Stallman <rms@gnu.org>
23112
23113 * doc/bison.texinfo:
23114 Explain better why to make a pure parser.
23115
231161998-01-05 Richard Stallman <rms@gnu.org>
23117
23118 * src/files.c (openfiles):
23119 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23120 find a temporary directory, if possible. Do not unlink files while
23121 they are open.
23122
231231997-08-25 Richard Stallman <rms@gnu.org>
23124
23125 * src/reader.c (stack_offset;):
23126 Change some warni to warns.
23127
23128 * src/lex.c (literalchar): Use warns, not warni.
23129
231301997-06-28 Richard Stallman <rms@gnu.org>
23131
23132 * src/bison.s1: Add a Bison version comment.
23133
23134 * src/main.c (fatal, warn, berror):
23135 Use program_name.
23136
231371997-06-28 Richard Stallman <rms@gnu.org>
23138
23139 * Makefile.in (bison_version): New variable.
23140 (dist): Use that variable.
23141 (bison.s1): Substitute the Bison version into bison.simple.
23142
23143 * bison.simple: Add a Bison version comment.
23144
231451997-06-18 Richard Stallman <rms@gnu.org>
23146
23147 * src/main.c (fatal, warn, berror):
23148 Make error messages standard.
23149 (toomany): Improve error message text.
23150
23151 * 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:
23152 new.h renamed to alloc.h.
23153
231541997-06-18 Richard Stallman <rms@gnu.org>
23155
23156 * Makefile.in: new.h renamed to alloc.h.
23157
231581997-05-24 Richard Stallman <rms@gnu.org>
23159
23160 * src/lex.c (literalchar):
23161 Fix the code for escaping \, " and '.
23162
23163 (lex): Avoid trouble when there are many chars
23164 to discard in a char literal with just several chars in it.
23165
231661997-05-17 Richard Stallman <rms@gnu.org>
23167
23168 * src/bison.s1:
23169 Use malloc, if using alloca is troublesome.
23170 (YYSTACK_USE_ALLOCA): New flag macro.
23171 Define it for some systems and compilers.
23172 (YYSTACK_ALLOC): New macro.
23173 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23174 If it was malloc'd, free it.
23175
231761997-05-17 Richard Stallman <rms@gnu.org>
23177
23178 * bison.simple:
23179 Use malloc, if using alloca is troublesome.
23180 (YYSTACK_USE_ALLOCA): New flag macro.
23181 Define it for some systems and compilers.
23182 (YYSTACK_ALLOC): New macro.
23183 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23184 If it was malloc'd, free it.
23185
231861997-04-23 Richard Stallman <rms@gnu.org>
23187
23188 * src/bison.s1:
23189 (alloca) [__hpux]: Always define as __builtin_alloca.
23190
231911997-04-23 Richard Stallman <rms@gnu.org>
23192
23193 * bison.simple:
23194 (alloca) [__hpux]: Always define as __builtin_alloca.
23195
231961997-04-22 Richard Stallman <rms@gnu.org>
23197
23198 * src/bison.s1:
23199 [__hpux]: Include alloca.h (right for HPUX 10)
23200 instead of declaring alloca (right for HPUX 9).
23201
23202 * src/bison.s1 (__yy_memcpy):
23203 Declare arg `count' as unsigned int.
23204 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23205
232061997-04-22 Richard Stallman <rms@gnu.org>
23207
23208 * bison.simple:
23209 [__hpux]: Include alloca.h (right for HPUX 10)
23210 instead of declaring alloca (right for HPUX 9).
23211
23212 * bison.simple (__yy_memcpy):
23213 Declare arg `count' as unsigned int.
23214 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23215
232161997-01-03 Richard Stallman <rms@gnu.org>
23217
23218 * src/allocate.c: [__STDC__ or _MSC_VER]:
23219 Declare calloc and realloc to return void *.
23220
232211997-01-02 Richard Stallman <rms@gnu.org>
23222
23223 * src/system.h:
23224 [_MSC_VER]: Include stdlib.h and process.h.
23225 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23226
23227 * src/main.c (main): Return FAILURE as a value.
23228 (printable_version): Declare arg as int, not char.
23229
232301997-01-02 Richard Stallman <rms@gnu.org>
23231
23232 * Makefile.in (dist):
23233 Explicitly check for symlinks, and copy them.
23234
232351996-12-19 Richard Stallman <rms@gnu.org>
23236
23237 * src/files.c:
23238 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23239
232401996-12-18 Paul Eggert <eggert@gnu.org>
23241
23242 * src/bison.s1 (yyparse):
23243 If __GNUC__ and YYPARSE_PARAM are both defined,
23244 declare yyparse to have a void * argument.
23245
232461996-12-18 Paul Eggert <eggert@gnu.org>
23247
23248 * bison.simple (yyparse):
23249 If __GNUC__ and YYPARSE_PARAM are both defined,
23250 declare yyparse to have a void * argument.
23251
232521996-12-17 Richard Stallman <rms@gnu.org>
23253
23254 * src/reduce.c (nbits): Add some casts.
23255
232561996-08-12 Richard Stallman <rms@gnu.org>
23257
23258 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23259
232601996-08-12 Richard Stallman <rms@gnu.org>
23261
23262 * bison.simple: Test _MSDOS as well as _MSDOS_.
23263
232641996-07-31 Richard Stallman <rms@gnu.org>
23265
23266 * src/bison.s1:
23267 [__sun && __i386]: Include alloca.h.
23268
232691996-07-31 Richard Stallman <rms@gnu.org>
23270
23271 * bison.simple:
23272 [__sun && __i386]: Include alloca.h.
23273
232741996-07-30 Richard Stallman <rms@gnu.org>
23275
23276 * src/bison.s1: Comment change.
23277
23278 * src/bison.s1: Test _MSDOS_, not MSDOS.
23279
232801996-07-30 Richard Stallman <rms@gnu.org>
23281
23282 * bison.simple: Comment change.
23283
23284 * bison.simple: Test _MSDOS_, not MSDOS.
23285
232861996-06-01 Richard Stallman <rms@gnu.org>
23287
23288 * 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:
23289 Insert `_' macro around many string constants.
23290
23291 * src/main.c:
23292 Insert `_' macro around many string constants.
23293
23294 (main): Call setlocale, bindtextdomain and textdomain.
23295
23296 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23297 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23298 [ENABLE_NLS]: Include libintl.h.
23299 [ENABLE_NLS] (gettext): Define.
23300 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23301 (N_, PACKAGE, LOCALEDIR): New macros.
23302
233031996-06-01 Richard Stallman <rms@gnu.org>
23304
23305 * POTFILES.in: New file.
23306
23307 * Makefile.in (allocate.o):
23308 Define target explicitly.
23309
23310 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23311 (LDFLAGS): Set to @LDFLAGS@.
23312 (configure): Run autoconf only if preceding `cd' succeeds.
23313 (bison.s1): Redirect output to temporary file then move the
23314 temporary to the target, rather than redirecting directly to bison.s1.
23315 (clean): Remove config.status and config.log.
23316 (distclean): Don't remove config.status here.
23317
233181996-05-12 Richard Stallman <rms@gnu.org>
23319
23320 * src/bison.s1:
23321 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23322
233231996-05-12 Richard Stallman <rms@gnu.org>
23324
23325 * bison.simple:
23326 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23327
233281996-05-11 Richard Stallman <rms@gnu.org>
23329
23330 * src/bison.s1 (__yy_memcpy):
23331 Really reorder the args, as was supposedly done on Feb 14 1995.
23332 (yyparse): Calls changed accordingly.
23333
233341996-05-11 Richard Stallman <rms@gnu.org>
23335
23336 * Makefile.in (dist): Don't use $(srcdir).
23337
23338 * bison.simple (__yy_memcpy):
23339 Really reorder the args, as was supposedly done on Feb 14 1995.
23340 (yyparse): Calls changed accordingly.
23341
233421996-01-27 Richard Stallman <rms@gnu.org>
23343
23344 * src/output.c (output_rule_data):
23345 Test YYERROR_VERBOSE in the conditional
23346 around the definition of ttyname.
23347
233481995-12-29 Richard Stallman <rms@gnu.org>
23349
23350 * src/bison.s1:
23351 Fix line numbers in #line commands.
23352
233531995-12-29 Richard Stallman <rms@gnu.org>
23354
23355 * bison.simple:
23356 Fix line numbers in #line commands.
23357
233581995-12-27 Richard Stallman <rms@gnu.org>
23359
23360 * src/bison.s1 (YYPARSE_PARAM_DECL):
23361 In C++, make it always null.
23362 (YYPARSE_PARAM_ARG): New macro.
23363 (yyparse): Use YYPARSE_PARAM_ARG.
23364
233651995-12-27 Richard Stallman <rms@gnu.org>
23366
23367 * bison.simple (YYPARSE_PARAM_DECL):
23368 In C++, make it always null.
23369 (YYPARSE_PARAM_ARG): New macro.
23370 (yyparse): Use YYPARSE_PARAM_ARG.
23371
233721995-11-29 Richard Stallman <rms@gnu.org>
23373
23374 * doc/bison.texinfo:
23375 Describe literal string tokens, %raw, %no_lines, %token_table.
23376
233771995-11-29 Daniel Hagerty <hag@gnu.org>
23378
23379 * doc/bison.texinfo: Fixed update date
23380
233811995-10-16 Richard Stallman <rms@gnu.org>
23382
23383 * src/version.c: Version 1.25.
23384
233851995-10-16 Richard Stallman <rms@gnu.org>
23386
23387 * NEWS: *** empty log message ***
23388
233891995-10-16 Richard Stallman <rms@gnu.org>
23390
23391 * doc/bison.1, doc/bison.rnh:
23392 Add new options.
23393
233941995-10-15 Richard Stallman <rms@gnu.org>
23395
23396 * src/vmsgetargs.c, src/getargs.c:
23397 Added -n, -k, and -raw switches.
23398 (noparserflag, toknumflag, rawtoknumflag): New variables.
23399
23400 * src/symtab.h (SALIAS):
23401 New #define for adding aliases to %token.
23402 (struct bucket): Added `alias' field.
23403
23404 * src/reduce.c (reduce_grammar):
23405 Revise error message.
23406 (print_notices): Remove final `.' from error message.
23407
23408 * src/reader.c (reader_output_yylsp):
23409 New function.
23410 (readgram): Use `#if 0' around code that accepted %command
23411 inside grammar rules: The documentation doesn't allow it,
23412 and it will fail since the %command processors scan for the next %.
23413 (parse_token_decl): Extended the %token
23414 declaration to allow a multi-character symbol as an alias.
23415 (parse_thong_decl): New function.
23416 (read_declarations): Added %thong declarations.
23417 (read_declarations): Handle NOOP to deal with allowing
23418 % declarations as another means to specify the flags.
23419 (readgram): Allow %prec prior to semantics embedded in a rule.
23420 (skip_to_char, read_declarations, copy_definition)
23421 (parse_token_decl, parse_start_decl, parse_type_decl)
23422 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23423 (get_type_name, copy_guard, copy_action, readgram)
23424 (get_type, packsymbols): Revised most error messages.
23425 Changed `fatal' to `warnxxx' to avoid aborting for error.
23426 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23427 (read_declarations): Improve the error message for
23428 an invalid character. Do not abort.
23429 (read_declarations, copy_guard, copy_action): Use
23430 printable_version to avoid unprintable characters in printed output.
23431 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23432 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23433 Allow the type of a non-terminal can be given
23434 more than once, as long as all specifications give the same type.
23435
23436 * src/output.c:
23437 (output_headers, output_trailers, output, output_gram)
23438 (output_rule_data): Implement noparserflag variable.
23439 Implement toknumflag variable.
23440 (output): Call reader_output_yylsp to output LTYPESTR.
23441
23442 * src/main.c (main):
23443 If reader sees an error, don't process the grammar.
23444 (fatals): Updated to not use VARARGS1.
23445 (printable_version, int_to_string, warn, warni, warns, warnss)
23446 (warnsss): New error reporting functions. Avoid abort for error.
23447
23448 * src/lex.h:
23449 Added THONG and NOOP for alias processing.
23450 Added SETOPT for the new code that allows setting options with %flags.
23451
23452 * src/lex.c:
23453 Include getopt.h. Add some extern decls.
23454 (safegetc): New function to deal with EOF gracefully.
23455 (literalchar); new function to deal with reading \ escapes.
23456 (lex): Use literalchar.
23457 (lex): Implemented "..." tokens.
23458 (literalchar, lex, parse_percent_token): Made tokenbuffer
23459 always contain the token. This includes growing the token
23460 buffer while reading an integer.
23461 (parse_percent_token): Replaced if-else statement with percent_table.
23462 (parse_percent_token): Added % declarations as another
23463 way to specify the flags -n, -l, and -r. Also added hooks for
23464 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23465 major changes to files.c.
23466 (lex) Retain in the incoming stream a character following
23467 an incorrect '/'.
23468 (skip_white_space, lex): Revised most error messages
23469 and changed fatal to warn to avoid aborting.
23470 (percent_table): Added %thong declarations.
23471
23472 * src/gram.h: Comment changes.
23473
23474 * src/files.c (openfiles, open_extra_files, done):
23475 Add faction flag
23476 and actfile file. Handle noparserflag. Both for -n switch.
23477
23478 * src/conflicts.c (resolve_sr_conflict):
23479 Remove use of alloca.
23480
234811995-06-01 Jim Meyering <meyering@gnu.org>
23482
23483 * doc/bison.texinfo: *** empty log message ***
23484
234851995-05-06 Richard Stallman <rms@gnu.org>
23486
23487 * src/bison.s1: Comment change.
23488
234891995-05-06 Richard Stallman <rms@gnu.org>
23490
23491 * bison.simple: Comment change.
23492
234931995-05-03 Richard Stallman <rms@gnu.org>
23494
23495 * src/version.c: Version now 1.24.
23496
23497 * src/bison.s1: Change distribution terms.
23498
23499 * src/version.c: Version now 1.23.
23500
235011995-05-03 Richard Stallman <rms@gnu.org>
23502
23503 * doc/bison.texinfo:
23504 Rewrite "Conditions for Using Bison".
23505 Update version to 1.24.
23506
235071995-05-03 Richard Stallman <rms@gnu.org>
23508
23509 * bison.simple: Change distribution terms.
23510
235111995-02-23 Richard Stallman <rms@gnu.org>
23512
23513 * src/files.c: Test __VMS_POSIX as well as VMS.
23514
235151995-02-14 Jim Meyering <meyering@gnu.org>
23516
23517 * src/bison.s1 (__yy_memcpy):
23518 Renamed from __yy_bcopy to avoid
23519 confusion. Reverse FROM and TO arguments to be consistent with
23520 those of memcpy.
23521
235221995-02-14 Jim Meyering <meyering@gnu.org>
23523
23524 * bison.simple (__yy_memcpy):
23525 Renamed from __yy_bcopy to avoid
23526 confusion. Reverse FROM and TO arguments to be consistent with
23527 those of memcpy.
23528
235291994-11-10 David J. MacKenzie <djm@gnu.org>
23530
23531 * NEWS: reformat
23532
23533 * NEWS: New file.
23534
23535 * Makefile.in (DISTFILES): Include NEWS.
23536
23537 * Makefile.in (DISTFILES):
23538 Include install-sh, not install.sh.
23539
23540 * configure.in: Update to Autoconf v2 macro names.
23541
235421994-10-05 David J. MacKenzie <djm@gnu.org>
23543
23544 * Makefile.in: fix typo
23545
23546 * Makefile.in (prefix, exec_prefix):
23547 Let configure set them.
23548
235491994-09-28 David J. MacKenzie <djm@gnu.org>
23550
23551 * Makefile.in: Set datadir to $(prefix)/share.
23552
235531994-09-15 Richard Stallman <rms@gnu.org>
23554
23555 * src/bison.s1:
23556 Update copyright notice and GPL version.
23557
235581994-09-15 Richard Stallman <rms@gnu.org>
23559
23560 * bison.simple:
23561 Update copyright notice and GPL version.
23562
235631994-07-12 Richard Stallman <rms@gnu.org>
23564
23565 * src/reduce.c, src/reader.c:
23566 entered into RCS
23567
235681994-05-05 David J. MacKenzie <djm@gnu.org>
23569
23570 * Makefile.in: entered into RCS
23571
235721994-03-26 Richard Stallman <rms@gnu.org>
23573
23574 * src/bison.s1: entered into RCS
23575
235761994-03-26 Richard Stallman <rms@gnu.org>
23577
23578 * bison.simple: entered into RCS
23579
235801994-03-25 Richard Stallman <rms@gnu.org>
23581
23582 * src/main.c: entered into RCS
23583
235841994-03-24 Richard Stallman <rms@gnu.org>
23585
23586 * src/conflicts.c: entered into RCS
23587
235881994-01-02 Richard Stallman <rms@gnu.org>
23589
23590 * Makefile.in: *** empty log message ***
23591
235921993-11-21 Richard Stallman <rms@gnu.org>
23593
23594 * src/bison.s1: *** empty log message ***
23595
235961993-11-21 Richard Stallman <rms@gnu.org>
23597
23598 * doc/bison.texinfo: entered into RCS
23599
23600 * doc/bison.texinfo: *** empty log message ***
23601
236021993-11-21 Richard Stallman <rms@gnu.org>
23603
23604 * bison.simple: *** empty log message ***
23605
236061993-10-25 David J. MacKenzie <djm@gnu.org>
23607
23608 * doc/bison.texinfo: *** empty log message ***
23609
236101993-10-19 Richard Stallman <rms@gnu.org>
23611
23612 * src/bison.s1: *** empty log message ***
23613
236141993-10-19 Richard Stallman <rms@gnu.org>
23615
23616 * bison.simple: *** empty log message ***
23617
236181993-10-14 Richard Stallman <rms@gnu.org>
23619
23620 * src/bison.s1: *** empty log message ***
23621
236221993-10-14 Richard Stallman <rms@gnu.org>
23623
23624 * bison.simple: *** empty log message ***
23625
236261993-09-14 David J. MacKenzie <djm@gnu.org>
23627
23628 * doc/bison.texinfo: *** empty log message ***
23629
236301993-09-13 Noah Friedman <friedman@gnu.org>
23631
23632 * Makefile.in: *** empty log message ***
23633
236341993-09-10 Richard Stallman <rms@gnu.org>
23635
23636 * src/conflicts.c: *** empty log message ***
23637
23638 * src/system.h: entered into RCS
23639
236401993-09-10 Richard Stallman <rms@gnu.org>
23641
23642 * doc/bison.1: entered into RCS
23643
236441993-09-06 Noah Friedman <friedman@gnu.org>
23645
23646 * src/version.c: entered into RCS
23647
236481993-09-06 Noah Friedman <friedman@gnu.org>
23649
23650 * Makefile.in: *** empty log message ***
23651
236521993-07-30 David J. MacKenzie <djm@gnu.org>
23653
23654 * Makefile.in: *** empty log message ***
23655
236561993-07-24 Richard Stallman <rms@gnu.org>
23657
23658 * src/bison.s1: *** empty log message ***
23659
236601993-07-24 Richard Stallman <rms@gnu.org>
23661
23662 * bison.simple: *** empty log message ***
23663
236641993-07-08 David J. MacKenzie <djm@gnu.org>
23665
23666 * Makefile.in: *** empty log message ***
23667
236681993-07-04 Richard Stallman <rms@gnu.org>
23669
23670 * src/bison.s1: *** empty log message ***
23671
236721993-07-04 Richard Stallman <rms@gnu.org>
23673
23674 * bison.simple: *** empty log message ***
23675
236761993-06-26 David J. MacKenzie <djm@gnu.org>
23677
23678 * src/getargs.c: entered into RCS
23679
236801993-06-26 David J. MacKenzie <djm@gnu.org>
23681
23682 * doc/bison.texinfo: *** empty log message ***
23683
23684 * doc/bison.1: New file.
23685
236861993-06-25 Richard Stallman <rms@gnu.org>
23687
23688 * src/getargs.c: New file.
23689
236901993-06-16 Richard Stallman <rms@gnu.org>
23691
23692 * src/bison.s1: *** empty log message ***
23693
236941993-06-16 Richard Stallman <rms@gnu.org>
23695
23696 * bison.simple: *** empty log message ***
23697
236981993-06-03 Richard Stallman <rms@gnu.org>
23699
23700 * src/bison.s1: New file.
23701
237021993-06-03 Richard Stallman <rms@gnu.org>
23703
23704 * doc/bison.texinfo: *** empty log message ***
23705
237061993-06-03 Richard Stallman <rms@gnu.org>
23707
23708 * bison.simple: New file.
23709
237101993-05-19 Richard Stallman <rms@gnu.org>
23711
23712 * doc/bison.texinfo: New file.
23713
237141993-05-07 Noah Friedman <friedman@gnu.org>
23715
23716 * Makefile.in: *** empty log message ***
23717
237181993-04-28 Noah Friedman <friedman@gnu.org>
23719
23720 * src/reader.c: *** empty log message ***
23721
237221993-04-23 Noah Friedman <friedman@gnu.org>
23723
23724 * src/alloc.h: entered into RCS
23725
237261993-04-20 David J. MacKenzie <djm@gnu.org>
23727
23728 * src/version.c: *** empty log message ***
23729
23730 * src/files.c, src/allocate.c:
23731 entered into RCS
23732
23733 * src/reader.c: *** empty log message ***
23734
23735 * src/lex.c: entered into RCS
23736
23737 * src/conflicts.c: New file.
23738
23739 * src/symtab.c: entered into RCS
23740
23741 * src/alloc.h: New file.
23742
23743 * src/LR0.c: entered into RCS
23744
237451993-04-18 Noah Friedman <friedman@gnu.org>
23746
23747 * src/reader.c: New file.
23748
23749 * src/version.c: *** empty log message ***
23750
237511993-04-18 Noah Friedman <friedman@gnu.org>
23752
23753 * Makefile.in: *** empty log message ***
23754
237551993-04-17 Noah Friedman <friedman@gnu.org>
23756
23757 * Makefile.in: *** empty log message ***
23758
237591993-04-15 Richard Stallman <rms@gnu.org>
23760
23761 * src/main.c, src/files.c:
23762 New file.
23763
237641993-04-15 Noah Friedman <friedman@gnu.org>
23765
23766 * configure.in: entered into RCS
23767
23768 * configure.in: *** empty log message ***
23769
23770 * configure.in: New file.
23771
237721993-04-14 Richard Stallman <rms@gnu.org>
23773
23774 * Makefile.in: New file.
23775
237761993-04-13 Richard Stallman <rms@gnu.org>
23777
23778 * src/version.c: New file.
23779
237801993-03-25 Richard Stallman <rms@gnu.org>
23781
23782 * src/output.c: entered into RCS
23783
237841992-09-25 Richard Stallman <rms@gnu.org>
23785
23786 * configure.bat: entered into RCS
23787
237881992-06-22 Richard Stallman <rms@gnu.org>
23789
23790 * src/vmsgetargs.c: entered into RCS
23791
237921992-06-22 Richard Stallman <rms@gnu.org>
23793
23794 * doc/bison.rnh: entered into RCS
23795
237961992-04-20 David J. MacKenzie <djm@gnu.org>
23797
23798 * README: entered into RCS
23799
238001992-01-22 Richard Stallman <rms@gnu.org>
23801
23802 * src/machine.h: entered into RCS
23803
238041991-12-21 Richard Stallman <rms@gnu.org>
23805
23806 * src/lalr.c, src/closure.c:
23807 entered into RCS
23808
238091991-12-20 Richard Stallman <rms@gnu.org>
23810
23811 * src/state.h: entered into RCS
23812
238131991-12-18 Richard Stallman <rms@gnu.org>
23814
23815 * src/print.c, src/nullable.c, src/derives.c:
23816 entered into RCS
23817
238181991-11-03 David J. MacKenzie <djm@gnu.org>
23819
23820 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
23821 entered into RCS
23822
238231988-09-09 Richard Stallman <rms@gnu.org>
23824
23825 * src/bison.hairy: entered into RCS
23826
238271987-12-16 Richard Stallman <rms@gnu.org>
23828
23829 * REFERENCES: entered into RCS
dc546b0f 23830
f294a2c2 23831
04098407 23832 -----
f294a2c2 23833
04098407 23834 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e021191b
JD
23835 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
23836 2008, 2009 Free Software Foundation, Inc.
f294a2c2 23837
04098407
PE
23838 Copying and distribution of this file, with or without
23839 modification, are permitted provided the copyright notice and this
23840 notice are preserved.