]> git.saurik.com Git - bison.git/blame - ChangeLog
--trace=muscles
[bison.git] / ChangeLog
CommitLineData
5263bea9
AD
12008-11-10 Akim Demaille <demaille@gostai.com>
2
3 --trace=muscles
4 * src/getargs.h, src/getargs.c (trace_muscle): New.
5 (trace_types, trace_args): Support it.
6 * src/output.c (output_skeleton): Use it.
7
4175f6bb
AD
82008-11-10 Akim Demaille <demaille@gostai.com>
9
10 muscles_output.
11 * src/output.c (muscles_output): New, extracted from...
12 (output_skeleton): here.
13 Adjust.
14
1de69d6a
AD
152008-11-10 Akim Demaille <demaille@gostai.com>
16
17 Formatting changes.
18
36db78a7
AD
192008-11-10 Akim Demaille <demaille@gostai.com>
20
21 Update the variant example.
22 * examples/variant.yy: Formatting changes.
23 One stage build.
24
e5eb92e7
AD
252008-11-10 Akim Demaille <demaille@gostai.com>
26
27 Support constructor with an argument.
28 This improves the "list" bench by 2%.
29
30 * data/lalr1.cc (variant::build): Add an overloaded version with
31 an argument.
32 * tests/c++.at (AT_CHECK_VARIANT): Check it.
33
76307410
AD
342008-11-10 Akim Demaille <demaille@gostai.com>
35
36 Test variants.
37 * tests/c++.at (AT_CHECK_VARIANTS): New.
38 Use it with and without %define assert.
39
d78f0ac9
AD
402008-11-10 Akim Demaille <demaille@gostai.com>
41
42 Add %precedence support.
43 Unfortunately it is not possible to reuse the %prec directive. This
44 is because to please POSIX, we do not require to end the rules with a
45 semicolon. As a result,
46
47 foo: bar %prec baz
48
49 is ambiguous: either a rule which precedence is that of baz, or a rule,
50 and then a declaration of the precedence of the token baz.
51
52 * doc/bison.texinfo: Document %precedence.
53 (Precedence Only): New.
54 * src/assoc.h, src/assoc.c (precedence_assoc): New.
55 * src/conflicts.c (resolve_sr_conflict): Support it.
56 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
57 Parse it.
58 * tests/calc.at: Use %precedence for NEG.
59 * tests/conflicts.at (%precedence does not suffice)
60 (%precedence suffices): New tests.
61
c85be41a
AD
622008-11-09 Akim Demaille <demaille@gostai.com>
63
64 Make benches in a sub dirs.
65 * etc/bench.pl.in ($dir): New.
66 Use it.
67 Check the use of constructors with an argument.
68 (bench_variant_parser): Fix.
69
db65ca1f
AD
702008-11-09 Akim Demaille <demaille@gostai.com>
71
72 fix eof condition
73
9b0efa5b
AD
742008-11-09 Akim Demaille <demaille@gostai.com>
75
76 Fix --help.
77
432ac57a
AD
782008-11-09 Akim Demaille <demaille@gostai.com>
79
80 Require the generation of parse-gram.output.
81 * src/Makefile.am (YACC): Pass --report=all.
82
deef2a0a
AD
832008-11-09 Akim Demaille <demaille@gostai.com>
84
85 Formatting changes.
86
df72984a
AD
872008-11-09 Akim Demaille <demaille@gostai.com>
88
89 Update TODO.
90 * TODO: Remove obsolete items.
91 Update others.
92
f10e19fd
AD
932008-11-09 Akim Demaille <demaille@gostai.com>
94
95 Enhance bench.pl.
96 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
97 (@token, $grammar, $bench): New.
98 (generate_grammar_variant): Rename as...
99 (generate_grammar_list): this.
100 (generate_grammar): Adjust.
101 (bench_grammar): Rename as...
102 (bench): this.
103 Use it in the various bench-marking routines.
104 (-b, -g): New options.
105
5de9c593
AD
1062008-11-09 Akim Demaille <demaille@gostai.com>
107
108 Use a static hierarchy for symbols in the C++ parser.
109 * data/lalr1.cc (symbol_base_type, symbol_type)
110 (stack_symbol_type): Make it a static hierarchy.
111 Adjust dependencies.
112
757f8f98
AD
1132008-11-09 Akim Demaille <demaille@gostai.com>
114
115 bench.pl -d, --directive.
116 * etc/bench.pl.in (@directive): New.
117 (&bench_grammar): Use it.
118 (&bench_list_grammar): New, to provide access to the "variant"
119 grammar.
120 Use it.
121 (getopts): Support -d, --directive.
122
d3be4f6d
AD
1232008-11-09 Akim Demaille <demaille@gostai.com>
124
125 Use inline for small operations.
126 * data/lalr1.cc (symbol_base_type, symbol_type)
127 (stack_symbol_type): Declare constructor and other operations as
128 inline.
129 (yy_destroy_): Inline.
130
1f7d007b
AD
1312008-11-09 Akim Demaille <demaille@gostai.com>
132
133 Introduce a hierarchy for symbols.
134 * data/lalr1.cc (symbol_base_type, symbol_type): New.
135 (data_type): Rename as...
136 (stack_symbol_type): this.
137 Derive from symbol_base_type.
138 (yy_symbol_value_print_): Merge into...
139 (yy_symbol_print_): this.
140 Rename as...
141 (yy_print_): this.
142 (yydestruct_): Rename as...
143 (yy_destroy_): this.
144 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
145 (parser::parse): yyla is now of symbol_type.
146 Use its type member instead of yytoken.
147
bc0b0477
AD
1482008-11-09 Akim Demaille <demaille@gostai.com>
149
150 Rename data_type and stack_symbol_type.
151 * data/lalr1.cc (data_type): Rename as...
152 (stack_symbol_type): this.
153
57295d14
AD
1542008-11-09 Akim Demaille <demaille@gostai.com>
155
156 Handle semantic value and location together.
157 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
158 yydata.value and yydata.location.
159 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
160 (YY_SYMBOL_PRINT): Now take semantic value and location as a
161 single arg.
162 Adjust all callers.
163 (yydestruct_): New overload for a stack symbol.
164
e9b0834e
AD
1652008-11-09 Akim Demaille <demaille@gostai.com>
166
167 Push a complete symbol, not connected parts.
168 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
169 state, value and location.
170 Adjust callers.
171
6082531a
AD
1722008-11-09 Akim Demaille <demaille@gostai.com>
173
174 Agregate yylval and yylloc.
175 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
176 (parser::yyla): this.
177
33c195cc
AD
1782008-11-09 Akim Demaille <demaille@gostai.com>
179
180 Rely on the state stack to display reduction traces.
181 To display rhs symbols before a reduction, we used information about the rule
182 reduced, which required the tables yyrhs and yyprhs. Now use rely only on the
183 state stack to get the same information.
184
185 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
186 Use them.
187 (parser::yyrhs_, parser::yyprhs_): Remove.
188 (parser::yy_reduce_print_): Use the state stack.
189
e1f93869
AD
1902008-11-09 Akim Demaille <demaille@gostai.com>
191
192 Fuse yyval and yyloc into yylhs.
193 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
194 yylhs.
195 (parse): Replace yyval and yyloc with yylhs.value and
196 yylhs.location.
197 After a user action, compute yylhs.state earlier.
198 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
199 fresh error_token.
200
2935744b
DJ
2012008-11-09 Di-an Jan <dianj@freeshell.org>
202
203 Remove unused variable.
204 * src/output.c (type_names_output): Remove unused variable sep.
205
bbf9ca37
PB
2062008-11-09 Paolo Bonzini <bonzini@gnu.org>
207
208 Change tests/output.at quoting.
209 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
210 expanding arguments.
211
d9a9b96b
JD
2122008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
213
214 Don't add a semicolon to actions for %skeleton or %language.
215 It breaks Java test cases as reported by Akim Demaille.
216 * src/scan-code.l: Implement.
217
51365192
JD
2182008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
219
220 Clean up %skeleton and %language priority implementation.
221 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
222 remove static qualifier because others will soon need to see it.
223 (language_prio): Likewise.
224 (getargs): Use command_line_prio rather than 0.
225 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
226 enum fields.
227 (skeleton_prio): Extern it.
228 (language_prio): Extern it.
229 * src/parse-gram.y: Use grammar_prio rather than 1.
230
9380cfd0
AD
2312008-11-07 Akim Demaille <demaille@gostai.com>
232
233 Moving push traces into yypush_.
234 * data/lalr1.cc (yypush_): Now takes a optional trace message.
235 Adjust all uses.
236
8901f32e
AD
2372008-11-07 Akim Demaille <demaille@gostai.com>
238
239 The single-stack C++ parser is now the standard one.
240 * data/lalr1.cc: Rename as...
241 * data/lalr1-split.cc: this.
242 * data/lalr1-fusion.cc: Rename as...
243 * data/lalr1.cc: this.
244 * etc/bench.pl.in: Adjust.
245
8cdabf02
AD
2462008-11-07 Akim Demaille <demaille@gostai.com>
247
248 Avoid empty-if warnings.
249 Reported by Quentin Hocquet.
250
251 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
252 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
253
5a893c2b
AD
2542008-11-07 Akim Demaille <demaille@gostai.com>
255
256 Pass command line location to skeleton_arg and language_argmatch.
257 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
258 The location argument is now mandatory.
259 Adjust all dependencies.
260 (getargs): Use command_line_location.
261
58697c6d
AD
2622008-11-07 Akim Demaille <demaille@gostai.com>
263
264 -D, --define.
265 * src/getargs.c (usage): Document -D.
266 Fix help string for --locations.
267 (command_line_location): New.
268 (short_options, long_options, getargs): Support -D, --define.
269 (getargs): Move -d support at the right place.
270 * doc/bison.texinfo (Bison Options): Update.
271 * tests/input.at (%define, --define): New.
272
9fe5a457
AD
2732008-11-07 Akim Demaille <demaille@gostai.com>
274
275 Initialize the muscle table before parsing the command line.
276 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
277 (getargs): Define file_name.
278 * src/main.c (main): Initialize muscle_tab before calling
279 getargs.
280 * src/muscle_tab.c (muscle_init): No longer define file_name, as
281 its value is not available yet.
282
56c5eca9
AD
2832008-11-07 Akim Demaille <demaille@gostai.com>
284
285 Locations without columns for command line arguments.
286 * src/location.c (location_print): Don't display negative columns.
287 * src/location.h: Document this.
288
9b9e0a7d
AD
2892008-11-07 Akim Demaille <demaille@gostai.com>
290
291 Fix --help.
292 * src/getargs.c (usage): Fix help string for -W.
293
74eae918
AD
2942008-11-07 Akim Demaille <demaille@gostai.com>
295
296 Handle more general types of option arguments.
297 * build-aux/cross-options.pl: The argument ends at the first
298 space, not the first non-symbol character.
299 Use @var for each word appearing the argument description.
300
a3d4c6fb
AD
3012008-11-07 Akim Demaille <demaille@gostai.com>
302
303 Destroy the variants that remain on the stack in case of error.
304 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
305 destructor.
306 Display the value only if yymsg is nonnull.
307 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
308
2d32fc9f
AD
3092008-11-07 Akim Demaille <demaille@gostai.com>
310
311 Add "%define assert" to variants.
312 This is used to help the user catch cases where some value gets
313 ovewritten by a new one. This should not happen, as this will
314 probably leak.
315
316 Unfortunately this uncovered a bug in the C++ parser itself: the
317 lookahead value was not destroyed between two calls to yylex. For
318 instance if the previous lookahead was a std::string, and then an int,
319 then the value of the std::string was correctly taken (i.e., the
320 lookahead was now an empty string), but std::string structure itself
321 was not reclaimed.
322
323 This is now done in variant::build(other&) (which is used to take the
324 value of the lookahead): other is not only stolen from its value, it
325 is also destroyed. This incurs a new performance penalty of a few
326 percent, and union becomes faster again.
327
328 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
329 (b4_variant_if): New.
330 (variant::built): New.
331 Use it whereever the status of the variant changes.
332 * etc/bench.pl.in: Check the penalty of %define assert.
333
f6038cb8
AD
3342008-11-07 Akim Demaille <demaille@gostai.com>
335
336 Use "%define variant" in bench.pl.
337 * etc/bench.pl.in: No longer use the pseudo directive %variants,
338 just use %define variants.
339
ccde1f98
AD
3402008-11-07 Akim Demaille <demaille@gostai.com>
341
342 Regen.
343 * src/parse-gram.h, src/parse-gram.c: Regen.
344
58bd33b7
JD
3452008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
346
347 Fix user actions without a trailing semicolon.
348 Reported by Sergei Steshenko at
349 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
350 * THANKS (Sergei Steshenko): Add.
351 * src/scan-code.l (SC_RULE_ACTION): Fix it.
352 * tests/regression.at (Fix user actions without a trailing semicolon):
353 New test case.
354
639867b5
AD
3552008-11-04 Akim Demaille <demaille@gostai.com>
356
357 Use b4_copyright_years.
358 * data/yacc.c (b4_copyright_years): New.
359 Fix its value according to the comments in the file.
360 Use it and undefine it.
361
3c262606
AD
3622008-11-04 Akim Demaille <demaille@gostai.com>
363
364 Formatting changes.
365 * data/lalr1-fusion.cc, src/parse-gram.y: here.
366
a2b93d52
AD
3672008-11-04 Akim Demaille <demaille@gostai.com>
368
369 Formatting changes.
370 * data/lalr1-fusion.cc: here.
371
3a2803df
AD
3722008-11-04 Akim Demaille <demaille@gostai.com>
373
374 Use strict on bench.pl.
375 * etc/bench.pl.in (&run, &generate_grammar): New.
376 Rename the grammar generating functions for consistency.
377 Change the interface so that the list of benches to run is passed
378 as (optionless) arguments.
379 (&compile): Use &run.
380
a0d4650a
AD
3812008-11-04 Akim Demaille <demaille@gostai.com>
382
383 Remove spurious initial empty lines.
384 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
385 * data/yacc.c: End the @output lines with an @.
386
cac9e09b
AD
3872008-11-04 Akim Demaille <demaille@gostai.com>
388
389 Improve the display of sizes.
390 * etc/bench.p.in: Higher precision.
391 Sort by decreasing size.
392
4af4348a
AD
3932008-11-04 Akim Demaille <demaille@gostai.com>
394
395 Don't memcpy C++ structures.
396 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
397 arguments.
398 (variant::build): New overload for
399 copy-construction-that-destroys.
400 (variant::swap): New.
401 (parser::yypush_): Use it in variant mode.
402
ef05c4d6
AD
4032008-11-04 Akim Demaille <demaille@gostai.com>
404
405 Better defaults for bench.pl.
406 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
407 default values.
408 Adjust &verbose uses.
409 (-q, --quiet): New.
410
9718cfa9
AD
4112008-11-04 Akim Demaille <demaille@gostai.com>
412
413 Make variant.yy more complex.
414 std::list cannot be copied via memcpy, they are more demanding than
415 std::string. Use one std::list to strengthen the test.
416
417 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
418 Adjust.
419 Create a list of strings, instead of a single large string.
420
a6df593d
AD
4212008-11-04 Akim Demaille <demaille@gostai.com>
422
423 bench.pl --bench.
424 * etc/bench.pl.in (--bench, $bench): New.
425
006a0303
AD
4262008-11-04 Akim Demaille <demaille@gostai.com>
427
428 Sort methods.
429 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
430 Define it after as().
431
faef3466
AD
4322008-11-04 Akim Demaille <demaille@gostai.com>
433
434 Useless parens.
435 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
436
2141aded
AD
4372008-11-04 Akim Demaille <demaille@gostai.com>
438
439 Issue missing synclines after user actions.
440 * data/c.m4 (b4_case): Issue synclines on the output file.
441
e426d17b
AD
4422008-11-04 Akim Demaille <demaille@gostai.com>
443
444 Remove trailing empty line.
445 * data/lalr1-fusion.cc: Don't add an empty line after the user's
446 epilogue.
447
a9ce3f54
AD
4482008-11-04 Akim Demaille <demaille@gostai.com>
449
450 Fix output of copyright years.
451 * data/bison.m4 (b4_copyright): Fix the indentation of the
452 copyright year paragraph.
453 Use b4_copyright_years when no years are given.
454 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
455 (b4_copyright_years): New.
456 Use it.
457
59c544c2
AD
4582008-11-04 Akim Demaille <demaille@gostai.com>
459
460 Avoid the spurious initial empty line.
461 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
462 the end of @output request to suppress the empty line that
463 results.
464
96b15448
AD
4652008-11-04 Akim Demaille <demaille@gostai.com>
466
467 Remove parser::rhs_number_type.
468 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
469 (yyrhs_): Use b4_table_define.
470
f0633174
AD
4712008-11-04 Akim Demaille <demaille@gostai.com>
472
473 Fix iteration type.
474 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
475
417b8004
AD
4762008-11-04 Akim Demaille <demaille@gostai.com>
477
478 Factor the declaration of the integer tables.
479 * data/lalr1-fusion.cc (b4_table_define): New.
480 Use it.
481
1a5246c6
AD
4822008-11-03 Akim Demaille <demaille@gostai.com>
483
484 Fix indentation of tables in lalr1.cc
485 * data/lalr1-fusion.cc: Fix the indentation.
486
f8a95c9c
AD
4872008-11-03 Akim Demaille <demaille@gostai.com>
488
489 Destroy the lhs symbols after reduction.
490 * data/lalr1-fusion.cc (parse): After the user action, when in
491 variant mode, destroy the lhs symbols.
492
d7f4d823
AD
4932008-11-03 Akim Demaille <demaille@gostai.com>
494
495 Simplify yysyntax_error_ use.
496 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
497 type, but make it unnamed in the declaration when it is not used.
498
8b9c89fb
AD
4992008-11-03 Akim Demaille <demaille@gostai.com>
500
501 Let yy::variant::build return an lvalue.
502 * data/lalr1-fusion.cc (variant::build): Return a reference to the
503 object.
504
83243c24
AD
5052008-11-03 Akim Demaille <demaille@gostai.com>
506
507 Define yy::variant only when needed.
508 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
509 used.
510
429b4848
AD
5112008-11-03 Akim Demaille <demaille@gostai.com>
512
513 Bench the three-stack lalr1.cc.
514 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
515 one-stack one.
516
414c76a4
AD
5172008-11-03 Akim Demaille <demaille@gostai.com>
518
519 Fail on parse error in calc++.
520 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
521 status.
522 * examples/calc++/test ($me, $number, $exit, run): New.
523 Use them to propagate errors to the exit status.
524
8a5783fd
AD
5252008-11-03 Akim Demaille <demaille@gostai.com>
526
527 Don't specify the skeleton twice in the example.
528 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
529 file does what is needed.
530
0cc5bead
AD
5312008-11-03 Akim Demaille <demaille@gostai.com>
532
533 bench: Improve output.
534 * etc/bench.pl.in (bench_grammar): Tune the printf format.
535
5b421a4e
AD
5362008-11-03 Akim Demaille <demaille@gostai.com>
537
538 bench: check impact of %debug on variants.
539 * etc/bench.pl.in (variant_grammar): Fix the computation of
540 $variant.
541 Generate a grammar file that can work with or without %debug.
542 Do use the @directive.
543 (bench_variant_parser): Check impact of %debug.
544 (@directives): Rename all the occurrences to...
545 (@directive): this, for consistency.
546
d11ee647
AD
5472008-11-03 Akim Demaille <demaille@gostai.com>
548
549 bench: report the size too.
550 * etc/bench.pl.in ($iterations): Defaults to -3.
551 (&bench_grammar): Require hireswallclock.
552 Compute and display the size of the result.
553 More comments.
554
e1b74b92
AD
5552008-11-03 Akim Demaille <demaille@gostai.com>
556
557 bench: More use of the verbosity level.
558 * etc/bench.pl.in ($verbose, &verbose): New.
559 Use them.
560 More POD documentation.
561
7e5f9c54
AD
5622008-11-03 Akim Demaille <demaille@gostai.com>
563
564 bench.pl: a command line interface
565 * etc/bench.pl.in: More doc.
566 Some fixes in the documentation.
567 ($cflags, $iterations, &help, &getopt): New.
568 Use them.
569 (&variant_grammar): Let the number of stages be 10 times what is
570 specified.
571
7109a18d
AD
5722008-11-03 Akim Demaille <demaille@gostai.com>
573
574 Bench the use of Boost.Variants.
575 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
576 New.
577 (&compile): Be ready to compile C++ parsers.
578 (&bench_push_parser): Move debug information to the outermost
579 level.
580 * THANKS: Add Michiel De Wilde.
581
922730fe
AD
5822008-11-03 Akim Demaille <demaille@gostai.com>
583
584 bench.pl: Pass directives as a list instead of as a string.
585 * etc/bench.pl.in (&directives): New.
586 (&triangular_grammar, &calc_grammar): Use it to format the Bison
587 directives.
588 (&triangular_grammar): Do use the directives (were ignored).
589 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
590 directives.
591
7484f1d4
AD
5922008-11-03 Akim Demaille <demaille@gostai.com>
593
594 Improve genericity of bench.pl.
595 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
596 argument.
597 (&bench_push_parser): New.
598 Call it.
599
15129f25
AD
6002008-11-03 Akim Demaille <demaille@gostai.com>
601
602 Add documentation to bench.pl.
603 * etc/bench.pl.in: Comment changes.
604
0e0ed236
AD
6052008-11-03 Akim Demaille <demaille@gostai.com>
606
607 Fuse the three stacks into a single one.
608 In order to make it easy to perform benchmarks to ensure that there are no
609 performance loss, lalr1.cc is forked into lalr1-fusion.cc. Eventually,
610 lalr1-fusion.cc will replace lalr1.cc.
611
612 Meanwhile, to make sure that lalr1-fusion.cc is correctly exercized by the
613 test suite, the user must install a symbolic link from lalr1.cc to it.
614
615 Instead of having three stacks (state, value, location), use a stack
616 of triples. This considerably simplifies the code (and it will be
617 easier not to require locations as currently does the C++ parser),
618 and also gives a 10% speedup according to etc/bench (probably mainly since
619 memory allocation is done once instead of three times).
620
621 Another motivation is to make it easier to destruct properly
622 semantic values: now that they are bound to their state (hence
623 symbol type) it will be easier to call the appropriate destructor.
624
625 These changes should probably benefit the C parser too.
626
627 * data/lalr1.cc: Copy as... * data/lalr1-fusion.cc: this new
628 file.
629 (b4_rhs_value, b4_rhs_location): New definitions overriding those
630 from c++.m4.
631 (state_stack_type, semantic_stack_type, location_stack_type)
632 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
633 (data_type, stack_type, yystack_): New.
634 (YYLLOC_DEFAULT, yypush_): Adjust.
635 (yyerror_range): Now based on data_type, not location_type.
636
7dedf26e
AD
6372008-11-03 Akim Demaille <demaille@gostai.com>
638
639 Push the state, value, and location at the same time.
640 This is needed to prepare a forthcoming patch that fuses the three
641 stacks into one.
642
643 * data/lalr1.cc (parser::yypush_): New.
644 (parser::yynewstate): Change the semantics: instead of arriving to
645 this label when value and location have been pushed, but yystate
646 is to be pushed on the state stack, now the three of them must
647 have been pushed before. yystate still must be the new state.
648 This allows to use yypush_ everywhere instead of individual
649 handling of the stacks.
650
c4585f1e
AD
6512008-11-03 Akim Demaille <demaille@gostai.com>
652
653 Prefer references to pointers.
654 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
655 definition to use references instead of pointers.
656 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
657 Take the value and location as references.
658 Adjust callers.
659
56017c17
AD
6602008-11-03 Akim Demaille <demaille@gostai.com>
661
662 stack::size instead of stack::height.
663 * data/lalr1.cc (stack::height): Rename as...
664 (stack::size): this.
665 Fix the output type.
666 Comment changes.
667
5ab8c47b
AD
6682008-11-03 Akim Demaille <demaille@gostai.com>
669
670 Use variants to support objects as semantic values.
671 This patch was inspired by work by Michiel De Wilde. But he used Boost
672 variants which (i) requires Boost on the user side, (ii) is slow, and
673 (iii) has useless overhead (the parser knows the type of the semantic value
674 there is no reason to duplicate this information as Boost.Variants do).
675
676 This implementation reserves a buffer large enough to store the largest
677 objects. yy::variant implements this buffer. It was implemented with
678 Quentin Hocquet.
679
680 * src/output.c (type_names_output): New.
681 (output_skeleton): Invoke it.
682 * data/c++.m4 (b4_variant_if): New.
683 (b4_symbol_value): If needed, provide a definition for variants.
684 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
685 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
686 (b4_char_sizeof, yy::variant): New.
687 (parser::parse): If variants are requested, define
688 parser::union_type, parser::variant, change the definition of
689 semantic_type, construct $$ before running the user action instead
690 of performing a default $$ = $1.
691 * examples/variant.yy: New.
692 Based on an example by Michiel De Wilde.
693
1fa5d8bb
AD
6942008-11-03 Akim Demaille <demaille@gostai.com>
695
696 Parameterize the extraction of semantic values.
697 To make future changes easier, no longer rely on ".TYPE" being the
698 way to get a semantic value.
699
700 * data/c.m4 (b4_symbol_value): New.
701 Use it.
702 * data/c++.m4, data/yacc.c: Use it.
703 * data/glr.c: Use b4_symbol_value.
704 (b4_rhs_data): New.
705 Use it.
706
91ba8a55
AD
7072008-11-03 Akim Demaille <demaille@gostai.com>
708
709 Prepare easier M4 changes.
710 * data/lalr1.cc: Use escaped [] instead of literals to prepare
711 future changes.
712
c9ba9e59
JD
7132008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
714
715 Initiate further development.
716 * NEWS: Create an empty section for new entries.
717 * gnulib: Update submodule to HEAD.
718
bfb40910
JD
7192008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
720
721 * NEWS: Version 2.4.
722
241fda7a
JD
7232008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
724
725 Prepare for next release.
726 * NEWS: Briefly mention changes since 2.3b.
727 * README: Say GNU m4 1.4.6, which we've been requiring in release
728 announcements already, not 1.4.3, which breaks the build.
729
ed4d67dc
JD
7302008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
731
732 Say %language is experimental.
733 We're thinking of extending it's effect on output file naming. See the
734 thread at
735 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
736 * NEWS: Say it's experimental.
737 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
738 recommend it over %skeleton for now.
739 (Bison Options): Likewise.
740 (C++ Bison Interface): Use %skeleton not %language.
741 (Calc++ Parser): Use %skeleton not %language.
742 * src/getargs.c (usage): Say it's experimental.
743
e254a580
DJ
7442008-11-01 Di-an Jan <dianj@freeshell.org>
745 Paolo Bonzini <bonzini@gnu.org>
746
747 Support all Java parser class modifiers.
748 * data/java.m4 (b4_percent_define_get3): New.
749 (b4_final_if, b4_strictfp_if): New.
750 * data/lalr1.java (final, strictfp, extends, implements): Support.
751 * doc/bison.texinfo (final, strictfp, extends, implements): Add
752 documentation.
753 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
754 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
755 (AT_CHECK_JAVA_GREP): New.
756 (Java parser class modifiers): New test.
757 (Java parser class extends and implements): New test.
758
759 Model exception propagation better with throws and lex_throws.
760 * data/java.m4 (b4_list2): New.
761 (throws): Change default.
762 * data/lalr1.java (yyaction): Add throws.
763 (parse): Add lex_throws in addition to throws.
764 * doc/bison.texinfo (throws, lex_throws): Add documentation.
765 * tests/java.at (Java throws specifications): New test.
766
767 Improve documentation for Java parsers.
768 * doc/bison.texinfo (Java Parsers): Add subsections.
769 Don't quote first argument of %define.
770 (Java Bison Interface): Document output files. Move documentation
771 of parser class and merge into Java Parser Interface. Document
772 features that error out. Document directives with no effect.
773 Move note about Javadoc higher.
774 (Java Semantic Values): Explicitly mention stype.
775 Document that generic types cannot be used.
776 (Java Location Values): Use @deftypeivar. Document constructors.
777 Correct return value for toString.
778 (Java Parser Interface): List undocumented constants/fields.
779 Move documentation of fields added by %parse-param closer to list
780 of members. Document that token names are added as fields.
781 Document constructors accurately. Remove error method.
782 (Java Scanner Interface): Move note on %pure-parser to Java Bison
783 Interface. Describe %code lexer and yylex accutately.
784 Remove documentation that does not match the code.
785 (Java Action Features): New.
786 (Java Differences): Add reference. Add item on semantic values.
787 Add note about @{ ... @}. Clarify %% epilogue placement.
788 (Java Declarations Summary): New.
789
790 Fix Java skeleton.
791 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
792 (b4_remove_comma): Quote test argument.
793 (b4_identification): Remove "bison" field.
794 * tests/java.at (Java parser class and package names): New test.
795 (Java %parse-param and %lex-param): New test.
796 (Java stype, position_class and location_class): New test.
797
f259e4e6
PB
7982008-10-31 Di-an Jan <dianj@freeshell.org>
799
800 * data/lalr1.jave: Update copyright years.
801 (YYParser): Correct name of "generated from" file in Javadoc:
802 use b4_file_name instead of @ofile@.
803 (Location constructor): Correct Javadoc parameter name.
804 (yylloc): Add missing opening m4 quote after b4_location_if.
805 This removes a stray [ in the Javadoc of Lexer.getStartPos.
806 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
807 (YYParser constructor): Correct Javadoc parameter name.
808
cae5057f
JD
8092008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
810
811 Always put auxiliary code files in the same dir as other output files.
812 * src/files.c (compute_file_name_parts): When the user specifies
813 --output but not --file-prefix, extract the directory prefix from the
814 file prefix not from the grammar file name. This affects the location
815 of files like location.hh generated by the C++ skeleton. The includes
816 in the other output files require this fix.
817 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
818 for expected output files.
819 (Output files): Add a test for the above.
820
4af432ba
JD
8212008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
822
823 * gnulib: Update submodule to HEAD.
824
e26d4e43
JD
8252008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
826
827 Update copyright year.
828 * src/files.c: Here.
829
c0ee9e21
DJ
8302008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
831
832 Don't overwrite the input file.
833 * src/files.c (output_file_name_check): Fatal error if using input file
834 for output.
835 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
836 argument.
837 (Conflicting output files): Add test.
838
482dc52f
AD
8392008-10-28 Akim Demaille <demaille@gostai.com>
840
841 Space changes.
842 * data/lalr1.cc: Formatting changes.
843
52cbbe84
AD
8442008-10-28 Akim Demaille <demaille@gostai.com>
845
846 Don't define debugging functions when !YYDEBUG.
847 * data/lalr1.cc (debug_stream, set_debug_stream)
848 (debug_level_type, debug_level, set_debug_level): Don't
849 declare them when YYDEBUG is not defined.
850 The implementation are already YYDEBUG-aware.
851
0925d5bf
AD
8522008-10-28 Akim Demaille <demaille@gostai.com>
853
854 Prefer "continue" for empty loop bodies.
855 * etc/bench.pl.in: Use "continue" instead of {}.
856
cf98343c
AD
8572008-10-28 Akim Demaille <demaille@gostai.com>
858
859 Space and comments changes.
860 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
861 * data/c.m4, data/lalr1.cc: Space changes.
862
9f467b7d
AD
8632008-10-28 Akim Demaille <demaille@gostai.com>
864
865 Make gnulib a submodule.
866 * gnulib: New.
867 * .gitmodules (gnulib): New.
868
0f0e1ace
JD
8692008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
870
871 Fix yyerror_range for user-defined location type in C++. Reported by
872 Georg Sauthoff at
873 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
874 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
875 * THANKS (Georg Sauthoff): Add.
876
548e2104
JD
8772008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
878
879 Update several administrative files mainly to facilitate releasing.
880 * HACKING (Administrivia): Make the git-merge-changelog notes more
881 helpful.
882 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
883 (Release Procedure): Update for git and add numerous details that were
884 previously missing.
885 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
886 * maint.mk (announcement): Don't list bison as a bootstrap tool so
887 that announcements don't claim we bootstrapped with whatever bison
888 happened to be in PATH. Add flex as a bootstrap tool.
889 * Makefile.maint: Remove, previously replaced by maint.mk.
890 * Makefile.cfg: Remove, and migrate settings to...
891 * cfg.mk: ... here for the sake of `make announcement'.
892 * bootstrap.conf (gnulib_modules): Add announce-gen.
893 * README: Say GNU Bison instead of just Bison. Suggested by Karl
894 Berry.
895
ddf17a6e
PB
8962008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
897
898 Small but important bugfixes for the Java skeleton.
899 * data/lalr1.java (yyerror): Change Location to b4_location_type.
900 (yy_symbol_print): Call toString on yyvaluep.
901
e1145ad8
AD
9022008-08-29 Akim Demaille <demaille@gostai.com>
903
904 Clarify UPDATED use.
905 * doc/bison.texinfo: It refers to the last edition of this file,
906 not to the release date of Bison.
907 Reported by Joel E. Denny.
908
0df72d78
AD
9092008-08-29 Akim Demaille <demaille@gostai.com>
910
911 * README: Update FAQ pointer.
912 Reported by Joel E. Denny.
913
9a90b6bb
EB
9142008-08-27 Eric Blake <ebb9@byu.net>
915
916 Resync m4sugar from autoconf.
917 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
918 (m4_init): Adjust to latest m4.git changes.
919 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
920 effects.
921 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
922 (_m4_list_cmp): Reduce side effects.
923
65015668
AD
9242008-08-27 Akim Demaille <demaille@gostai.com>
925
926 Check yyerrok in calc.at.
927 * tests/calc.at (calc.y): Use yyerrok on "( error )".
928 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
929 expected.
930
98e26a92
AD
9312008-08-27 Akim Demaille <demaille@gostai.com>
932
933 Support yyerrok in lalr1.cc.
934 YYBACKUP is still to import back into lalr1.cc.
935 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
936
86c0e784
JD
9372008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
938
939 For maintainer-check*, don't recompile for a $(VERSION) update.
940 * cfg.mk: New file.
941 (_is-dist-target): Override the one in GNUmakefile.
942 * Makefile.am (EXTRA_DIST): Add cfg.mk.
943
88511166
JD
9442008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
945
946 Update for recent change to gnulib.
947 * src/parse-gram.y: Don't include strverscmp.h. It comes from
948 string.h now.
949
6bbb2ed5
EB
9502008-08-15 Eric Blake <ebb9@byu.net>
951
d67c52e8
EB
952 Remaining m4sugar merge from autoconf.
953 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
954 * data/m4sugar/foreach.m4: New file, copied from autoconf.
955 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
956 * src/output.c (output_skeleton): Tell m4 how to find it.
957
6bbb2ed5
EB
958 Partial m4sugar merge from autoconf: m4_map.
959 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
960 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
961 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
962 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
963 for empty list.
964 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
965 Likewise.
966 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
967 declares it.
968
8dce3875
JD
9692008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
970
971 Keep .version and PACKAGE_VERSION in sync.
972 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
973 dependency, and add comments justifying this in more detail. Discussed
974 starting at
975 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
976
882a1fbf
EB
9772008-08-06 Eric Blake <ebb9@byu.net>
978
a3764451
EB
979 Partial m4sugar merge from autoconf: m4_shiftn.
980 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
981 (m4_shift2, m4_shift3): New macros.
982 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
983 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
984 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
985 * data/java.m4 (b4_remove_comma): Likewise.
986
882a1fbf
EB
987 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
988 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
989 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
990 (m4_init): Consolidate wrapped text into single m4_wrap.
991 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
992 in wrapped text.
993
a30e920d
EB
9942008-08-05 Eric Blake <ebb9@byu.net>
995
dfcc5959
EB
996 Partial m4sugar merge from autoconf: builtins, version.m4.
997 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
998 (m4_prepend): Remove, as it is unused and inherently quadratic,
999 whereas m4_append is linear in newer m4.
1000 (m4_mkstemp): New builtin.
1001 (m4_symbols): Make rename conditional.
1002 (m4_version_prereq): Ensure fatal error if used in bison, which
1003 intentionally lacks version.m4.
1004
a30e920d
EB
1005 Fix comments in m4sugar.
1006 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1007
445b7470
JD
10082008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1009
1010 Update for recent .gitignore fix in Gnulib.
1011 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1012 anchored .gitignore entries.
1013
a1e50014
JD
10142008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1015
1016 Set gnu or gnits strictness.
1017 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1018 development and gnits strictness for releases. Based on Eric Blake's
1019 suggestion at
1020 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1021
d43f77e7
PB
10222008-07-31 Paolo Bonzini <bonzini@gnu.org>
1023
1024 * NEWS: Clarify documentation of %language.
1025
fee2ed87
PB
10262008-07-31 Paolo Bonzini <bonzini@gnu.org>
1027
1028 Support usage of git-merge-changelog.
1029 * .gitattributes: New.
1030 * HACKING: Document usage of git-merge-changelog.
1031 * bootstrap: Install git-merge-changelog entries in .git/config
1032 if appropriate.
1033
78029cd5
JD
10342008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1035
1036 Remove remaining dependence on CVS Id keyword.
1037 * ChangeLog: For the sake of people still using CVS, don't use dollars
1038 when mentioning Id.
1039 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1040 unusual anyway.
1041 * data/xslt/xml2dot.xsl: Likewise.
1042 * data/xslt/xml2text.xsl: Likewise.
1043 * data/xslt/xml2xhtml.xsl: Likewise.
1044 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1045 * doc/Makefile.am (neutralize): Remove, no longer needed.
1046 (.x.1): Don't use neutralize.
1047 (edit): Don't substitute for ID.
1048 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1049
c53d18b1
JD
10502008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1051
1052 Fix dependence on computed configure variables.
1053 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1054 $(top_srcdir)/configure.ac so that changes to computed variables, such
1055 as PACKAGE_VERSION, are seen.
1056 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1057
5523ac79
JD
10582008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1059
1060 Update copyright dates for recent changes.
1061 * Makefile.am: Here.
1062 * src/Makefile.am: Here.
1063 * src/reduce.c: Here.
1064 * tests/reduce.at: Here.
1065
8fa36911
JD
10662008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1067
1068 Use git-version-gen for version names between releases.
1069 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1070 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1071 * .prev-version: New.
1072 * .version.in: Remove.
78029cd5 1073 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
1074 revision.
1075 * GNUmakefile: Remove, now copied from Gnulib.
1076 * Makefile.am: Add code suggested by comments in
1077 build-aux/git-version-gen.
1078 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1079 .prev-version, and .version.
1080 * NEWS (2.3b+): Rename to...
1081 (?.?): ... this because we're dropping the "+" version naming scheme,
1082 but, in general, we still can't be sure of our next release name.
1083 * bootstrap: Add a quick hack to remove from .gitignore the
1084 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1085 entry. This should really be fixed in gnulib instead.
1086 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1087 * configure.ac (AC_INIT): Set version name by invoking
1088 build-aux/git-version-gen.
1089 (AC_CONFIG_FILES): Remove .version, now generated by
1090 build-aux/git-version-gen.
1091 * maint.mk: New, copied from coreutils.
1092 * doc/.cvsignore (bison.1): Add.
1093 * doc/.gitignore (/bison.1): Add.
1094 * doc/bison.1: Remove, generated.
1095 * src/.cvsignore (revision.c): Remove.
1096 * src/.gitignore (/revision.c): Remove.
1097 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1098 (BUILT_SOURCES): Remove revision.c.
1099 (revision.c): Remove.
1100 * src/getargs.c (version): Don't print revision after the VERSION.
1101 * src/revision.h: Remove.
1102
bcf07cb7
JD
11032008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1104
1105 Fix untranslatable composition of sentences. Reported by Goran
1106 Uddeborg at
1107 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1108 * THANKS (Goran Uddeborg): Add.
1109 * src/reduce.c (reduce_print): Report the number of nonterminals and
1110 rules useless in the grammar in separate sentences.
1111 * tests/reduce.at (Useless Rules): Update output.
1112 (Reduced Automaton): Likewise.
1113 (Underivable Rules): Likewise.
1114 (Empty Language): Likewise.
1115
9aacab9a
JD
11162008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1117
1118 Fix some .gitignore and .cvsignore problems.
1119 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1120 (insert_vc_ignore): ... this new function, which prepends `/' to all
1121 .gitignore entries before passing them to insert_sorted_if_absent.
1122 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1123 .cvsignore files are maintained even though Bison developers run
1124 bootstrap while using Git.
1125 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1126 unneeded by Bison.
1127 (gnulib): Add.
1128 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1129 unneeded. Reported by Eric Blake.
1130 * lib/.gitignore (/*~): Add.
1131 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1132 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1133 Blake.
1134 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1135
a9fc7990
JD
11362008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1137
1138 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1139 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1140 * bootstrap.conf (gnulib_modules): Add unsetenv.
1141 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1142 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1143 (/setenv.m4): Add.
1144 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1145 the first argument because it may become position-dependent, and unset
1146 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1147 Add comments explaining these issues in more detail.
1148
0f1d6f10
JD
11492008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1150
1151 Add .gitignore everywhere based on .cvsignore.
1152 * .gitignore: New.
1153 * build-aux/.gitignore: New.
1154 * data/.gitignore: New.
1155 * doc/.gitignore: New.
1156 * etc/.gitignore: New.
1157 * examples/.gitignore: New.
1158 * examples/calc++/.gitignore: New.
1159 * lib/.gitignore: New.
1160 * m4/.gitignore: New.
1161 * po/.gitignore: New.
1162 * runtime-po/.gitignore: New.
1163 * src/.gitignore: New.
1164 * tests/.gitignore: New.
1165
7bd1665a
JD
11662008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1167
1168 * NEWS (2.3b+): New section, empty for now.
1169 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1170
72c5b982
JD
11712008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1172
1173 * NEWS (2.3b): Update release date since there has been a delay in
1174 getting the announcements and tarballs out.
1175
bd02cd5d
JD
11762008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1177
1178 * NEWS: Version 2.3b.
1179 * configure.ac (AC_INIT): Likewise.
1180 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1181
9126263e
JD
11822008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1183
1184 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1185 been doing it for years.
1186 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1187 (Release Procedure): Add FIXME about make alpha being unmaintained.
1188
fa6aa7b3
JD
11892008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1190
1191 * data/yacc.c: Reformat m4 a little for readability.
1192 * src/lalr.c (build_relations): Correct comment.
1193
d30b312d
JMG
11942008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1195
1196 DJGPP specific issue.
1197 * djgpp/config.sed: Fixes required to run configure scripts generated
1198 by autoconf 2.62.
1199
138d4cd9
JD
12002008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1201
1202 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1203 coordinator@translationproject.org.
1204
8f7e2e1f
JD
12052008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1206
1207 * THANKS: Add Eric Blake.
1208
f55efa38
JD
12092008-04-23 Eric Blake <ebb9@byu.net>
1210
1211 Revert prior patch, by working around autoconf regression.
1212 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1213 ("Output file name: ("): Uncomment test.
1214 ("Output file name: )"): Likewise.
1215 Based on an idea from Noah Misch.
1216
096c9f9d
JD
12172008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1218
1219 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1220 2.61. Reported by Juan Manuel Guerrero at
1221 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1222 * tests/output.at ("Output file name: ("): Comment out test case for
1223 now.
1224 ("Output file name: )"): Likewise.
1225
0f664b89
JD
12262008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1227
1228 * GNUmakefile: Update git-version-gen invocation so make dist
1229 succeeds.
1230
1cfe6375
JD
12312008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1232
1233 Update to the current gnulib CVS repository, and fix trigraph handling
1234 in Bison.
1235 * bootstrap: Update gnulib CVS repository URL.
1236 (symlink_to_dir): Encapsulate the code that guarantees the destination
1237 directory exists into...
1238 (check_dst_dir): ... this new function, and...
1239 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1240 fail when copying files into lib/uniwidth/.
1241 * src/output.c (prepare_symbols): When writing yytname muscles, where
1242 symbol names will be encoded in C-string literals, tell quotearg to
1243 escape trigraphs. This used to be the default in gnulib.
1244 * tests/regression.at (Token definitions): Because of the change in
1245 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1246 escapes trigraphs in symbol names. Thus, yytname no longer has
1247 trigraphs unnecessarily doubly escaped. Update test case output.
1248 Extend test case to be sure Bison's own error messages will no longer
1249 have trigraphs in symbol names unnecessarily escaped once.
1250
74c52fc8
JD
12512008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1252
1253 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1254 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1255 * .cvsignore: Add .version.
1256 * .version.in: New.
1257 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1258 * configure.ac (AC_CONFIG_FILES): Add .version.
1259 * build-aux/.cvsignore: Add git-version-gen.
1260
8e55b3aa
JD
12612008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1262
1263 * NEWS (2.3a+): Mention that -g now takes an argument.
1264 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1265 consistency. Update the -g and -x entries now that they take
1266 arguments. Use brackets to indicate optional arguments.
1267 * src/getargs.c (usage): Explain the relationship between arguments of
1268 long and short options more completely. Document --defines and -d
1269 separately since the former takes an argument but, for POSIX Yacc, the
1270 latter does not.
1271 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 1272 (getargs): Sort cases.
8e55b3aa 1273
59c5ac72
AD
12742008-02-28 Akim Demaille <demaille@gostai.com>
1275
1276 * doc/bison.texinfo: Fix a few typos.
1277
118d4978
AD
12782008-02-28 Akim Demaille <akim@epita.fr>
1279
1280 * doc/bison.texinfo (Bison Options): Document -W.
1281 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1282
7020f1e9
AD
12832008-02-28 Akim Demaille <akim@epita.fr>
1284
1285 * src/getargs.c (short_options): Split and sort for readability.
1286 -g and -x take optional arguments, just like their long options.
1287 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1288 understand.
1289 Fix the handling of $opt which resulted in all the argument to be
1290 considered as optional.
1291
59da312b
JD
12922008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
1293
1294 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
1295 say its interface is experimental.
1296 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1297 Java.
1298 (Bison Options): In the -L and --language entry, mention Java.
1299 (Java Bison Interface): Say the interface is experimental.
1300 * src/getargs.c (usage): Mention -L and --language.
1301
1302 * NEWS (2.3a+): Say the push parsing interface is experimental.
1303 * doc/bison.texinfo (Push Decl): Likewise.
1304 (Decl Summary): Likewise in the "%define api.push_pull" entry.
1305 (Push Parser Function): Likewise.
1306 (Pull Parser Function): Likewise.
1307 (Parser Create Function): Likewise.
1308 (Parser Delete Function): Likewise.
1309 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
1310 yypull_parse, and yypush_parse entries.
1311
1312 * NEWS (2.3a+): Mention XML support, and say the schema is
1313 experimental.
1314 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
1315 * src/getargs.c (usage): Say the XML schema is experimental.
1316
1317 * NEWS (2.3a+): Say option instead of flag.
1318
2bb3ebec
WP
13192008-02-21 Wojciech Polak <polak@gnu.org>
1320
1321 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
1322 text.
1323
333e670c
JD
13242008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
1325
1326 Fix impure push parser compile error reported by Bob Rossi at
1327 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
1328 * data/yacc.c: Clean up whitespace in the output a little.
1329 (yypstate_allocated): Define for impure push parsers regardless of
1330 whether the pull interface is also requested.
1331 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
1332 check impure push parsers without the pull interface.
1333
1334 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
1335 yyerror takes arguments specified by %parse-param while yypstate_new
1336 does not.
1337 * doc/bison.texinfo (Parser Create Function): Document that
1338 yypstate_new returns 0 for multiple impure parser instances.
1339 * tests/push.at (Push Parsing: Multiple impure instances): Update
1340 expected stderr output.
1341
798096e1
JD
13422008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1343
1344 * runtime-po/POTFILES.in (push.c): Remove.
1345
9ca7f077
JD
13462008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1347
1348 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
1349 * data/push.c: Rename to...
1350 * data/yacc.c: ... this, overwriting it.
1351 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
1352 `%push-pull-parser' -> `%define api.push_pull "both"'.
1353 Remove old yacc.c tests, and update push.c tests to yacc.c.
1354
42ee26bb
JD
13552008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
1356
1357 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
1358 `"%code top" blocks' instead of `%code "top" blocks'.
1359 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
1360 Clean up whitespace in the output a little.
1361
b1cc23c4
JD
13622008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1363
1364 Fix documentation problems reported by Tim Josling at
1365 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
1366 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
1367 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
1368 integers. Explain the effect of literal string aliases on error
1369 messages. Copy token 0 documentation from the C++ skeleton
1370 documentation.
1371
ab7f29f8
JD
13722008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
1373
1374 Accept a token number in a %left, %right, or %nonassoc for POSIX
1375 conformance. Reported by Tim Josling at
1376 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
1377 * NEWS (2.3a+): Mention.
1378 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
1379 and code numbers are treated by precedence declarations.
1380 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
1381 of symbols.1.
1382 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
1383 of symbol.
1384 (symbol.prec): New, just like symbol but allows INT.
1385 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
1386 longer holds.
1387 * tests/regression.at (Token number in precedence declaration): New
1388 test case.
1389
a924ef36
JMG
13902008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1391
1392 DJGPP specific issues.
1393 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
1394 be changed. Copyright timestamp adjusted.
1395 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
1396 be changed. Copyright timestamp adjusted.
1397 * djgpp/config.site: Copyright timestamp adjusted.
1398 * djgpp/config_h.sed: Copyright timestamp adjusted.
1399 * djgpp/djunpack.bat: Copyright timestamp adjusted.
1400 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
1401 filename translation list.
1402 * djgpp/subpipe.c (init_subpipe): Check the environment variables
1403 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
1404 files shall be created. Before trying to use the temp dir where the
1405 environment variable points to check that the dir really exists. If
1406 not default to the cwd as temp dir. Copyright timestamp adjusted.
1407 * djgpp/subpipe.h: Copyright timestamp adjusted.
1408 * djgpp/testsuite.sed: Copyright timestamp adjusted.
1409
389c8cfd
PE
14102008-01-30 Paul Eggert <eggert@cs.ucla.edu>
1411
1412 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
1413
5d1cfef4
PE
14142008-01-09 Paul Eggert <eggert@cs.ucla.edu>
1415
1416 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
1417 Problem reported by Claudio Saavedra in
1418 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
1419
e2dcf996
WP
14202008-01-05 Wojciech Polak <polak@gnu.org>
1421
1422 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
1423 document's title with the input grammar file name.
1424
da730230
JD
14252007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
1426
1427 Automate regression testing of the XML/XSLT implementation. Discussed
1428 starting at
1429 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
1430 * configure.ac (XSLTPROC): New substitution.
1431 * Makefile.am (maintainer-xml-check): New phony target invoking...
1432 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
1433 invoking make maintainer-check with BISON_TEST_XML=1.
1434 * tests/atlocal.in (XSLTPROC): New.
1435 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
1436 not to report reachable memory when Bison is expected to have a
1437 non-zero exit status and (2) to compare XML/XSLT output with --graph
1438 and --report=all output for every working grammar when
1439 BISON_TEST_XML=1.
1440 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
1441 (AT_BISON_CHECK_XML): New.
1442 (AT_QUELL_VALGRIND): New.
1443 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
1444 (AT_CHECK): ... don't redefine this since this was the old way to
1445 quell Valgrind.
1446 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
1447 AT_BISON_CHECK invocations.
1448 * tests/c++.at: Likewise.
1449 * tests/calc.at: Likewise.
1450 * tests/conflicts.at: Likewise.
1451 * tests/cxx-type.at: Likewise.
1452 * tests/existing.at: Likewise.
1453 * tests/glr-regression.at: Likewise.
1454 * tests/headers.at: Likewise.
1455 * tests/input.at: Likewise.
1456 * tests/java.at: Likewise.
1457 * tests/output.at: Likewise.
1458 * tests/push.at: Likewise.
1459 * tests/reduce.at: Likewise.
1460 * tests/regression.at: Likewise.
1461 * tests/sets.at: Likewise.
1462 * tests/skeletons.at: Likewise.
1463 * tests/synclines.at: Likewise.
1464 * tests/torture.at: Likewise.
1465 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
1466 tends to hang xsltproc.
1467 (Big horizontal): Likewise.
1468
408476bc
JD
14692007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1470
1471 In XML output, remove redundant class attribute on symbol element.
1472 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
1473 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
1474 look up a symbol to determine whether it's a nonterminal or terminal.
1475 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
1476 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
1477
1478 Add prec/assoc information to XML output.
1479 * src/gram.c (grammar_rules_print_xml): For each rule that has a
1480 %prec, add a percent_prec attribute.
1481 * src/print-xml.c (print_grammar): For each terminal that has a
1482 precedence or associativity, add a prec or assoc attribute.
1483 (xml_indent): New.
1484 (xml_puts): Use xml_indent.
1485 (xml_printf): Use xml_indent.
1486 * src/print-xml.h (xml_indent): Prototype.
1487
1488 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
1489 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
1490
d4a26c48
JD
14912007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
1492
1493 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
1494 (bison:ruleByNumber): ... this for clarity.
1495 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
1496 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
1497 (xsl:template match="reduction"): Update.
1498 (xsl:template match="item"): Update.
1499 (xsl:template match="reduction"): Update.
1500
1501 In the XML output, don't print the list of rules where symbols appear.
1502 Compute it in XSLT instead. Discussed at
1503 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
1504 * data/xslt/bison.xsl (bison:ruleByLhs): New.
1505 (bison:ruleByRhs): New.
1506 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
1507 bison:ruleByRhs.
1508 (xsl:template match="terminal/rule"): Remove.
1509 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1510 bison:ruleByRhs.
1511 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1512 Remove.
1513 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
1514 bison:ruleByRhs and mode="number-link" for rule template.
1515 (xsl:template match="terminal/rule"): Remove.
1516 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
1517 bison:ruleByRhs and mode="number-link" for rule template.
1518 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
1519 Rewrite as...
1520 (xsl:template match="rule" mode="number-link"): ... this.
1521 * src/print-xml.c (print_grammar): Don't print the list of rules.
1522
ef1b4273
JD
15232007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
1524
1525 Don't let --report affect XML output; always print all information.
1526 Discussed at
1527 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
1528 * src/conflicts.c (log_resolution): Implement.
1529 * src/print-xml.c (print_core): Implement.
1530 (print_state): Implement.
1531 (print_xml): Implement.
1532
1533 * NEWS (2.3a+): Fix quotes.
1534 * src/parse-gram.y (prologue_declaration): For consistency with -v,
1535 don't let %verbose clear the list specified by --report.
1536
0f6cd9e3
AD
15372007-11-26 Akim Demaille <akim@epita.fr>
1538
1539 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
1540
d80fb37a
JD
15412007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
1542
1543 In the XML output, list useless and unused symbols and rules with the
1544 useful ones and add a "usefulness" attribute. Discussed starting at
1545 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
1546 * src/gram.c (grammar_rules_partial_print_xml): Remove.
1547 (grammar_rules_print_xml): Print all rules instead of just those
1548 useful in the grammar, and add a "usefulness" attribute.
1549 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
1550 * src/print-xml.c (print_rules_useless_in_parser): Remove.
1551 (print_grammar): Print all nonterminals instead of just useful ones,
1552 and add a "usefulness" attribute to nonterminals and terminals.
1553 (print_xml): Don't print a separate "reductions" or
1554 "rules-useless-in-parser" element.
1555 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
1556 (reduce_xml): Remove.
1557 (reduce_token_unused_in_grammar): New.
1558 (reduce_nonterminal_useless_in_grammar): New.
1559 * src/reduce.h (reduce_xml): Remove prototype.
1560 (reduce_token_unused_in_grammar): Add prototype.
1561 (reduce_nonterminal_useless_in_grammar): Add prototype.
1562 * data/xslt/xml2text.xsl: Update for XML changes.
1563 * data/xslt/xml2xhtml.xsl: Update for XML changes.
1564 * tests/reduce.at (Useless Terminals): Update output.
1565 (Useless Rules): Update output.
1566 (Reduced Automaton): Update output.
1567
1568 Say "Terminals unused in grammar" instead of "Unused terminals".
1569 * NEWS (2.3a+): Update.
1570 * doc/bison.texinfo (Understanding): Update example output.
1571 * src/reduce.c (reduce_output): Implement.
1572 * data/xslt/xml2text.xsl: Implement.
1573 * data/xslt/xml2xhtml.xsl: Implement.
1574
1bb2bd75
JD
15752007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1576
1577 Accept --report-file=FILE to override the default `.output' filename.
1578 * NEWS (2.3a+): Mention.
1579 * doc/bison.texinfo (Bison Options): Add an entry.
1580 * src/files.c (compute_output_file_names): Don't override
1581 spec_verbose_file if already set.
1582 * src/getargs.c (usage): Document --report-file.
1583 (REPORT_FILE_OPTION): New anonymous enum member.
1584 (long_options): Add entry for it.
1585 (getargs): Add case for it setting spec_verbose_file.
1586
1587 * build-aux/cross-options.pl: Don't record a short option just because
1588 there's an arg.
1589 * doc/.cvsignore: Add yacc.1.
1590
a005a9c4
AD
15912007-11-14 Akim Demaille <akim@epita.fr>
1592
1593 * doc/yacc.1.in: New.
1594 * configure.ac, doc/Makefile.am: Adjust.
1595 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
1596 config.h symbol.
1597 Use AC_SUBST for assignments too.
1598 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
1599
cff03fb2
JD
16002007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
1601
1602 * src/gram.c: Remove comments that duplicate comments in gram.h.
1603
1604 When reporting useless rules and nonterminals, say "useless in grammar"
1605 instead of "useless", and say "useless in parser" instead of "never
1606 reduced". Discussed starting at
1607 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
1608 * NEWS (2.3a+): Mention this change.
1609 * data/xslt/xml2text.xsl: Update output text and expected input XML
1610 element names to match changes below.
1611 * data/xslt/xml2xhtml.xsl: Likewise.
1612 (xsl:template match="bison-xml-report"): Add missing entry in Table of
1613 Contents: "Rules useless in parser due to conflicts".
1614 * doc/bison.texinfo (Decl Summary): Reword a little.
1615 (Understanding): Update example output for changes below.
1616 * src/gram.c: (rule_useful_p): Rename to...
1617 (rule_useful_in_grammar_p): ... this.
1618 (rule_useless_p): Rename to...
1619 (rule_useless_in_grammar_p): ... this.
1620 (rule_never_reduced_p): Rename to...
1621 (rule_useless_in_parser_p): ... this.
1622 (grammar_rules_print): Update for renames.
1623 (grammar_rules_print_xml): Update for renames.
1624 (grammar_rules_never_reduced_report): Rename to...
1625 (grammar_rules_useless_report): ... this since it is used for either
1626 kind of useless rule.
1627 * src/gram.h: Reword comments and update function names in prototypes.
1628 * src/main.c (main): Say "rule useless in parser due to conflicts".
1629 * src/print-xml.c (print_rules_never_reduced): Rename to...
1630 (print_rules_useless_in_parser): ... this, and rename output XML
1631 element "rules-never-reduced" to "rules-useless-in-parser".
1632 (print_xml): Update for rename.
1633 * src/print.c (print_results): Say "Rules useless in parser due to
1634 conflicts".
1635 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
1636 (nonterminals_reduce): Say "nonterminal useless in grammar".
1637 (reduce_output): Say "Nonterminals useless in grammar".
1638 Say "Rules useless in grammar".
1639 (reduce_xml): Rename output XML element "useless" to
1640 "useless-in-grammar".
1641 (reduce_print): Don't report the count of grammatically useless rules
1642 as "rules never reduced" just because %yacc is specified.
1643 In the correct report of this count, say nonterminal(s) and rule(s)
1644 "useless in grammar".
1645 * tests/conflicts.at (S/R in initial): Update expected output.
1646 (Defaulted Conflicted Reduction): Likewise.
1647 (Unreachable States After Conflict Resolution): Likewise.
1648 * tests/existing.at (GNU pic Grammar): Likewise.
1649 * tests/reduce.at (Useless Nonterminals): Likewise.
1650 (Useless Rules): Likewise.
1651 (Reduced Automaton): Likewise.
1652 (Underivable Rules): Likewise.
1653 (Empty Language): Likewise.
1654
66f0441d
JD
16552007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
1656
1657 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
1658 here document and before the EOF so that BSD's implementation of Bourne
1659 shell doesn't parse the delimiter as part of the here document.
1660 * doc/.cvsignore: Add cross-options.texi.
1661 * src/getargs.c (usage): Add a blank line after the warning categories.
1662
d0ee4105
PB
16632007-11-08 Paolo Bonzini <bonzini@gnu.org>
1664
1665 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
1666
e8b1fb9b
AD
16672007-11-05 Akim Demaille <akim@epita.fr>
1668
1669 Remove Id: from bison.1.
1670 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
1671 (perl -0777 -pi -e 's/\.PP\nId): New.
1672 (.x.1): Use it to ignore the version control revision.
1673
2f7a96b5
AD
16742007-11-05 Akim Demaille <demaille@gostai.com>
1675
1676 * build-aux/Makefile.am: Ship cross-options.pl.
1677 * doc/Makefile.am: Always refer to cross-options.texi with
1678 $(srcdir).
1679 (MAINTAINERCLEANFILES): Add it.
1680
f4101aa6
AD
16812007-11-04 Akim Demaille <demaille@gostai.com>
1682
1683 Generate the long/short option cross-table.
1684 * build-aux/cross-options.pl: New.
1685 * doc/Makefile.am (cross-options.texi): New.
1686 * doc/bison.texinfo: Use it.
1687
727a1401
AD
16882007-11-04 Akim Demaille <demaille@gostai.com>
1689
1690 Generate bison.1 using help2man.
1691 * doc/common.x, doc/bison.x: New.
1692 * doc/Makefile.am (bison.1, .x.1): New.
1693 The code is taken from autoconf-2.61/man/Makefile.am.
1694 * configure.ac: Look for help2man.
1695
6aeb9c57
AD
16962007-11-04 Akim Demaille <demaille@gostai.com>
1697
1698 Complete --help.
1699 * src/getargs.c (usage): Document -W, make it clear that -d,
1700 -g and -x have optional arguments.
1701
d7be4085
AD
17022007-11-04 Akim Demaille <demaille@gostai.com>
1703
1704 Find sha1sum when named gsha1sum.
1705 * bootstrap (find_tool): New.
1706 ($SHA1SUM): New.
1707
d9df47b6
JD
17082007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1709
1710 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
1711 at
1712 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
1713 * NEWS (2.3a+): Mention.
1714 * data/bison.m4 (b4_pure_if): Don't define it here.
1715 * data/c.m4 (b4_identification): Depend on individual skeletons to
1716 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
1717 values of the %define variables api.pure or api.push_pull. Define
1718 YYPURE, YYPUSH, and YYPULL accordingly.
1719 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
1720 glr.cc has already defined b4_pure_flag.
1721 * data/push.c: Define b4_pure_if based on `%define api.pure'.
1722 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 1723 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
1724 * doc/bison.texinfo (Pure Decl): Update.
1725 (Push Decl): Update.
1726 (Decl Summary): Add api.pure to %define entry.
1727 In %pure-parser entry, say it's deprecated and reference %define.
1728 (Pure Calling): Update.
1729 (Error Reporting): Update.
1730 (C++ Scanner Interface): Update.
1731 (How Can I Reset the Parser): Update.
1732 (Table of Symbols): In %pure-parser entry, say it's deprecated and
1733 reference %define.
1734 * src/getargs.c (pure_parser): Remove global variable.
1735 * src/getargs.h (pure_parser): Remove extern.
1736 * src/output.c (prepare): Don't define pure_flag muscle.
1737 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
1738 wrapper around `%define api.pure'.
1739 * tests/calc.at (Simple LALR Calculator): Update.
1740 (Simple GLR Calculator): Update.
1741 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
1742 Update.
1743 (GLR: Resolve ambiguity, pure, locations): Update.
1744 (GLR: Merge conflicting parses, pure, no locations): Update.
1745 (GLR: Merge conflicting parses, pure, locations): Update.
1746 * tests/glr-regression.at (Uninitialized location when reporting
1747 ambiguity): Update
1748 * tests/input.at (Unused %define api.pure): New test case.
1749 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
1750 AT_PURE_IF and AT_PURE_AND_LOC_IF.
1751 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1752
c373bf8b
JD
17532007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1754
1755 %define push_pull -> %define api.push_pull. Discussed starting at
1756 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
1757 * data/push.c: Expect the new name.
1758 * data/yacc.c: Likewise.
1759 * doc/bison.texinfo (Push Decl): Update.
1760 (Decl Summary): Update %define entry.
1761 (Push Parser Function): Update.
1762 (Pull Parser Function): Update.
1763 (Parser Create Function): Update.
1764 (Parser Delete Function): Update.
1765 * tests/calc.at (Simple LALR Calculator): Update.
1766 * tests/input.at (%define enum variables): Update.
1767 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
1768 (Push Parsing: Multiple impure instances): Update.
1769 (Push Parsing: Unsupported Skeletons): Update.
1770 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
1771 (Exploding the Stack Size with Malloc): Update.
1772
1773 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
1774 other entries some.
1775
32f19b6b
JD
17762007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
1777
1778 For the XML output's terminal element, rename @number to @token-number,
1779 and add @symbol-number. In the nonterminal element, rename @number to
1780 @symbol-number. Discussed starting at
1781 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
1782 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
1783 renames.
1784 (xsl:template match="nonterminal"): Likewise.
1785 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
1786 (xsl:template match="nonterminal"): Likewise.
1787 * src/print-xml.c (print_grammar): Implement.
1788
255a6b90
JD
17892007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1790
1791 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
1792 2007-10-11 change, the child elements here are items not rules.
408476bc 1793 (xsl:template match="item"): New.
255a6b90
JD
1794 (xsl:template match="rule"): Update for new reduced itemset.
1795 (xsl:template match="point"): Remove.
1796 (xsl:template match="empty"): For consistency with --graph, don't
1797 output "/* empty */".
1798 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
1799 line-wrap, don't pass a negative value as first-line-length since this
1800 won't work with the following changes.
1801 (xsl:template name="line-wrap"): Simplify slightly.
1802 (xsl:template name="ws-search"): Eliminate recursion.
1803 * src/print_graph.c (print_core): Don't print a reduction's lookahead
1804 set next to an item whose dot is not at the end of the RHS even if it
1805 happens to be associated with the same rule.
1806
88c78747
JD
18072007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1808
31984206
JD
1809 Add %define lr.keep_unreachable_states.
1810 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
1811 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
1812 * src/main.c (main): Implement it.
1813 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1814 Extend to test it, and fix a typo.
1815
18162007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
1817
1818 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
1819 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
1820 the example .output text.
1821 * tests/regression.at (Extra lookahead sets in report): Improve wording
1822 of comments.
1823
b7a70162
WP
18242007-10-17 Wojciech Polak <polak@gnu.org>
1825
1826 * src/print-xml.c (print_grammar): Renamed
1827 <terminal> and <nonterminal> attributes:
1828 "type" to "number" and "symbol" to "name".
1829 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
1830 Use new attribute names.
1831 (xsl:template match="nonterminal"): Likewise.
1832 * data/xslt/xml2xhtml.xsl: Likewise.
1833
a0de5091
JD
18342007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
1835
1836 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
1837 (Option Cross Key): Likewise.
1838
1839 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
1840 next to an item whose dot is not at the end of the RHS even if it
1841 happens to be associated with the same rule.
1842 * src/print.c (print_core): Likewise.
1843 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
1844 (Resolved SR Conflicts): Update output.
1845 * tests/regression.at (Extra lookahead sets in report): New test case.
1846
4c20d18d
WP
18472007-10-11 Wojciech Polak <polak@gnu.org>
1848
1849 * src/print-xml.c (print_core): Remove item set
1850 redundancy.
1851 * data/xslt/bison.xsl (bison:ruleNumber): New key.
1852 Improve processing time. Suggested by Joel E. Denny.
1853 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
1854 Write xsl:param "required" attribute as comment.
1855 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
1856 (xsl:template match="rule"): Support new reduced itemset.
1857 (xsl:template match="point"): Remove.
1858 * data/xslt/xml2xhtml.xsl: Likewise.
1859
f506ad1c
JD
18602007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1861
1862 * src/getargs.c (version): Update copyright year.
1863
21f1b063
JD
18642007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
1865
1866 Make xml2dot.xsl and --graph produce the same output.
1867 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
1868 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
1869 escaped later.
1870 (xsl:template name="output-node"): Use the new escape template instead
1871 of the string-replace template directly.
1872 (xsl:template name="output-edge"): Likewise.
1873 (xsl:template name="escape"): New, escapes backslashes and newlines in
1874 addition to quotation marks.
1875 * src/graphviz.c (start_graph, output_node, output_edge): Add
1876 whitespace to output for legibility.
1877
1878 Make xml2text.xsl and --report produce the same output, and remove the
1879 XML "conflicts" element since a conflict summary is easily extracted
1880 from the automaton.
1881 * data/xslt/bison.xsl: New.
1882 (xsl:template match="state" mode="bison:count-conflicts): New.
1883 * data/xslt/xml2text.xsl: Import bison.xsl.
1884 (xsl:template match="bison-xml-report"): Instead of styling the
1885 "conflicts" element, style the "automaton" element with mode
1886 "conflicts". Unlike the former, the latter lists S/R and R/R
1887 conflicts for a state on the same line.
1888 (xsl:template match="conflicts"): Remove.
1889 (xsl:template match="conflict"): Remove.
1890 (xsl:template match="terminal"): Line-wrap the list of rules in which
1891 the terminal is used.
1892 (xsl:template match="nonterminal"): Likewise for nonterminals.
1893 (xsl:template match="automaton" mode="conflicts"): New.
1894 (xsl:template match="state" mode="conflicts"): New.
1895 (xsl:template name="line-wrap"): New.
1896 (xsl:template name="ws-search"): New.
1897 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
1898 (xsl:template match="bison-xml-report"): Instead of styling the
1899 "conflicts" element, style the "automaton" element with mode
1900 "conflicts."
1901 (xsl:template match="conflicts"): Remove.
1902 (xsl:template match="conflict"): Remove.
1903 (xsl:template match="automaton" mode="conflicts"): New.
1904 (xsl:template match="state" mode="conflicts): New.
1905 * src/conflicts.c (conflicts_output_xml): Remove.
1906 * src/conflicts.h (conflicts_output_xml): Remove prototype.
1907 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
1908 * src/print.c (print_grammar): Consistently wrap at the 66th column so
1909 the corresponding XSLT is easier. Also, never wrap between a word and
1910 the comma that follows it.
1911
793fbca5
JD
19122007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1913
1914 Improve C++ namespace support. Discussed starting at
1915 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
1916 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
1917 b4_namespace_close): New macros that interpret the %define variable
1918 "namespace" so its value can contain "::" to indicate nested
1919 namespaces.
1920 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
1921 the above macros.
1922 * data/lalr1.cc (b4_namespace): Likewise.
1923 * data/location.cc (b4_namespace): Likewise.
1924 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
1925 inside a new table in the general %define entry. Document `%define
1926 namespace' there as well. Point the %name-prefix entry to it since it
1927 explains it more completely in the case of C++.
1928 (C++ Bison Interface): Mention `%define namespace' instead of
1929 %name-prefix.
1930 (Table of Symbols): Remove the `%define push_pull' entry. The %define
1931 entry suffices.
1932 * tests/c++.at (Relative namespace references): New test case.
1933 (Absolute namespace references): New test case.
1934 (Syntactically invalid namespace references): New test case.
1935 * tests/input.at (C++ namespace reference errors): New test case.
1936
35b8730d
JD
19372007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
1938
1939 Add syncline support and location accessor to internal %define
1940 interfaces.
1941 * data/bison.m4 (b4_percent_define_get_loc): New.
1942 (b4_percent_define_get_syncline): New.
1943 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
1944 (b4_percent_define_default): Record defining location as line 1 rather
1945 than 0 for the sake of synchronizing #line's, and define
1946 b4_percent_define_syncline(VARIABLE).
1947 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
1948 * src/muscle_tab.c (muscle_syncline_grow): New.
1949 (muscle_code_grow): Use muscle_syncline_grow.
1950 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
1951 define b4_percent_define_syncline(VARIABLE).
1952 (muscle_percent_define_get_loc): New.
1953 (muscle_percent_define_get_syncline): New.
1954 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
1955 remove some unused variables.
1956 (muscle_percent_define_default): Record defining location as line 1
1957 rather than 0 for the sake of synchronizing #line's, and define
1958 b4_percent_define_syncline(VARIABLE).
1959 (muscle_percent_define_check_values): Use
1960 muscle_percent_define_get_loc.
1961 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
1962 (muscle_percent_define_get_syncline): Prototype.
1963 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1964 defaults): Update output for location change.
1965 (Complaining during macro argument expansion): Extend to test
1966 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
1967
7dc4a694
JD
19682007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
1969
1970 Fix some error-reporting macro bugs.
1971 * data/bison.m4 (b4_cat): New.
1972 (b4_error, b4_error_at): Use b4_cat to send error directives directly
1973 to stdout so they don't become arguments to other macros. Update
1974 comments and add examples.
1975 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
1976 add examples.
1977 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
1978 after printing the error directive so that M4 doesn't report subsequent
1979 problems that are induced by this problem.
1980 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
1981 instead of just in them. Recognize @\n in both places. Both expand to
1982 the empty string. Needed by b4_cat.
1983 * tests/skeletons.at (Complaining during macro argument expansion):
1984 New test case.
1985 (Fatal errors make M4 exit immediately): New test case.
1986
d4bd2295
JD
19872007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
1988
1989 Implement --print-datadir.
1990 * src/getargs.c (usage): Mention.
1991 (PRINT_DATADIR_OPTION): New anonymous enum member.
1992 (long_options): Add entry for it.
1993 (getargs): Add case for it calling compute_pkgdatadir.
1994 * src/output.c (output_skeleton): Encapsulate data directory
1995 computation from here...
1996 (prepare): ... and from here...
1997 (compute_pkgdatadir): ... into this new function.
1998 * src/output.h (compute_pkgdatadir): Prototype.
1999
34cdeddf
JD
20002007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2001
2002 * src/print-xml.c (escape_bufs): New static global variable
2003 replacing...
2004 (xml_escape_n): ... the static local variable buf here.
2005 (print_xml): Free memory for escape_bufs.
2006 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2007
d782395d
JD
20082007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2009
2010 Replace `%push-parser' and `%push-pull-parser' with
2011 `%define push_pull "push"' and `%define push_pull "both"'.
2012 `%define push_pull "pull"' is the default.
2013 * doc/bison.texinfo (Push Decl, Push Parser Function,
2014 Pull Parser Function, Parser Create Function, Parser Delete Function):
2015 Update declarations.
2016 (Decl Summary, Table of Symbols): Replace %push-parser and
2017 %push-pull-parser entries with a %define push_pull entry.
2018 * data/bison.m4 (b4_percent_define_check_values): New macro.
2019 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2020 definitions...
2021 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2022 definitions...
2023 * data/push.c: ... to here and compute them from the value of the
2024 %define variable push_pull.
2025 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2026 parsing requests here...
2027 * data/yacc.c: ... hack this to switch to push.c any time
2028 b4_use_push_pull_flag or the %define variable push_pull is set. This
2029 will go away when we mv push.c yacc.c.
2030 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2031 push parsing is not supported since unused %define variables are
2032 reported anyway.
2033 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2034 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2035 comments for consistency with b4_percent_define_check_values.
2036 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2037 muscles.
2038 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2039 Remove.
2040 (prologue_declaration): Remove %push-parser and %push-pull-parser
2041 rules.
2042 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2043 * tests/calc.at: Update declarations.
2044 * tests/input.at (%define enum variables): New test case.
2045 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2046 declaration.
2047 (Push Parsing: Multiple impure instances): Update declaration.
2048 (Push Parsing: Unsupported Skeletons): New test case.
2049 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2050 declaration.
2051 (Exploding the Stack Size with Malloc): Update declaration.
2052
3f999f78
WP
20532007-09-24 Wojciech Polak <polak@gnu.org>
2054
2055 Add XSLT transformations.
2056
2057 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2058 * data/xslt/xml2text.xsl: Transform XML into plain text.
2059 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2060 * data/Makefile.am (xsltdir): New variable.
2061 (dist_xslt_DATA): Add xslt/*.xsl files.
2062
a4f75309
PE
20632007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2064
2065 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2066 Problem reported by Wojciech Polak.
2067 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2068 (xml_printf): Undo change I made on 21 September; that is,
2069 indent 2 spaces, not 1.
2070
ad5feac4
JD
20712007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2072
2073 Pacify ./configure --enable-gcc-warnings.
2074 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2075 `char const *' instead of `char *'.
2076 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2077 local variable `sep'.
2078
41d7a5f2
PE
20792007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2080
2081 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2082 elsewhere.
2083 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2084 (xml_printf): Indent just 1 space for level.
2085 (e_char, xlate_char): Remove.
2086 (xml_escape_string): Rewrite to avoid undefined behavior (used
2087 storage that was freed from the stack).
2088 (xml_escape_n): Don't bother checking for subscript error.
2089
3f999f78
WP
20902007-09-21 Wojciech Polak <polak@gnu.org>
2091
2092 Add Bison XML Automaton Report.
41d7a5f2
PE
2093
2094 Add support for an -x option to generate an XML report.
2095 It is not documented yet.
2096 * src/print-xml.c: New file.
2097 * src/print-xml.h: Likewise.
2098 * lib/timevar.def (TV_XML): New var.
2099 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2100 * src/conflicts.c: Include print-xml.h.
2101 (solved_conflicts_xml_obstack): New var.
2102 (log_resolution, conflicts_solve, conflicts_free):
2103 Add support for XML report.
2104 (conflicts_output_val): New function.
2105 * src/conflicts.h (conflicts_output_val): New decl.
2106 * src/files.c (spec_xml_file): New var.
2107 (compute_output_file_names, output_file_names_free): Add XML support.
2108 * src/files.h (spec_xml_file): New decl.
2109 * src/getargs.c (xml_flag): New var.
2110 (usage, short_options, long_options, getargs): Add XML support.
2111 * src/getargs.h (xml_flag): New decl.
2112 * src/gram.c: Include print-xml.h.
2113 (rule_lhs_print_xml, rule_rhs_print_xml):
2114 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2115 New functions.
2116 * src/gram.h: Declare external ones.
2117 * src/main.c: Include print-xml.h.
2118 (main): Add XML support.
2119 * src/reduce.c: Include print-xml.h.
2120 (reduce_xml): New function.
2121 * src/reduce.h: Declare it.
2122 * src/state.c: Include print-xml.h.
2123 (state_new): Add XML support.
2124 (state_rule_lookahead_tokens_print_xml): New function.
2125 * src/state.h: Declare it.
2126 (struct state): New member solved_conflicts_xml.
2127 * src/symtab.c (symbol_class_get_string): New function.
2128 * src/symtab.h: Declare it.
2129
6d8e724d
PE
21302007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2131
2132 * GNUmakefile: Switch to coreutils's version.
2133 * bootstrap: Likewise.
2134 * Makefile.cfg: Adjust to new GNUmakefile.
2135 * README-hacking: Likewise.
2136
2137 Import from gnulib:
2138
2139 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2140 Bruno Haible <bruno@clisp.org>
2141
2142 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2143 and is a script that invokes bison. Tighten the code. Add comments.
2144
922bdd7f
JD
21452007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2146
2147 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2148 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2149 * doc/bison.texinfo (Decl Summary): Fix.
2150 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2151 * tests/input.at (Boolean %define variables): Update output.
2152 * tests/skeletons.at (%define boolean variables: invalid skeleton
2153 defaults): Rename to...
2154 (%define Boolean variables: invalid skeleton defaults): ... this and
2155 update output.
2156
1b17b01d
JD
21572007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2158
2159 In impure push mode, don't allow more than one yypstate to be allocated
2160 since multiple impure parsers would corrupt yynerrs.
2161 * data/push.c (yypstate_allocated): New static global variable
2162 initialized to 0.
2163 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2164 exhaustion if yypstate_allocated is 1, but still return 2.
2165 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2166 already 1. Otherwise, set it to 1.
2167 (yypstate_delete): Set it to 0.
2168 * tests/push.at (Push Parsing: Multiple impure instances): New test
2169 case.
2170
9987d1b3
JD
21712007-08-17 Bob Rossi <bob@brasko.net>
2172
2173 * doc/bison.texinfo (Push Decl): Document the push parser.
2174 (Table of Symbols): Ditto.
2175 (Pure Decl): Ditto.
2176 (Decl Summary): Ditto.
2177 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2178 Parser Create Function, Parser Delete Function):
2179 Add new push parser symbols.
2180 (Table of Symbols): Document push-parser, push-pull-parser,
2181 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2182
f16b0819
PE
21832007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2184
2185 Update to GPLv3.
2186 * doc/gpl-3.0.texi: New file.
2187 * doc/gpl.texi: Remove.
2188 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2189 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2190 * README-hacking, TODO, bootstrap, bootstrap.conf:
2191 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2192 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2193 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2194 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2195 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2196 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2197 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2198 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2199 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2200 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2201 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2202 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2203 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2204 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2205 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2206 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2207 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2208 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2209 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2210 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2211 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2212 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2213 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2214 * src/complain.c, src/complain.h, src/conflicts.c:
2215 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2216 * src/files.h, src/flex-scanner.h, src/getargs.c:
2217 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2218 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2219 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2220 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2221 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2222 * src/print.c, src/print.h, src/print_graph.c:
2223 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2224 * src/reduce.h, src/relation.c, src/relation.h:
2225 * src/revision.h, src/scan-code.h, src/scan-code.l:
2226 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2227 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2228 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2229 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2230 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2231 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2232 * tests/existing.at, tests/glr-regression.at:
2233 * tests/headers.at, tests/input.at, tests/java.at:
2234 * tests/local.at, tests/output.at, tests/push.at:
2235 * tests/reduce.at, tests/regression.at, tests/sets.at:
2236 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2237 * tests/torture.at:
2238 Update to GPLv3.
2239
728c4be2
JD
22402007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2241
2242 Get rid of broken %no-parser, -n, and --no-parser implementation and
2243 documentation.
2244 * TODO: Don't mention them.
2245 * doc/bison.1: Likewise.
2246 * doc/bison.texinfo (Decl Summary): Likewise.
2247 (Bison Options): Likewise.
2248 (Option Cross Key): Likewise.
2249 * src/getargs.c (no_parser_flag): Remove global variable.
2250 (usage): Don't print description of -n and --no-parser.
2251 (long_options): Remove --no-parser entry here.
2252 (getargs): Remove -n case in the switch here.
2253 * src/getargs.h (no_parser_flag): Remove extern.
2254 * tests/regression.at (Web2c Actions): Remove comment that mentions
2255 --no-parser.
2256
5d31a216
JD
22572007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2258
2259 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2260 name user variables starting with `yy'. Just pass NULL instead of a
2261 dummy local &yylval to yypush_parse.
2262 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2263 starting with `yy'.
2264
a2ea208d
JD
22652007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2266
2267 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2268 true since it's then always used regardless of whether yyoverflow is
2269 defined. Reported by Christian Burger at
2270 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2271 * THANKS: Add Christian Burger.
2272
91661ebb
JD
2273 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2274 node names: say "Decl Summary" not "Bison Declaration Summary".
2275
cbd50549
JD
22762007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2277
2278 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2279 determine whether this function has already complained about an invalid
2280 value for a %define boolean variable, don't check whether Bison has
2281 ever examined the value. As written, the check was a tautology.
2282 Instead, record and check for this complaint using a separate muscle.
2283
eb1b0740
JD
22842007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2285
2286 Fix push parsing memory leak reported by Brandon Lucia at
2287 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2288 * THANKS: Add Brandon Lucia.
2289 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2290 but the parse never completed and thus freed it.
2291 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2292 * tests/testsuite.at: Include push.at.
2293 * test/push.at: New.
2294 (Push Parsing: Memory Leak for Early Deletion): New test case.
2295
9d774aff
JD
22962007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
2297
2298 Improve handling of multiple S/R conflicts in the same state and of S/R
2299 conflicts involving multiple reductions.
2300 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
2301 set for a state here or Bison will abort if it is reassigned on a
2302 later conflicted reduction in the same state.
2303 Similarly, don't finalize and assign the solved conflicts report here
2304 or it will be lost if it is reassigned on a later conflicted reduction
2305 in the same state.
2306 (set_conflicts): Instead, assign them both here after all S/R conflicts
2307 in the state have been fully examined.
2308 * src/print.c (shift_set): Rename to...
2309 (no_reduce_set): ... this.
2310 (print_reductions): Update for rename, and add %nonassoc error action
2311 tokens to no_reduce_set so that, when printing the first remaining
2312 reduction on an error action token, the reduction is enclosed in
2313 brackets.
2314 (print_results): Update for rename.
2315 * tests/conflicts.at (Solved conflicts report for multiple reductions
2316 in a state): New test case.
2317 (%nonassoc error actions for multiple reductions in a state): New test
2318 case.
2319
2320 * src/main.c (main): Don't depend on C99 features.
2321
10159d2a
JD
23222007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2323
2324 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
2325 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
2326 uniwidth.
10159d2a 2327
953b3935
JD
23282007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
2329
2330 * bootstrap (slurp): Create target directories that don't exist.
2331 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
2332
6ce2d93a
JD
23332007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2334
2335 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
2336 than item number.
2337 * closure.c (closure): Likewise.
2338 * state.h (reductions): Comment sorting of rules.
2339 (state): Comment sorting of items.
2340
ce3448d5
JD
23412007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
2342
2343 Fix C++ test cases after recent Gnulib changes. Discussed starting at
2344 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
2345 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
2346 definition in order to avoid Gnulib headers since we don't use config.h
2347 here.
2348 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
2349 rather than AT_DATA so that config.h is included.
2350
8a86eef0
JD
23512007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
2352
2353 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
2354 instead of fprintf. Guard these functions with #if YYDEBUG instead of
2355 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
2356 and so that YYFPRINTF is guaranteed to be defined here.
2357
b1a81613
JD
23582007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2359
2360 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
2361 with...
2362 (muscle_percent_define_check_values): ... this more helpful function.
2363 Again, it's not used yet, but it will be.
2364 * src/muscle_tab.h: Likewise.
2365
71b61d4d
JD
2366 Improve some comments in parser table construction.
2367 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
2368 (generate_states): Don't mention ruleset, which is internal to closure.
2369 * src/closure.c (closure): Explain sorting of core and itemset, which
2370 is required for this function to behave correctly.
2371 * src/closure.h (closure): Mention sorting.
2372
2a6b783d
JD
23732007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
2374
2375 * src/lalr.c (state_lookahead_tokens_count): For code readability,
2376 move the check for disabled transitions to an aver since conflict
2377 resolution hasn't happened yet.
2378
2379 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
2380 labels a state as inconsistent just because it has error transitions.
2381 The original form of this check appeared in revision 1.1 of lalr.c,
2382 which was committed on 1991-12-21. Now (at least), changing the
2383 consistency label on such a state appears to have no useful effect in
2384 any of the places it is examined, which I enumerate below. The key
2385 point to understanding each item in this enumeration is that a state
2386 with an error transition is labelled consistent in the first place only
2387 if it has no rules, so the check cannot matter for states that have
2388 rules. (1) Labelling a state as inconsistent will cause set_conflicts
2389 to try to identify its conflicts, and a state must have *rules* to have
2390 conflicts. (2) Labelling a state as inconsistent will affect how
2391 action_row sets the default *rule* for the state. (3) Labelling a
2392 state as inconsistent will cause build_relations to add lookback edges
2393 to *rules* in that state.
2394 * src/state.h (struct state): Word the comment for member consistent
2395 more carefully.
2396
14462c2b
JD
23972007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2398
2399 Don't depend on C99 features.
2400 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
2401 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
2402 * src/reader.c (check_and_convert_grammar): Fix for-loop.
2403 * src/state.c (state_mark_reachable_states): Fix for-loop.
2404 (state_remove_unreachable_states): Fix for-loop.
2405
2406 Don't widen struct state with member reachable just to temporarily
2407 record reachability. Instead, use a local bitset.
2408 * src/state.h (struct state): Remove member.
2409 * src/state.c (state_new): Don't initialize it.
2410 (state_mark_reachable_states): Rename to...
2411 (state_record_reachable_states): ... this, and use bitset.
2412 (state_remove_unreachable_states): Use bitset.
2413
5a43d418
JD
24142007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
2415
2416 * src/Makefile.am (yacc): Quote target action commands properly so
2417 that the yacc script isn't corrupt. Reported by Hans Aberg at
2418 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
2419
0c650a20
JD
2420 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
2421 the case of pure parsers. Reported by Frans Englich at
2422 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
2423 * THANKS: Add Frans Englich.
2424
61fee93e
JD
2425 * NEWS (2.3a+): In the %code entry, reference section `Bison
2426 Declaration Summary' from the manual now since the %code summary has
2427 moved there.
2428 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
2429 in the rules section must be terminated by semicolons.
2430
f124d423
JD
24312007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
2432
2433 Extend the front-end API for %define variables to more completely
2434 mirror the back-end. This will be useful in the future.
2435 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
2436 Update comments to mention the new front-end counterparts of these
2437 macros.
2438 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
2439 for muscle_string_decode and muscle_location_decode.
2440 (muscle_string_decode): New static function.
2441 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
2442 (muscle_percent_define_get, muscle_percent_define_ifdef): New
2443 functions.
2444 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
2445 muscle_percent_define_get to mimic the b4_percent_define_flag_if
2446 implementation more closely.
2447 (muscle_percent_define_invalid_value): New function.
2448 * src/muscle_tab.h (muscle_percent_define_get,
2449 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
2450 Prototype.
2451
75ad86ee
JD
24522007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2453
2454 * NEWS (2.3a+): Mention yesterday's state-removal change.
2455 (2.3a): Remove the %language entry, which was added after 2.3a.
2456 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
2457 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
2458 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
2459 tests/existing.at: Update copyright date.
2460
5967f0cf
JD
24612007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2462
2463 If conflict resolution makes states unreachable, remove those states,
2464 report rules that are then unused, and don't report conflicts in those
2465 states.
2466 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
2467 New global function.
2468 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
2469 function.
2470 * src/main.c (main): After conflict resolution, remove the unreachable
2471 states and update all data structures that reference states by number.
2472 * src/state.c (state_new): Initialize each state's reachable member to
2473 false.
2474 (state_mark_reachable_states): New static function.
2475 (state_remove_unreachable_states): New global function.
2476 * src/state.h (struct state): Add member bool reachable.
2477 (state_remove_unreachable_states): Prototype.
2478 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2479 New test case.
2480 * tests/existing.at (GNU pic Grammar): Update test case output now that
2481 an unused rule is discovered.
2482
b09f4f48
JD
24832007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2484
2485 Minor code cleanup in parser table construction.
2486 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
2487 (new_itemsets, save_reductions): Update for rename to nitemset.
2488 * src/closure.c (nritemset): Rename to...
2489 (nitemset): ... this since the "r" appears to meaningless and isn't
2490 used in the comments.
2491 (closure): Update for rename.
2492 * src/closure.h (nritemset): Update extern to...
2493 (nitemset): ... this.
2494 * src/lalr.c (LA): Fix a typo in comments.
2495 * src/print.c (print_core): Update for rename to nitemset.
2496 * src/print_graph.c (print_graph): Likewise.
2497 * src/state.h: Fix some typos in header comments.
2498
bbb44d83
PE
24992007-04-04 Paul Eggert <eggert@cs.ucla.edu>
2500
9b33de72
PE
2501 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
2502 still sticks to ASCII. Sorry!
2503
bbb44d83
PE
2504 * README-hacking: New file, taken mostly from coreutils, with changes
2505 for Bison. Contains much of the contents of:
2506 * README-cvs: Remove.
2507 * bootstrap: Sync from gnulib.
2508 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
2509 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
2510
29553547
JD
25112007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
2512
2513 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
2514 Setzer.
2515 (Java Differences): Fix some typos.
2516 * THANKS: Add Sebastian Setzer.
2517
01b477c6
PB
25182007-03-07 Paolo Bonzini <bonzini@gnu.org>
2519
730739e4
AD
2520 * data/java.m4 (b4_single_class_if): Remove.
2521 (b4_abstract_if): Look at "%define abstract".
2522 (b4_lexer_if): New.
2523 (b4_union_name): Rename...
2524 (b4_yystype): ... to this. Map to "%define stype".
2525 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
2526 b4_maybe_throws): Fix quoting.
2527 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
2528 * data/lalr1.java (Lexer interface): Always define.
2529 (Lexer interface within parser class): Remove.
2530 (YYLexer class): New, used when "%code lexer" is present.
2531 (constructor): When "%code lexer" is used, pass %lex-param
2532 to the lexer constructor.
2533 (yylex, yyparse): Remove %lex-param from method invocations
2534 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
2535
2536 * doc/bison.texinfo (Java Bison Interface): Mention "%define
2537 abstract". Rename "%define union_name" to "%define stype".
2538 Rename method names according to previous patch.
2539 (Java Scanner Interface): Describe "%code lexer" instead of
2540 "%pure-parser" and "%define single_class".
2541 (Java Differences): Mention "%code lexer".
2542
2543 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
2544 Include scanner here, using macros from tests/local.at.
2545 (AT_DATA_CALC_Y): Remove final argument.
2546 (_AT_CHECK_JAVA_CALC): Likewise.
2547 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
2548 of %locations and %error-verbose.
2549 (main): Test with and without %lex-param.
2550 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
2551 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 2552
122bea3a
JMG
25532007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2554
2555 DJGPP spefic issue. Inhibit the use of disallowed characters for
2556 file name genertion on Win98, WinXP, etc. These are |<>":?*\
2557 and concern testsuite case 46.
2558 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
2559 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
2560 * djgpp/config.bat: Inhibit the use of disallowed characters.
2561
9611cfa2
JD
25622007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2563
2564 Miscellaneous %define and %code cleanup.
2565 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
2566 values are interpreted.
2567 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
2568 documentation a little more.
2569 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
2570 muscle_percent_define_insert, muscle_percent_code_grow): New
2571 functions/macros.
2572 * src/muscle_tab.h (muscle_percent_define_insert,
2573 muscle_percent_code_grow): Prototype.
2574 * src/parse-gram.y (prologue_declaration): Use
2575 muscle_percent_define_insert and muscle_percent_code_grow when parsing
2576 %define and %code directives.
2577
2578 Make it easy to share %define boolean variables between the front-end
2579 and back-end. Though not used yet, this will be useful in the future.
2580 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
2581 Bison uses of names rather than just skeleton uses of names.
2582 (b4_percent_define_get, b4_percent_define_ifdef): Rename
2583 b4_percent_define_skeleton_variables(VARIABLE) to
2584 b4_percent_define_bison_variables(VARIABLE).
2585 (b4_percent_code_get, b4_percent_code_ifdef): Rename
2586 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
2587 b4_percent_code_bison_qualifiers(QUALIFIER).
2588 (b4_check_user_names_wrap): Update for renames.
2589 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
2590 muscle_percent_define_default): New functions mimicking
2591 b4_percent_define_flag_if and b4_percent_define_default.
2592
2593 For %define variables, report locations for invalid values and
bbb44d83 2594 redefinitions.
9611cfa2
JD
2595 * data/bison.m4 (b4_percent_define_flag_if): Read
2596 b4_percent_define_loc(VARIABLE) to report the location of an invalid
2597 value for VARIABLE.
2598 (b4_percent_define_default): Save a special location in
2599 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
2600 must later be reported as invalid.
2601 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
2602 functions.
2603 (muscle_percent_define_insert): Record the location of VARIABLE in
2604 muscle percent_define_loc(VARIABLE), and use it to report the previous
2605 location for a redefinition.
2606 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
2607 (muscle_percent_define_default): Update like b4_percent_define_default.
2608 (muscle_grow_user_name_list): Rename to...
2609 (muscle_user_name_list_grow): ... this for consistency and use
2610 muscle_location_grow.
2611 * src/muscle_tab.h (muscle_location_grow): Prototype.
2612 * tests/input.at (%define errors): Update expected output.
2613 * tests/skeletons.at (%define boolean variables: invalid skeleton
2614 defaults): New test case.
2615
0bf92491
JD
26162007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
2617
2618 * src/print.c (lookahead_set, state_default_rule): Remove.
2619 (print_reductions): Replace state_default_rule invocation with
2620 equivalent use of yydefact, which was computed in token_actions in
2621 tables.c.
2622 (print_results): Don't allocate lookahead_set.
2623
d3b12988
PB
26242007-02-27 Paolo Bonzini <bonzini@gnu.org>
2625
2626 * data/lalr1.java: Prefix all private members with yy.
2627
f57a7536
JD
26282007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
2629
2630 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 2631 Sebastien Fricker at
f57a7536 2632 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 2633 * THANKS: Add Sebastien Fricker.
f57a7536
JD
2634 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
2635 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
2636 accept a variable number of arguments.
2637
6404a5bf
JD
26382007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2639
2640 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
2641
e4e09639
JMG
26422007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2643
2644 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
2645 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
2646 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
2647
d7e0a1a7
PE
26482007-02-11 Paul Eggert <eggert@cs.ucla.edu>
2649
2650 Undo my 2007-02-07 change, switching back to the c-strcase module
2651 introduced in the 2007-02-03 change. Bruno Haible reported that
2652 the 2007-02-07 change would be dangerous in Turkish if we add a
2653 language whose name contains "i", since "i" is not lowercase "I"
2654 in Turkish.
2655 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
2656 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
2657 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
2658 * m4/.cvsignore: Remove strcase.m4.
2659 * src/getargs.c: Revert 2007-02-07 change, as follows.
2660 Include c-strcase.h.
2661 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
2662
deee93a1
JD
26632007-02-11 Bruno Haible <bruno@clisp.org>
2664
2665 Enable the Java related testsuite tests when the only Java compiler
2666 found is a gcj < 4.3. Discussed at
2667 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
2668 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
2669
574add85
JD
26702007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
2671
2672 * data/Makefile.am: Update copyright date.
2673 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
2674 yypstate_new returns NULL.
2675 (yypstate_new): Return NULL if malloc does.
2676 * src/reader.c (packgram): Move translation of rule actions from the
2677 beginning of packgram to...
2678 (check_and_convert_grammar): ... here right before packgram is invoked
2679 so it's easier to write more complete comments, and remove redundant
2680 code.
2681
e785ccf7
JD
26822007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
2683
2684 As in semantic actions, make @$ in %initial-action, %destructor, and
2685 %printer imply %locations.
2686 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
2687 scanning @$.
2688 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
2689 (@$ in %initial-action implies %locations,
2690 @$ in %destructor implies %locations,
2691 @$ in %printer implies %locations): ... these new test cases.
2692
1cfe1ed7
PE
26932007-02-07 Paul Eggert <eggert@cs.ucla.edu>
2694
2695 Undo most of the 2007-02-03 change, switching to the strcase module
2696 now that gnulib strcase has been fixed.
2697 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
2698 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
2699 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
2700 * m4/.cvsignore: Add strcase.m4.
2701 * src/getargs.c: Revert 2007-02-03 change, as follows.
2702 Don't include c-strcase.h.
2703 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
2704 strcasecmp has "unspecified behavior" outside the POSIX locale,
2705 but it works fine in practice if at least one argument is ASCII,
2706 as is the case in Bison.
2707
0049ec86
PB
27082007-02-07 Paolo Bonzini <bonzini@gnu.org>
2709
2710 * tests/java.at: Skip tests if only one of javac/java is present.
2711 Reported by Joel E. Denny.
2712 * tests/atlocal.in: Adjust copyright years.
2713
27142007-02-05 Paolo Bonzini <bonzini@gnu.org>
2715
2716 * data/lalr1.java (Stack): Work around old verifiers that disallow
2717 access to the private fields of an inner class, from the outer class.
2718 We can make Stack's fields public because user code doesn't have access
2719 to the instance of Stack used by parse(). Reported by Paul Eggert.
2720
2c2b7220
PE
27212007-02-03 Paul Eggert <eggert@cs.ucla.edu>
2722
2723 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
2724 the right spot for these files?
2725 * bootstrap.conf (gnulib_modules): Add c-strcase.
2726 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
2727 c-strncasecmp.c.
2728 * src/getargs.c: Include c-strcase.h.
2729 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
2730 to avoid unspecified behavior.
2731
b2b81dae
JD
27322007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
2733
2734 * doc/bison.texinfo (Decl Summary): Correct typo.
2735
c1d19e10
PB
27362007-01-30 Paolo Bonzini <bonzini@gnu.org>
2737
2738 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
2739 Complain if the value does not match empty, "true" or "false".
2740 * data/c++.m4: Adjust default definitions of %define variables.
2741 * data/java.m4: Adjust default definitions of %define variables.
2742 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
2743 to above behavior.
2744 * tests/input.at (Boolean %define variables): Test new behavior.
2745
8405b70c
PB
27462007-01-29 Paolo Bonzini <bonzini@gnu.org>
2747
2748 * NEWS: Mention java.
2749 * TODO: Remove things that are done.
2750 * bootstrap.conf: Add javacomp-script and javaexec-script.
2751 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
2752
2753 * data/Makefile.am: Add new files.
2754 * data/java-skel.m4: New.
2755 * data/java.m4: New.
2756 * data/lalr1.java: New.
2757
2758 * doc/bison.texinfo: Put "A Complete C++ Example" under
2759 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
2760 under Other Languages.
2761
2762 * src/getargs.c (valid_languages): Add Java.
2763 * src/getargs.h (struct bison_language): Update size of string fields.
2764
2765 * tests/Makefile.am: Add java.at.
2766 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
2767 * tests/java.at: New.
2768 * tests/testsuite.at: Include it.
2769
3eb82471
JD
27702007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
2771
2772 Clean up.
2773 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
2774 at_directive_argv arguments so these no longer have to be global
2775 variables. Also, update the implementation for the following changes.
2776 (fail_for_at_directive_too_many_args,
2777 fail_for_at_directive_too_few_args): Add at_directive_name argument.
2778 (at_directive_name): Remove as at_directive_argv[0] will be used for
2779 this now.
2780 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
2781 for the directive name.
2782 (at_directive_argc, at_directive_argv): Make these local within
2783 skel_lex instead of global.
2784 (INITIAL): Update directive start action for above changes.
2785 (SC_AT_DIRECTIVE_ARG): Rename to...
2786 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
2787 (SC_AT_DIRECTIVE_SKIP_WS): Update.
2788 (scan_skel): Move yylex_destroy to...
2789 (skel_scanner_free): ... here.
2790 * tests/skeletons.at (installed skeleton file name): Rename to...
2791 (installed skeleton file names): ... this.
2792
148d66d8
JD
27932007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
2794
2795 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2796 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
2797 Summary" not "Directives".
2798 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
2799 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
2800 since the former is now the more complete one.
2801 (Prologue Alternatives): Likewise and do the same for %defines.
2802 (Table of Symbols): Add summary of %code, add summary of %define, and
2803 move full %code documentation to...
2804 (Decl Summary): ... here for consistency with other entries in these
2805 sections.
2806 Move %define entry in order to keep this list alphabetized.
2807 Reword %define entry a little to put less emphasis on the skeleton
2808 concept, which most users shouldn't have to think about.
2809
665f0c24
PE
28102007-01-26 Paul Eggert <eggert@cs.ucla.edu>
2811
2812 Adjust to recent gnulib changes.
2813 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
2814 Add string.h, string_.h, unistd_.h, wchar_.h.
2815 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
2816 * src/system.h: Don't include <stpcpy.h>; this is now done by
2817 <string.h>.
2818
592d0b1e
PB
28192007-01-23 Paolo Bonzini <bonzini@gnu.org>
2820
2821 Simplify implementation of unqualified %code, implement macros for
2822 uniform treatment of boolean %define flags. Document %define.
2823 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
2824 b4_percent_code_ifdef): New.
2825 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
2826 * data/c++.m4: Define default value for global_tokens_and_yystype.
2827 * data/glr.cc: Likewise.
2828 * data/location.cc: Use b4_percent_define_flag_if.
2829
148d66d8 2830 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
2831
2832 * src/parse-gram.y (Unqualified %code): Change muscle name to
2833 b4_percent_code().
2834 (content.opt): Default to empty.
2835
a7867f53
JD
28362007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2837
2838 Implement support for relative and absolute skeleton file names.
2839 Discussed starting at
2840 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
2841 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
2842 (Bison Options): Document in --skeleton entry.
2843 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
2844 full_skeleton can't necessarily hold all of pkgdatadir.
2845 If the specified skeleton file name contains a `/', don't prepend
2846 pkgdatadir.
2847 * src/parse-gram.y (prologue_declaration): If the specified skeleton
2848 file name contains a `/', prepend the grammar file directory.
2849 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
2850 * skeletons.at: New file.
2851 (relative skeleton file names): New test case.
2852 (installed skeleton file names): New test case.
2853 * tests/testsuite.at: Include skeletons.at.
2854
2855 * bootstrap: Update copyright to 2007.
2856
830c9b18
PB
28572007-01-17 Paolo Bonzini <bonzini@gnu.org>
2858
2859 * bootstrap: Remove occurrences of .#bootmp from the files.
2860
a8c2e813
AD
28612007-01-17 Akim Demaille <akim@epita.fr>
2862
2863 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
2864 nonterminals.
2865 Use per-type %printer.
2866
279cabb6
JD
28672007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
2868
2869 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
2870 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2871 djgpp/config.site, src/files.c, src/files.h, src/main.c,
2872 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
2873 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
2874 tests/glr-regression.at, tests/input.at, tests/local.at,
2875 tests/output.at, tests/torture.at: Update copyright to 2007.
2876
bb32f4f2
AD
28772007-01-16 Akim Demaille <akim@epita.fr>
2878
2879 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
2880 error code.
2881 (Calc++ Scanner): Exit with failure if we can't open the input
2882 file.
2883 Accept "-" standing for stdin.
2884 (Calc++ Top Level): Print the result only if the parsing was
2885 successful.
2886
7cff04b5
AD
28872007-01-16 Akim Demaille <akim@epita.fr>
2888
2889 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
2890
a4e25e1d
JD
28912007-01-15 Paolo Bonzini <bonzini@gnu.org>
2892 and Joel E. Denny <jdenny@ces.clemson.edu>
2893
2894 Clean up %define and %code implementation in M4 some. Most
2895 importantly, rename all related macros to be in the b4_percent_define
2896 and b4_percent_code namespaces. Also, complete support for `.' in
2897 %define variable names and %code qualifiers.
2898 * data/bison.m4 (b4_check_user_names): Check for special
2899 "SKELETON-NAMESPACE(name)" macros instead of using two nested
2900 m4_foreach loops.
2901 (b4_get_percent_define, b4_get_percent_code): Rename to...
2902 (b4_percent_define_get, b4_percent_code_get): ... these.
2903 Extend documentation with examples.
2904 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
2905 b4_percent_define_skeleton_variables and
2906 b4_percent_code_skeleton_qualifiers.
2907 Expect any value for the %define variable `foo' to be stored in the
2908 macro named `b4_percent_define(foo)'; expect any %code blocks for the
2909 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
2910 expect any unqualified %code blocks to be stored in a macro named
2911 `b4_percent_code_unqualified'.
2912 Use m4_indir so that %define variable names and %code qualifiers can
2913 contain `.', which is allowed by the grammar parser.
2914 (b4_percent_define_default): New macro to set a default value for a
2915 %define variable.
2916 (m4_wrap): Update wrapped code, and fix some underquoting.
2917 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
2918 Expect grammar uses of %define variables and %code qualifiers to be
2919 defined in b4_percent_define_user_variables and
2920 b4_percent_code_user_qualifiers.
2921 * data/c++.m4: Use b4_percent_define_default rather than
2922 m4_define_default. Fix some underquoting. Skeleton usage of %define
2923 variable define_location_comparison now implies skeleton usage of
2924 %define variable filename_type.
2925 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
2926 data/push.c, data/yacc.c: Update macro names.
2927 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
2928 muscle names.
2929
e37c665c
JMG
29302007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2931
2932 DJGPP specific issues.
2933
2934 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
2935 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
2936
7d2d521f
JD
29372007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2938
2939 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
2940 run parsers in all tests so that Valgrind is invoked during
2941 maintainer-check-valgrind.
2942 (Duplicate representation of merged trees): Free all semantic values.
2943 (Duplicated user destructor for lookahead): Likewise.
2944
e0ac9b4b
JD
29452007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2946
2947 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
2948 command-line prefix.
2949 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
2950 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
2951 miss Valgrind messages.
2952 (Exploding the Stack Size with Malloc): Likewise.
2953
78143faa
JD
29542007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
2955
2956 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
2957 locals. Reported by Juan Manuel Guerrero at
2958 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
2959 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
2960 Fix some indentation also.
2961 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
2962 explaining this issue.
2963
7ecec4dd
JD
29642007-01-09 Paolo Bonzini <bonzini@gnu.org>
2965 and Joel E. Denny <jdenny@ces.clemson.edu>
2966
2967 Simplify union and prologue handling, and escape union and lex/parse
2968 params with digraphs.
2969 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
2970 values to the empty string since these are no longer guaranteed
2971 initialized by the front-end.
2972 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
2973 braces around b4_user_stype since this is no longer done by the
2974 front-end.
2975 * src/files.c, src/files.h (pre_prologue_obstack,
2976 post_prologue_obstack): Remove.
2977 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
2978 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
2979 with digraphs. This fixes lex params and parse params.
2980 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
2981 * src/output.c (prepare): Remove muscle insertion of the prologues.
2982 (output): Remove freeing of pre_prologue_obstack and
2983 post_prologue_obstack.
2984 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
2985 than prologue_augment for prologue parsing so you don't need prologue
2986 obstacks.
5c80250c
JD
2987 (grammar_declaration): For %union RHS, use `braceless' instead of
2988 "{...}" so that braces are already stripped and code is escaped with
2989 digraphs.
7ecec4dd
JD
2990 * src/reader.c (prologue_augment): Remove.
2991 (reader): Remove initialization of pre_prologue_obstack and
2992 post_prologue_obstack.
2993 * src/reader.h (prologue_augment): Remove.
2994
2995 * data/c.m4: Remove stray parenthesis.
2996
16dc6a9e
JD
29972007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2998
2999 Remove quotes from variables names in %define directives and from
3000 qualifiers in %code directives, and restrict the characters that are
3001 allowed in them to M4-friendly ones. For %define, continue to support
3002 the quoted form as a deprecated feature. Discussed starting at
3003 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3004 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3005 %code.
3006 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
3007 (Decl Summary): In %defines entry, update mention of `%code requires'
3008 and `%code provides'.
16dc6a9e
JD
3009 (C++ Location Values): Update %define uses.
3010 (Calc++ Parser Interface): Likewise.
3011 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 3012 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
3013 * src/parse-gram.y (prologue_declaration): For %define variables, use
3014 `variable' instead of `STRING'.
3015 (grammar_declaration): For %code qualifiers, use `ID' instead of
3016 `STRING'.
3017 (variable): New nonterminal that takes an `ID' or a `STRING'.
3018 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3019 and %define uses.
3020 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3021 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3022 (%define errors): Update %define uses.
3023
e9813cd4
JD
30242007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3025
3026 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3027 instead of muscle_insert for %define values so that M4-special
3028 characters are replaced with digraphs.
3029 * tests/input.at (%define errors): Extend to check weird values.
3030
6afc30cc
JD
30312007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3032
3033 Instead of having skeletons declare all valid %define variables and
3034 %code qualifiers, provide macros that retrieve the associated values
3035 and build these lists automatically. Thus Bison will now warn when a
3036 variable or qualifier is not used by the skeleton in the current
3037 invocation regardless of whether it might sometimes be used by that
3038 skeleton in other invocations. Also, move all %define value macros to
3039 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3040 form, which is replaced by %code.
3041 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3042 (b4_check_user_names): ... this, and change the series of valid name
3043 arguments to a single list argument for names used in the skeleton
3044 similar to the existing list argument for names used in the grammar.
3045 Warn instead of complaining.
3046 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3047 values and %code code, to format %code code properly, and to build
3048 lists of all %define variables and %code qualifiers used in the
3049 skeleton: b4_skeleton_percent_define_variables and
3050 b4_skeleton_percent_code_qualifiers.
3051 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3052 Remove, and...
3053 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3054 the skeleton names lists can finish building first. In place of
3055 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3056 expect the lists b4_user_percent_define_variables and
3057 b4_user_percent_code_qualifiers.
3058 * data/c++.m4: Where setting default values for b4_parser_class_name,
3059 b4_location_type, b4_filename_type, b4_namespace, and
3060 b4_define_location_comparison, update their names to the
3061 b4_percent_define_ namespace.
3062 * data/glr.c: Don't use b4_check_percent_define_variables and
3063 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3064 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3065 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 3066 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
3067 * data/location.cc: Use b4_get_percent_define.
3068 * data/push.c: Don't use b4_check_percent_define_variables and
3069 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3070 * data/yacc.c: Likewise, and don't call m4_exit in
3071 b4_use_push_for_pull_if or m4_wrap code will never execute.
3072 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3073 Rename to...
3074 (muscle_grow_user_name_list): ... this for consistency with the
3075 terminology used in bison.m4.
3076 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3077 %define variable names, and rename muscle used_percent_define_variables
3078 to user_percent_define_variables.
3079 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3080 user_percent_code_qualifiers.
3081 (content): Remove.
3082 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3083 {CODE} form is no longer accepted.
3084 * tests/input.at (Reject bad %code qualifiers): Rename to...
3085 (Reject unused %code qualifiers): ... this, and update test output.
3086 (%define error): Update test output.
3087
7eb8a0bc
JD
30882007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3089
3090 Check for unrecognized %define variables similar to checking for
3091 unrecognized %code qualifiers. Check for redefined %define variables.
3092 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3093 generalizes...
3094 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3095 (b4_check_percent_define_variables): New, also wraps it.
3096 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3097 variables using b4_check_percent_define_variables.
3098 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3099 all those exercised in the test suite and all those listed in the
3100 `Default values' section of c++.m4. Are there others?
3101 * data/push.c, data/yacc.c: Declare no valid %define variables.
3102 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3103 similar to muscle_find, but it works even when the muscle stores a
3104 const value.
3105 (muscle_grow_used_name_list): New function for constructing the used
3106 name list muscles that b4_check_for_unrecognized_names requires.
3107 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3108 %define'd more than once. Define the b4_used_percent_define_variables
3109 muscle with muscle_grow_used_name_list.
3110 (grammar_declaration): Abbreviate %code code with
3111 muscle_grow_used_name_list.
3112 * tests/input.at (%define errors): New.
3113
3fc65ead
JD
31142007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3115
3116 Provide warn_at, complain_at, and fatal_at function callbacks to the
3117 skeletons, and use this for %code qualifier complaints.
3118 * data/bison.m4 (b4_error_at): New, invoked by...
3119 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3120 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3121 @fatal_at(...@) directives.
3122 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3123 qualifiers in b4_used_percent_code_qualifiers and to use
3124 b4_complain_at.
3125 * src/location.c, src/location.h (boundary_set_from_string): New global
3126 function.
3127 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3128 function.
3129 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3130 to b4_used_percent_code_qualifiers.
3131 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3132 function.
3133 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3134 (lineno): Rename to...
3135 (out_lineno): ... this so I don't misunderstand it again.
3136 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3137 here; these newlines are in the input but not the output file.
3138 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3139 (at_directive_perform): ... this new static function, and add handling
3140 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3141 directives.
3142 * tests/input.at (Reject bad %code qualifiers): Update test output with
3143 locations and extend.
3144
3145 * tests/output.at (Output file name: [, Output file name: ]): Remove
3146 bogus comment about these tests failing.
3147
1c7b7e1d
JD
31482007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3149
3150 Clean up b4_check_percent_code_qualifiers a little.
3151 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3152 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3153 documentation and add examples.
3154 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3155 qualifiers here.
3156
08af01c2
JD
31572007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3158
3159 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3160 unreliable -- especially when they're hidden inside another macro.
3161 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3162 data/c.m4: Remove m4_divert(-1).
3163 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3164 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3165 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 3166 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
3167 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3168 pushed and popped by m4sugar, should be first on the stack.
3169
3170 Provide warn, complain, and fatal function callbacks to the skeletons.
3171 This provides more flexibility than m4_fatal, improves the error
3172 message format, and captures messages for translation. Discussed
3173 starting at
3174 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3175 * data/bison.m4 (b4_error): New, invoked by...
3176 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3177 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3178 directives. Because these M4 macros might be called when the current
3179 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3180 the previous removal of uses of m4_divert, which caused trouble.
3181 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3182 m4_fatal to report unrecognized %code qualifiers.
3183 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3184 push parser requests.
3185 * data/glr.c: Use b4_complain instead of m4_fatal to report
3186 non-deterministic push parser requests.
3187 Update @output usage to @output(...@) form.
3188 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3189 report missing %defines. Update @output usage to @output(...@) form.
3190 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3191 @output(...@) form.
3192 * src/main.c (main): Invoke skel_scanner_free.
3193 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3194 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3195 obstack_for_string from flex-scanner.h.
3196 (YY_DECL): Use to declare skel_lex static.
3197 (decode_at_digraphs): Remove; now handled in the new
3198 SC_AT_DIRECTIVE_ARG start condition.
3199 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3200 functions.
3201 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3202 at_directive_argv): New static globals.
3203 (INITIAL): Use fail_for_invalid_at.
3204 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3205 recognize the start of a generalized `@directive(...@)' form and
3206 start...
3207 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3208 directive args (using the new obstack_for_string), to decode the
3209 contained @ diagraphs, and to perform the directive. It recognizes
3210 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3211 @output(...@).
3212 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3213 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3214 `@,'.
3215 (scan_skel): Initialize obstack_for_string on the first call.
3216 (skel_scanner_free): New function to free obstack_for_string.
3217 * tests/input.at (Reject bad %code qualifiers): Update test output.
3218
8e0a5e9e
JD
32192007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3220
3221 Consolidate the 4 prologue alternative directives (%code, %requires,
3222 %provides, and %code-top) into a single %code directive with an
3223 optional qualifier field. Discussed at
3224 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3225 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3226 alternatives.
3227 * doc/bison.texinfo (Prologue Alternatives): Update.
3228 (Decl Summary): Update to %code "requires" and %code "provides".
3229 (Calc++ Parser): Update to %code "requires".
148d66d8 3230 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
3231 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3232 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3233 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3234 which are skeleton-specific.
3235 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3236 declare what %code qualifiers it supports and to complain if any other
3237 qualifiers were used in the grammar.
3238 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3239 and b4_user_code([b4_percent_code_provides]) in place of
3240 b4_user_requires and b4_user_provides.
3241 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3242 Add b4_user_code([b4_percent_code_top]) and
3243 b4_user_code([b4_percent_code]).
3244 Invoke b4_check_percent_code_qualifiers.
3245 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3246 PERCENT_REQUIRES): Remove.
3247 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3248 %requires. Rewrite the %code RHS as the unqualified form defining the
3249 muscle b4_percent_code. Add another RHS for the qualified %code form,
3250 which defines muscles of the form b4_percent_code_QUALIFIER and the
3251 b4_used_percent_code_qualifiers muscle.
3252 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3253 PERCENT_REQUIRES): Remove.
3254 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3255 %code "requires" and %code "provides".
3256 * tests/input.at (Reject bad %code qualifiers): New.
3257
95021767
JD
32582007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3259
3260 Use the new code_props interface for destructors and printers.
3261 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3262 printer_location members, and change the type of the destructor and
3263 printer members to code_props.
3264 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3265 symbol_printer_get, semantic_type_destructor_set,
3266 semantic_type_printer_set, default_tagged_destructor_set,
3267 default_tagless_destructor_set, default_tagged_printer_set,
3268 default_tagless_printer_set): Use code_props in arguments and return
3269 types in place of char const * and location.
3270 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3271 since the locations are now contained in the return of
3272 symbol_destructor_get and symbol_printer_get.
3273 * src/output.c (symbol_destructors_output, symbol_printers_output):
3274 Replace with...
3275 (symbol_code_props_output): ... this to eliminate duplicate code.
3276 (output_skeleton): Update to use symbol_code_props_output.
3277 * src/reader.c (symbol_should_be_used): Update use of
3278 symbol_destructor_get.
3279 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3280 Update uses of the various _destructor_set and _printer_set functions.
3281 * src/symtab.c: (default_tagged_destructor_location,
3282 default_tagless_destructor_location, default_tagged_printer_location,
3283 default_tagless_printer_location): Remove since we...
3284 (default_tagged_destructor, default_tagless_destructor,
3285 default_tagged_printer, default_tagless_printer): ... change the type
3286 of these to code_props.
3287 (symbol_new, semantic_type_new, symbol_destructor_set,
3288 semantic_type_destructor_set, symbol_destructor_get,
3289 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3290 symbol_check_alias_consistency, default_tagged_destructor_set,
3291 default_tagless_destructor_set, default_tagged_printer_set,
3292 default_tagless_printer_set): Update.
3293 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
3294 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
3295 code_props members.
3296 (symbol_print): Use SYMBOL_CODE_PRINT.
3297
f6857bbf
JD
32982007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3299
3300 Use the new code_props interface for rule actions.
3301 * src/symlist.h (symbol_list): Replace action, action_location, and
3302 used members with a code_props action_props member.
3303 * src/reader.c (symbol_should_be_used, grammar_rule_check,
3304 grammar_midrule_action, grammar_current_rule_merge_set,
3305 grammar_current_rule_symbol_append, packgram): Update.
3306 * src/scan-code.h (translate_rule_action): Remove, no longer used.
3307 * src/scan-code.l (handle_action_dollar): Update.
3308 (translate_rule_action): Remove, no longer used.
3309 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
3310
7c0c6181
JD
33112007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3312
3313 Use the new code_props interface in parse-gram.y.
3314 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
3315 Update all uses of translate_* functions to use the new code_props
3316 interface and to use gram_scanner_last_string_free and
3317 code_scanner_last_string_free where possible.
3318 (grammar_declaration): symbol_list_destructor_set and
3319 symbol_list_printer_set now perform the translation, so don't do it
3320 here. Use gram_scanner_last_string_free where possible.
3321 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
3322 translate_code): Remove, no longer used.
3323 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
3324 symbol_list_printer_set): Perform code translation here rather than
3325 depending on the caller to do so.
3326
3327 * src/symlist.h (struct symbol_list): Correct some documentation typos.
3328 * src/scan-gram.h (gram_last_string): Remove declaration.
3329 * src/scan-gram.l (last_string): Declare it static.
3330
28e52c0d
JD
33312007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3332
3333 Encapsulate code properties and related functionality for the various
3334 destructors, printers, and actions into a code_props structure and
3335 interface. This patch merely implements code_props in scan-code.h and
3336 scan-code.l. Future patches will rewrite other modules to use it.
3337 Discussed starting at
3338 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
3339 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
3340 consistently initialize const structs that have an empty location
3341 field.
3342 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
3343 to ensure consistency.
3344 * src/scan-code.h (code_props): New structure.
3345 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
3346 function, macro, and const global variable for initializing a
3347 code_props with no code.
3348 (code_props_plain_init, code_props_symbol_action_init,
3349 code_props_rule_action_init, code_props_translate_code): The rest of
3350 the new code_props functional interface. Among other things, the init
3351 functions set the code_props kind field so that
3352 code_props_translate_code will know whether to behave like
3353 translate_symbol_action, translate_rule_action, or translate_code.
3354 These old translate functions must remain until all other modules are
3355 updated to use the new code_props interface.
3356 (code_scanner_last_string_free): New function similar to
3357 gram_scanner_last_string_free.
3358 (code_scanner_free): Add documentation.
3359 * src/scan-code.l: Implement the new interface.
3360 (code_lex): Make it static, add a code_props* argument, and remove the
3361 rule argument.
3362 (last_string): New static global similar to the one in scan-gram.l.
3363 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
3364 instead of rule.
3365 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
3366 code_props since Bison may one day use this information for destructors
3367 and printers.
3368 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
3369 (handle_action_dollar): Use symbol_list_n_get and set used flag
3370 directly since symbol_list_n_used_set is removed.
3371 (translate_action): Add a code_props* argument and remove the rule,
3372 action, and location arguments. Pass the code_props* on to code_lex.
3373 (translate_rule_action, translate_symbol_action, translate_code):
3374 Rewrite as wrappers around the new code_props interface.
3375 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
3376 it would eventually need to break the encapsulation of code_props.
3377
96034983
JD
33782007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3379
3380 * etc/.cvsignore: New.
3381
945e396c
JD
33822007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
3383
3384 Add maintainer-push-check to run maintainer-check using push parsing in
3385 place of pull parsing where available.
3386 * Makefile.am (maintainer-push-check): New.
3387 * data/bison.m4 (b4_use_push_for_pull_if): New.
3388 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
3389 appropriately based on their existing values.
3390 (yypush_parse): Don't print push-parser-specific diagnostics if push
3391 parsing is being used in place of pull parsing.
3392 * data/yacc.c: If push parsing should replace pull parsing, redirect to
3393 push.c.
3394 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
3395 variable, and insert b4_use_push_for_pull_flag into muscles.
3396 * tests/Makefile.am (maintainer-push-check): New.
3397
7d596384
JD
33982006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3399
3400 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
3401 (whether successful or failed) so that yypush_parse can be invoked
3402 again to start a new parse using the same yypstate.
3403 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
3404 check multiple yypull_parse invocations on the same yypstate. For pull
3405 mode, extend to check multiple yyparse invocations.
3406 (Exploding the Stack Size with Alloca): Extend to try with
3407 %push-pull-parser.
3408 (Exploding the Stack Size with Malloc): Likewise.
3409
3410 * tests/calc.at (Simple LALR Calculator): Don't specify
3411 %skeleton "push.c" since %push-pull-parser implies that now.
3412 * tests/headers.at (export YYLTYPE): Don't check for the push
3413 declarations. Otherwise, this test case can't be used to see if push
3414 mode can truly emulate pull mode.
3415 * tests/input.at (Torturing the Scanner): Likewise.
3416 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
3417 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
3418 AT_YACC_IF, which now includes the case of push mode since %skeleton
3419 need not be used for push mode. This will be more intuitive once
3420 push.c is renamed to yacc.c.
3421
7172e23e
JD
34222006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
3423
3424 For push mode, convert yyparse from a macro to a function, invoke yylex
3425 instead of passing a yylexp argument to yypull_parse, and don't
3426 generate yypull_parse or yyparse unless %push-pull-parser is declared.
3427 Discussed starting at
3428 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
3429 * data/bison.m4 (b4_pull_if): New.
3430 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
3431 * data/push.c: Improve M4 quoting a little.
3432 (b4_generate_macro_args, b4_parenthesize): Remove.
3433 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
3434 any time a pull parser is requested.
3435 Don't #define this as a wrapper around yypull_parse. Instead, when
3436 both push and pull are requested, make it a function that does that
3437 same thing.
3438 (yypull_parse): If there's a b4_prefix, #define this to
3439 b4_prefix[pull_parse] when both push and pull are requested.
3440 Don't define this as a function unless both push and pull are
3441 requested.
3442 Remove the yylexp argument and hard-code yylex invocation instead.
3443 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
3444 %push-parser.
3445 * src/getargs.c (pull_parser): New global initialized to true.
3446 * getargs.h (pull_parser): extern it.
3447 * src/output.c (prepare): Insert pull_flag muscle.
3448 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
3449 (prologue_declaration): Set both push_parser and pull_parser = true for
3450 %push-pull-parser. Set push_parser = true and pull_parser = false for
3451 %push-parser.
3452 * src/scan-gram.l: Don't accept %push_parser as an alternative to
3453 %push-parser since there's no backward-compatibility concern here.
3454 Scan %push-pull-parser.
3455 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
3456 instead of %push-parser.
3457 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
3458 prototype it in the module that calls yyparse.
3459 * tests/input.at (Torturing the Scanner): Likewise.
3460 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
3461
2e7944cb
JD
34622006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
3463
3464 Update etc/bench.pl. Optimize push mode a little (the yyn change
3465 deserves most of the credit).
3466 * Makefile.am (SUBDIRS): Add etc subdirectory.
3467 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
3468 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
3469 yytoken, yyval, and yyloc declarations to...
3470 (yyparse or yypush_parse): ... here to improve performance. For
3471 yypush_parse invocations after the first, be sure to assign yyn its old
3472 value again.
3473 (yypstate_new): Don't bother initializing the yyresult field since the
3474 initial value isn't used.
3475 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
3476 remove the #define that, in push mode, set it to yyps->NAME.
3477 * etc/Makefile.am: New.
3478 * etc/bench.pl: Remove and build it instead from...
3479 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
3480 "tests/bison" from the build directory by default rather than just
3481 invoking "bison" from $PATH.
3482 (calc_grammar): Update push parser code: don't declare yylval globally,
3483 don't define yyparse_wrapper, and don't #define yyparse.
3484 (bench_grammar): Update to check all working combinations of yacc.c,
3485 push.c, impure, pure, pull, and push.
3486
c3d50342
JD
34872006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3488
3489 For push mode, add pull wrappers around yypush_parse.
3490 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
3491 (yypull_parse): New function wrapping yypush_parse.
3492 (yyparse): New #define wrapping yypull_parse.
3493 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
3494 is declared.
3495 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
3496 prototype yylex in the module that calls yyparse, and don't prototype
3497 yyparse there. Otherwise, the yyparse expansion won't compile.
3498 * tests/input.at (Torturing the Scanner): Likewise.
3499
94ebeba5
JD
35002006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
3501
3502 Enable push parsers to operate in impure mode. Thus, %push-parser no
3503 longer implies %pure-parser. The point of this change is to move
3504 towards being able to test the push parser code by running the entire
3505 test suite as if %push-parser had been declared.
3506 * data/push.c (yypush_parse): For impure mode, remove the
3507 yypushed_char, yypushed_val, and yypushed_loc arguments.
3508 Instead, declare these as local variables initialized to the global
3509 yychar, yylval, and yylloc.
3510 For the first yypush_parse invocation only, restore the initial values
3511 of these global variables when it's time to read a token since they
3512 have been overwritten.
3513 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
3514 %push-parser.
3515 * tests/calc.at (Simple LALR(1) Calculator): Always declare
3516 %pure-parser along with %push-parser since this test case was designed
3517 for pure push parsers.
3518 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
3519 (AT_YACC_OR_PUSH_IF): New.
3520 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
3521 add a note that it's still wrong for some cases (as it has been for a
3522 while).
3523 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
3524 %push-parser no longer implies %pure-parser.
3525
a0633178
JD
35262006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3527
3528 Remove some unnecessary differences between the pull parser code and
3529 the push parser code. This patch enables yynerrs in push mode.
3530 * data/push.c: Reformat M4 a little.
3531 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
3532 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
3533 because push mode is on. Instead, if pure mode is on, move yynerrs
3534 to...
3535 (b4_declare_parser_state_variables): ... here.
3536 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
3537 to yyps->NAME so it can be used in yypush_parse.
3538 (yypush_parse): Don't omit uses of yynerrs in push mode.
3539
8646b6a3
JD
35402006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3541
3542 Fix bug such that the first pushed token's value and location are
3543 sometimes overwritten (sometimes by %initial-action) before being used.
3544 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
3545 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
3546 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
3547 more closely mimic the pull parser logic.
3548 Don't copy the pushed token to yychar, yylval, and yylloc until it's
3549 time to read a token, which is after any initialization of yylval and
3550 yylloc.
3551 (gottoken): Rename label to...
3552 (yyread_pushed_token): ... for clarity and to avoid infringing on the
3553 user namespace.
3554
9baf4d74
JD
35552006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
3556
3557 Rearrange initialization of the parser state variables so that the
3558 skeleton doesn't have to have a copy for pull mode and another for push
3559 mode. This patch also fixes at least a bug such that yylloc was not
3560 initialized (with b4_location_initial_line and
3561 b4_location_initial_column) upon calling yypush_parse. However, that
3562 initialization now overwrites the first token's location;
3563 %initial-action assigning @$ already did the same thing, and both bugs
3564 will be fixed in a later patch.
3565 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
3566 (b4_declare_parser_state_variables): Remove initialization of yytoken,
3567 yyss, yyvs, yyls, and yystacksize.
3568 (yypstate_new): Remove initialization of some yypstate fields: yystate,
3569 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
3570 yylsp.
3571 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
3572 yyps->NAME so it can be used in yypush_parse.
3573 (yyparse or yypush_parse): For yypush_parse, don't print the
3574 "Starting parse" diagnostic for invocations after the first.
3575 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
3576 yypush_parse, only do it for the first invocation.
3577 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
3578 initialization to occur in yypush_parse but only on the first
3579 invocation.
3580
23522164
JD
35812006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3582
3583 * data/push.c: Add CPP guards around push parser declarations in both
3584 the header and the code file.
3585 In the code file, move the push parser declarations to the same place
3586 they appear in the header file.
3587 Clean up the M4 some, especially the inconsistent underquoting in
3588 some b4_c_function_def and b4_c_function_decl uses.
3589
bb010fe5
JD
35902006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3591
3592 Encapsulate the push parser state variables into an M4 macro so the
3593 push skeleton doesn't have to list them again for pull mode's yyparse.
3594 For push mode, remove yypush_parse's local equivalents of these
3595 variables to eliminate unnecessary copying between the two sets at
3596 run-time. This patch also fixes at least a bug related to multiple
3597 %initial-action invocations in push mode.
3598 * data/push.c (b4_declare_parser_variables): Rename to...
3599 (b4_declare_scanner_communication_variables): ... this for clarity and
3600 update both uses.
3601 (b4_declare_yyparse_variables): Remove and move its contents to the one
3602 spot where it was invoked.
3603 (b4_declare_parser_state_variables): New macro containing the parser
3604 state variables required by push mode.
3605 (struct yypstate): Replace all fields but yynew with
3606 b4_declare_parser_state_variables.
3607 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
3608 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
3609 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
3610 (yyparse or yypush_parse): For yyparse in pull mode, replace local
3611 parser state variable declarations with
3612 b4_declare_parser_state_variables.
3613 Don't initialize parser state variables when calling yypush_parse since
3614 yypstate_new already does that.
3615 Invoke the user's initial action only upon the first yypush_parse
3616 invocation.
3617 Remove all code that copies between the local parser state variables
3618 and the yypstate.
3619
2d212f8c
JD
36202006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
3621
3622 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
3623 prevent a name collision in a future patch where these names will
3624 sometimes be #define'd.
3625 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
3626 since it no longer has the same name as the existing argument.
3627 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
3628
e6e704dc
JD
36292006-12-19 Paolo Bonzini <bonzini@gnu.org>
3630 and Joel E. Denny <jdenny@ces.clemson.edu>
3631
3632 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3633 that the argument is case-insensitive, and there's no `=' here.
3634 For the %skeleton entry, mention that %language is better.
3635 (Bison Options): Likewise for --language and --skeleton. Move the
3636 --skeleton entry so that the `Tuning the parser' section is sorted
3637 alphabetically on long options.
3638 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
3639 %language directive in detail here; cross-reference the %language
3640 documentation instead.
3641 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
3642 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 3643 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
3644 * examples/extexi (normalize): Instead of replacing every %require
3645 argument with the current Bison version, just substitute for
3646 `@value{VERSION}'. This guarantees that we're testing what actually
3647 appears in the documentation.
3648 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
3649 rather than `@VERSION@'.
3650
0e021770
PE
36512006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3652
fd575f05
PE
3653 * NEWS: Reword the %language news a bit, and put it earlier.
3654
0e021770
PE
3655 * src/getargs.c (skeleton_arg): Last arg is now location const *.
3656 Rewrite to simplify the logic.
3657 (language_argmatch): Likewise.
fd575f05
PE
3658 (program_name): We now own this var.
3659 * src/getargs.h (struct bison_language): Use char[] rather than
3660 const char *.
0e021770
PE
3661
3662 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
3663 Java is supported.
3664 * src/complain.c (program_name): Remove decl; no longer needed.
3665 * src/main.c (program_name): Remove; now belongs to getargs.
3666
36672006-12-18 Paolo Bonzini <bonzini@gnu.org>
3668
3669 * NEWS: Document %language.
3670
3671 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
3672
3673 * data/c-skel.m4, data/c++-skel.m4: New files.
3674 * data/glr.c: Complain on push parsers.
3675
3676 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
3677 over %skeleton.
148d66d8 3678 (Decl Summary): Document %language and %skeleton.
0e021770
PE
3679 (Command line): Document -L.
3680
3681 * examples/extexi: Rewrite %require directive.
3682 * examples/calc++/Makefile.am: Pass VERSION to extexi.
3683
3684 * src/files.c (compute_exts_from_gc): Look in language structure
3685 for .y extension.
3686 (compute_file_name_parts): Check whether .tab should be added.
3687 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
3688 (language, skeleton_arg, language_argmatch): New.
3689 (long_options): Add --language.
3690 (getargs): Use skeleton_arg, add -L/--language.
3691 * src/getargs.h: Include location.h.
3692 (struct bison_language, language, skeleton_arg, language_argmatch): New.
3693 * src/output.c (prepare): Pick default skeleton from struct language.
3694 Don't dispatch C skeletons here.
3695 * src/parse-gram.y (PERCENT_LANGUAGE): New.
3696 (prologue_declaration): Add "%language" rule, use skeleton_arg.
3697 * src/scan-gram.l ("%language"): New rule.
3698
3699 * tests/calc.at: Test %skeleton and %language.
3700 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
3701 (AT_GLR_IF): Look for %skeleton "glr.cc".
3702 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
3703 (AT_YACC_IF): Reject %language.
3704
5691bf57
PE
37052006-12-18 Paul Eggert <eggert@cs.ucla.edu>
3706
db06f0ce
PE
3707 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
3708 since it wasn't used; only the typedef name 'semantic_type' is needed.
3709 Also, omit trailing white space.
3710
5691bf57
PE
3711 * bootstrap: Sync from coreutils.
3712 (gnulib_extra_files): Add build-aux/announce.gen.
3713 (slurp): Adjust .gitignore files like .cvsignore files.
3714 * build-aux/announce-gen: Remove from CVS, since bootstrap
3715 now creates this.
3716
791934e4
JD
37172006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
3718
3719 Make %push-parser imply %pure-parser. This fixes several bugs; see
3720 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
3721 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
3722 pure_parser = true.
3723 * data/push.c: Don't bother testing b4_push_if when deciding whether
3724 to expand b4_declare_parser_variables globally.
3725 (yypush_parse): Likewise in here.
3726
3727 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
3728 (yy_reduce_print): Reformat M4 for readability.
3729
ee5abb37
JD
37302006-12-15 Bob Rossi <bob@brasko.net>
3731 and Joel Denny <jdenny@ces.clemson.edu>
3732
3733 * data/push.c (yypstate): Add typedef, and update all uses of
3734 struct yypstate to just yypstate.
3735 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
3736
16ca01f9
JD
37372006-12-14 Bob Rossi <bob@brasko.net>
3738
3739 * data/push.c (yypush_parse): Declare prototype regardless of
3740 %locations option.
3741
ab8e7e1a
JD
37422006-12-14 Bob Rossi <bob@brasko.net>
3743
3744 * data/push.c (yyparse): Remove the prototype and the #define when in
3745 push-parser mode.
3746
9bf32be3
JD
37472006-12-13 Bob Rossi <bob@brasko.net>
3748
3749 * data/push.c (yypstate_init): Rename to...
3750 (yypstate_new): ... this and use b4_c_function_def.
3751 (yypstate_delete): New.
3752 (yypush_parse): Change parameters yynval and yynlloc to be const.
3753 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
3754 yypstate_delete functions.
3755
f02e2948
JD
37562006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
3757
3758 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
3759 strange test case titles. Reported by Bob Rossi.
3760
38eb7751
PE
37612006-12-13 Paul Eggert <eggert@cs.ucla.edu>
3762
3763 * TODO: Add pointer to Sylvain Schmitz's work on static detection
3764 of potential ambiguities in GLR grammers.
3765
bd9d212b
JD
37662006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
3767
3768 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
3769 `bison ', use m4_index instead of m4_substr since chopping up a string
3770 containing M4-special characters causes problems here.
3771
3772 Fix a couple of bugs related to special characters in user-specified
3773 file names, and make it easier for skeletons to compute output file
3774 names with the same file name prefix as Bison-computed output file
3775 names.
3776 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
3777 b4_parser_file_name and b4_spec_defines_file instead of
3778 @output_parser_name@ and @output_header_name@, which are now redundant.
3779 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
3780 b4_parser_file_name, b4_spec_defines_file, and the new
3781 @basename(FILENAME@) instead of @output_parser_name@ and
3782 @output_header_name@, which inappropriately escaped the file names as
3783 C string literals.
3784 * src/files.c (all_but_ext): Remove static qualifier.
3785 (compute_output_file_names): Move `free (all_but_ext)' to...
3786 (output_file_names_free): ... here since all_but_ext is needed later.
3787 * src/files.h (all_but_ext): Extern.
3788 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
3789 exactly what MUSCLE_INSERT_STRING used to do.
3790 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
3791 characters are escaped properly.
3792 * src/output.c (prepare): Define muscle file_name_all_but_ext as
3793 all_but_ext.
3794 For pkgdatadir muscle, maintain previous functionality by using
3795 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
3796 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
3797 digraphs would never be expanded. Hopefully no one has M4-special
3798 characters in his Bison installation path.
3799 * src/scan-skel.l: Don't parse @output_header_name@ and
3800 @output_parser_name@ anymore since they're now redundant.
3801 In @output, use decode_at_digraphs.
3802 Parse a new @basename command that invokes last_component.
3803 (decode_at_digraphs): New.
3804 (BASE_QPUTS): Remove unused.
3805 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
3806 (Output file name): New tests.
3807
3f7ca628
JD
38082006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
3809
3810 Warn about output files that are generated by the skeletons and that
3811 conflict with other output files.
3812 * data/glr.c: Don't generate the header file here when glr.cc does.
3813 * src/files.c (file_names, file_names_count): New static globals.
3814 (compute_output_file_names): Invoke output_file_name_check for files
3815 not generated by the skeletons and remove existing checks.
3816 (output_file_name_check): New function that warns about conflicting
3817 output file names.
3818 (output_file_names_free): Free file_names.
3819 * src/files.h (output_file_name_check): Declare.
3820 * src/scan-skel.l: Invoke output_file_name_check for files generated by
3821 the skeletons.
3822 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
3823 (Conflicting output files): New tests.
3824
178e123e
PE
38252006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3826
3827 * doc/bison.texinfo: Fix a couple of typos.
3828
38292006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
3830
3831 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
3832 Rename to...
3833 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
3834 update all uses.
3835 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
3836 (yypush_parse): Rename yypvars argument to yyps and remove redundant
3837 local pv.
3838 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
3839 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
3840
ea17f233
JD
38412006-12-07 Bob Rossi <bob@brasko.net>
3842 and Joel Denny <jdenny@ces.clemson.edu>
3843
3844 * data/push.c (yypvarsinit): Change return type from void* to struct
3845 yypvars*. No longer cast to void* on return.
3846 (struct yypvars): Remove yylen since it need not be remembered between
3847 yypushparse invocations.
3848 (yypushparse): Don't copy between yylen and pv->yylen.
3849
55a30bda
JD
38502006-12-05 Bob Rossi <bob@brasko.net>
3851
3852 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
3853 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
3854 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
3855 (struct yypvars): Remove b4_declare_parser_variables.
3856 (yypvarsinit): Remove init code for removed variables.
3857 (global scope): Do not declare b4_declare_parser_variables if
3858 push or pure mode.
3859 (yypushparse): Add b4_declare_parser_variables.
3860 Init new local variables, and remove init code for removed
3861 yypvars variables.
3862 (yyparse): Delete.
3863 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
3864 and yyparse for other modes.
3865 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
3866 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
3867 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
3868 (AT_PURE_LEX_IF): True if pure or push parser.
3869
85894313
JD
38702006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
3871
3872 Document Yacc prologue alternatives and default %destructor's and
3873 %printer's as experimental. Don't mention Java yet. Discussed at
3874 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
3875 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
3876 (2.3a): Annotate this entry to say the old forms of these features were
3877 also experimental.
3878 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 3879 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
3880 of Java (we'll want this back eventually).
3881
02975b9a
JD
38822006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3883
3884 Support a file name argument to %defines. Deprecate `=' in
3885 %file-prefix, %name-prefix, and %output. Discussed at
3886 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
3887 * NEWS (2.3a+): Mention.
148d66d8 3888 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
3889 form of %defines, and remove `=' from entries for %file-prefix,
3890 %name-prefix, and %output.
3891 * src/parse-gram.y (prologue_declaration): Implement.
3892 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
3893 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
3894 all but one occurrence of %name-prefix.
3895 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
3896 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
3897 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
3898 occurrence of each of %file-prefix and %output. Add check for %defines
3899 with argument.
3900 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
3901 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
3902 Remove the `=' from %output.
3903
287b314e
JD
39042006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
3905
3906 Don't escape $ in test case titles since Autoconf 2.61 now does that
3907 correctly.
3908 * tests/actions.at (Default %printer and %destructor are not for error
3909 or $undefined): Here.
3910 (Default %printer and %destructor are not for $accept): Here.
3911 * tests/input.at (Invalid $n and @n): Here.
3912
3ebecc24
JD
39132006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
3914
3915 Rename <!> to <>. Discussed starting at
3916 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
3917 * NEWS (2.3a+): Update.
148d66d8 3918 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
3919 Update.
3920 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
3921 * src/scan-gram.l (INITIAL): Implement.
3922 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
3923 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
3924 comment.
3925 * tests/actions.at (Default tagless %printer and %destructor,
3926 Default tagged and per-type %printer and %destructor,
3927 Default %printer and %destructor are not for error or $undefined,
3928 Default %printer and %destructor are not for $accept,
3929 Default %printer and %destructor for mid-rule values): Update.
3930 * tests/input.at (Default %printer and %destructor redeclared,
3931 Unused values with default %destructor): Update.
3932
26b8a438
JD
39332006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
3934
3935 Don't let %prec take a nonterminal.
3936 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
3937 token.
3938 * tests/input.at (%prec takes a token): New test checking that %prec
3939 won't take a nonterminal.
3940
07c39ae9
JD
39412006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3942
405d53b7
JD
3943 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
3944 it was double-quoted.
07c39ae9
JD
3945 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
3946 grammar is maintained with Bison's highest standards.
3947 * src/getargs.c: Fix some typos in Doxygen comments.
3948
580b8926
JD
39492006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
3950
3951 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
3952 later. Reported by Paul Eggert in
3953 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
3954 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
3955 * src/scan-code.l (translate_action): Don't bother invoking
3956 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
3957 (code_scanner_free): Instead of invoking
3958 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
3959 which frees more.
3960 * src/scan-gram.l (gram_scanner_free): Likewise.
3961 * src/scan-skel.l (scan_skel): Likewise.
3962
4502eadc
JD
39632006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
3964
3965 * src/files.c (tr): Change return type to void.
3966 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
3967 has been called previously for the same key.
3968 (muscle_find): Return storage instead of value so that
3969 --enable-gcc-warnings doesn't produce warnings that the return discards
3970 const. aver that the value and storage are the same since storage
3971 could potentially be NULL when value is not.
3972 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
3973 same as 0.
3974
7746c8f6
PE
39752006-11-08 Paul Eggert <eggert@cs.ucla.edu>
3976
3977 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
3978 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
3979 us a slightly cleaner distribution, and also works.
3980 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
3981 gnulib changes.
3982
eb095650
PE
39832006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
3984 and Paul Eggert <eggert@cs.ucla.edu>
3985
3986 Don't let Bison leak memory except when it complains.
3987 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
3988 (spec_defines_file, dir_prefix): Now char *, not const char *,
3989 since they are freed.
3990 * src/files.c: Likewise.
3991 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
3992 Likewise.
3993 (tr): Now operates in-place. All uses changed.
3994 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
3995 values.
3996 (compute_file_name_parts, compute_output_file_names): Don't store
3997 read-only data in variables that will be freed.
3998 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
3999 src_extension, and header_extension.
4000 (output_file_names_free): New public function to free
4001 spec_verbose_file, spec_graph_file, spec_defines_file,
4002 parser_file_name, and dir_prefix.
4003 * src/getargs.c (getargs): Don't store read-only data in variables that
4004 will be freed.
4005 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4006 (which previously existed but was unused), and quotearg_free.
4007 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4008 * src/muscle_tab.c: Likewise.
4009 (muscle_entry): Make the value char const *,
4010 and add a new storage member that is char * and can be freed.
4011 (muscle_entry_free): New private function.
4012 (muscle_init): Use it instead of free.
4013 (muscle_insert, muscle_grow): Update and use new storage member.
4014 (muscle_code_grow): Free the string passed to muscle_grow
4015 since it's not needed anymore.
4016 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4017 add a new `char *code' member.
4018 ("{...}"): Declare semantic type as code.
4019 * src/scan-code.h (translate_rule_action):
4020 (translate_symbol_action, translate_code, translate_action): Return
4021 `char const *' rather than `char *' since external code should not free
4022 these strings.
4023 * src/scan-code.l: Likewise.
4024 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4025 which is "{...}" in the parser.
4026 * tests/Makefile.am (maintainer-check-valgrind): Set
4027 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4028 Valgrind.
4029 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4030 complain.
4031 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4032 expecting a non-zero exit status sets --leak-check=summary and
4033 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4034 this case, and we don't want to hear about it.
4035
ac564be4
PE
40362006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4037
4038 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4039 instead of from the template, to simplify configuration a bit.
4040 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4041 and m4/wint_t.m4, as they are needed with the latest gnulib.
4042
17bd8a73
JD
40432006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4044
4045 Disable unset/unused mid-rule value warnings by default, and recognize
4046 --warnings=midrule-values to enable them. Discussed starting at
4047 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4048 * NEWS (2.3a+): Mention.
4049 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4050 warnings): Add entry for midrule-values subargument.
4051 * src/reader.c (symbol_should_be_used): Don't return true just because
4052 the value is a set/used mid-rule value unless
4053 --warnings=midrule-values was specified.
4054 * tests/input.at (Unused values, Unused values before symbol
4055 declarations): Run tests with and without --warnings=midrule-values.
4056
4057 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4058 than LIST_FREE directly.
4059
89eb3c76
JD
40602006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4061
4062 Finish implementing --warnings=error, which should not be implied by
4063 --warnings=all (or by its synonyms -W and --warnings without
4064 subarguments).
4065 * src/complain.c (set_warning_issued): New function to report that
4066 warnings are being treated as errors and to record an error if so.
4067 Invoke...
4068 (warn_at, warn): ... here.
4069 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4070 "error - warnings are errors" does not appear above "all - all of the
4071 above".
4072 (getargs): For -W and --warnings without subarguments, don't let
4073 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4074 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4075
ba7560e2
JD
40762006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4077
4078 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4079 empty subargument list. For example: `bison --warnings= parser.y'.
4080
31283fc3
JD
40812006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4082
4083 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4084 the parser header file so that gcc doesn't warn.
4085
12e35840
JD
40862006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4087
4088 Split the default %destructor/%printer into two kinds: <*> and <!>.
4089 Discussed starting at
4090 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4091 * NEWS (2.3a+): Mention.
4092 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4093 previous change today related to mid-rules.
148d66d8 4094 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 4095 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
4096 (TYPE_TAG_ANY): Add as <*>.
4097 (TYPE_TAG_NONE): Add as <!>.
4098 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4099 for <*> and <!>.
4100 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4101 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4102 * src/symlist.c (symbol_list_default_new): Split into tagged and
4103 tagless versions.
4104 (symbol_list_destructor_set, symbol_list_printer_set): Split
4105 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4106 SYMLIST_DEFAULT_TAGLESS.
4107 * src/symlist.h: Update symbol_list_default*_new prototypes.
4108 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4109 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4110 * src/symtab.c (default_destructor, default_destructor_location,
4111 default_printer, default_printer_location): Split each into tagged and
4112 tagless versions.
4113 (symbol_destructor_get, symbol_destructor_location_get,
4114 symbol_printer_get, symbol_printer_location_get): Implement tagged
4115 default and tagless default cases.
4116 (default_destructor_set, default_printer_set): Split each into tagged
4117 and tagless versions.
4118 * src/symtab.h: Update prototypes.
4119 * tests/actions.at (Default %printer and %destructor): Rename to...
4120 (Default tagless %printer and %destructor): ... this, and extend.
4121 (Per-type %printer and %destructor): Rename to...
4122 (Default tagged and per-type %printer and %destructor): ... this, and
4123 extend.
4124 (Default %printer and %destructor for user-defined end token): Extend.
4125 (Default %printer and %destructor are not for error or $undefined):
4126 Update.
4127 (Default %printer and %destructor are not for $accept): Update.
4128 (Default %printer and %destructor for mid-rule values): Extend.
4129 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4130 (Unused values with default %destructor): Extend.
4131
f91b1629
JD
41322006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4133
4134 Don't apply the default %destructor/%printer to an unreferenced midrule
4135 value. Mentioned at
4136 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4137 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4138 like $@n instead of just @n so that the default %destructor/%printer
4139 logic doesn't see them as user-defined symbols.
4140 (symbol_is_dummy): Check for both forms of the name.
4141 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4142 name for which the midrule value is referenced in any action.
4143 * tests/actions.at (Default %printer and %destructor for mid-rule
4144 values): New test.
4145 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4146 for change to dummy symbol names.
4147
519d0004
JD
41482006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4149
4150 Warn about unset midrule $$ if the corresponding $n is used.
4151 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4152 $n usage.
4153 (packgram): Before invoking grammar_rule_check on any rule, make sure
4154 all actions have already been scanned in order to set `used' flags.
4155 Otherwise, checking that a midrule's $$ is set will not always work
4156 properly because the midrule check must forward-reference the midrule's
4157 parent rule.
4158 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4159 warning.
4160
a501eca9
JD
41612006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4162
4163 More improvements to the documentation of the prologue alternatives:
4164 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4165 Bison manual.
4166 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4167 some text to clarify the relative importance of the new directives and
4168 to show how these directives may be viewed as code labels.
4169
2cbe6b7f
JD
41702006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4171
4172 Similar to the recently removed %before-header, add %code-top as the
4173 alternative to the pre-prologue. Mentioned at
4174 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4175 Also, let the prologue alternatives appear in the grammar section.
4176 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4177 (prologue_declaration): Move the existing prologue alternatives to...
4178 (grammar_declaration): ... here and add %code-top.
4179 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4180
4181 Clean up and extend documentation for the prologue alternatives.
4182 * NEWS (2.3a+): Describe prologue alternatives.
4183 * doc/bison.texinfo (Prologue): Move discussion of prologue
4184 alternatives to...
4185 (Prologue Alternatives): ... this new section, and extend it to discuss
4186 all 4 directives in detail.
148d66d8
JD
4187 (Table of Symbols): Clean up discussion of prologue alternatives and
4188 add %code-top.
2cbe6b7f 4189
e557d3ea
JMG
41902006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4191
4192 DJGPP specific issues.
4193
4194 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4195 config.bat accordingly.
4196 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4197 * djgpp/config.site: Likewise.
4198
136a0f76
PB
41992006-10-16 Paolo Bonzini <bonzini@gnu.org>
4200
27bd5d67
PB
4201 Replace %*-header with %provides, %requires, %code. See discussion at
4202 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4203
136a0f76
PB
4204 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4205 (b4_user_start_header): Remove.
4206 * data/glr.c: Use new macros instead of b4_*start_header
4207 and b4_*end_header.
4208 * data/glr.cc: Likewise.
4209 * data/lalr1.cc: Likewise.
4210 * data/push.c: Likewise.
4211 * data/yacc.c: Likewise.
4212
4213 * doc/bison.texinfo: Remove %before-header, rename
4214 %{start,end,after}-header to %requires, %provides, %code.
4215
4216 * src/parse-gram.y: Likewise (also rename token names accordingly).
4217 * src/scan-gram.l: Likewise.
4218 * tests/actions.at: Likewise.
4219
10f429ef
PE
42202006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4221
4222 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4223 Problem reported by Joel E. Denny.
4224
42252006-10-14 Jim Meyering <jim@meyering.net>
4226
4227 (Sync from coreutils.)
4228 Work also when the working directory (with e.g. coreutils sources)
4229 is version controlled with git, rather than CVS.
4230 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4231 rather than CVS.
4232 In messages and comments, say e.g., "checked-out sources",
4233 rather than "CVS sources".
4234 (version_controlled_file): New function. Work for git as well as
4235 for CVS. Don't use grep's -q option.
4236 (slurp): Call it here, in place of CVS-specific code.
4237
c4bd5bf7
JD
42382006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4239
4240 Fix testsuite for ./configure --enable-gcc-warnings:
4241 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4242 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4243 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4244 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4245 * test/regression.at (Diagnostic that expects two alternatives):
4246 Likewise.
4247
46356ea4
PE
42482006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4249
231ed89a
PE
4250 * bootstrap.conf (gnulib_modules): Add config-h.
4251 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4252 worry about HAVE_CONFIG_H.
4253 * lib/abitset.c: Likewise.
4254 * lib/bitset.c: Likewise.
4255 * lib/bitset_stats.c: Likewise.
4256 * lib/bitsetv-print.c: Likewise.
4257 * lib/bitsetv.c: Likewise.
4258 * lib/ebitset.c: Likewise.
4259 * lib/get-errno.c: Likewise.
4260 * lib/lbitset.c: Likewise.
4261 * lib/subpipe.c: Likewise.
4262 * lib/timevar.c: Likewise.
4263 * lib/vbitset.c: Likewise.
4264 * lib/bitset.c: Include "bitset.h" first, to test interface.
4265 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4266 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4267 * lib/bitsetv.c: Include "bitsetv.h" first.
4268 * lib/get-errno.c: Include "get-errno.h" first.
4269 * m4/.cvsignore: Add config-h.m4.
4270 * tests/actions.at (Default %printer and %destructor for ...):
4271 Adjust expected line numbers in output to reflect removal of #if
4272 HAVE_CONFIG_H lines.
4273 * tests/glr-regression.at (Missed %merge type warnings when ...):
4274 Likewise.
4275 * tests/regression.at (Braced code in declaration in rules section):
4276 Likewise.
4277 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4278 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4279 Include <config.h> unconditionally.
4280
46356ea4
PE
4281 * bootstrap: Sync from coreutils, as follows:
4282
4283 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4284
4285 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4286 variable was sometimes used without being initialized. This
4287 messed up the installation of the INSTALL file in some cases.
4288
4289 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4290
4291 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4292 --copy. Inspired by a suggestion from Bruno Haible.
4293
4294 2006-10-03 Jim Meyering <jim@meyering.net>
4295
4296 * bootstrap: Undo last change to this file, since now gnulib-tool
4297 sticks with the automake default in generating dependencies.
4298
dd4bf078
PE
42992006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4300
cf2a5f7c
PE
4301 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
4302 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
4303
4304 * doc/bison.1: Add copyright notice.
4305
4306 * data/glr.c: Don't include <stdarg.h>; not used.
4307
35fe0834
PE
4308 * NEWS: The -g and --graph options now output graphs in Graphviz
4309 DOT format, not VCG format.
4310 * doc/bison.1: Likewise.
4311 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
4312 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
4313 of this change in
4314 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
4315 * TODO: Remove Graphviz entry.
4316 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
4317 remove vcg.c, vcg.h, vcg_defaults.h.
4318 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
4319 * src/graphviz.c, src/graphviz.h: New files.
4320 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
4321 * src/files.h: Make comment more generic.
4322 * src/main.c (main): Likewise.
4323 * src/print_graph.h: Likewise.
4324 * src/getargs.c (usage): Make usage description more generic.
4325 * src/print_graph.c: Include graphviz.h rather than vcg.h.
4326 (static_graph, fgraph): Remove. All uses changed to pass
4327 arguments instead of sharing a static var.
4328 (print_core, print_actions, print_state, print_graph):
4329 Output graphviz format rather than VCG format.
4330 * tests/.cvsignore: Remove *.vcg; add *.dot.
4331 * tests/output.at: Expect *.dot files, not *.vcg files.
4332
dd4bf078
PE
4333 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
4334 accommodates the 2006-10-08 change.
4335
efdd7421
PE
43362006-10-11 Bob Rossi <bob@brasko.net>
4337
4338 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
4339 (b4_yyssa, b4_yyerror_range): New macros.
4340 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
4341 (yypvarsinit): Remove init of removed fields.
4342 (yypushparse): Remove use of removed fields; use new macros instead.
4343
96a1981a
PE
43442006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4345
4346 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
4347 in a push parser. Reindent slightly to match yacc.c better.
4348
43492006-10-11 Bob Rossi <bob@brasko.net>
4350
46356ea4
PE
4351 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
4352 yymsg_alloc fields.
4353 (yypvarsinit, yypushparse): Remove init of removed fields.
4354 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 4355
c1630a8b
PE
43562006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4357
4358 * THANKS: Add Paolo Bonzini and Bob Rossi.
4359
90b9908d
PB
43602006-10-08 Paolo Bonzini <bonzini@gnu.org>
4361
4362 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
4363 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
4364 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
4365 b4_define_user_cde and uses): Remove.
4366 (b4_comment, b4_prefix, b4_sync_start): New.
4367 * data/bison.m4: New file, with most of the content removed from c.m4.
4368 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
4369 * src/output.c (output_skeleton): Pass bison.m4.
4370 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
4371 only if specified.
4372
cf806753
PE
43732006-10-05 Paul Eggert <eggert@cs.ucla.edu>
4374
4375 Fix test failure reported by Tom Lane in
4376 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
4377 and try to make such failures easier to catch in the future.
4378 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
4379 that's now the caller's responsibility.
4380 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
4381 Set yychar = YYEOF if it's negative.
4382 * tests/actions.at (yylex): Abort if asked to read past EOF.
4383 * tests/conflicts.at (yylex): Likewise.
4384 * tests/cxx-type.at (yylex): Likewise.
4385 * tests/glr-regression.at (yylex): Likewise.
4386 * tests/input.at (yylex): Likewise.
4387 * tests/regression.at (yylex): Likewise.
4388 * tests/torture.at (yylex): Likewise.
4389
0e2f006a
PE
43902006-10-01 Paul Eggert <eggert@cs.ucla.edu>
4391
4392 Fix problems with translating English-language diagnostics.
4393 * bootstrap: Fix bug introduced in recent bootstrap changes, with
4394 respect to bison-runtime pot generation. The YY_ stuff
4395 wasn't being captured.
4396 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
4397 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
4398 * runtime-po/POTFILES.in: Add data/push.c.
4399
e3ddc1e3
PE
44002006-09-29 Paul Eggert <eggert@cs.ucla.edu>
4401
4402 Merge bootstrap changes from coreutils.
4403
4404 2006-09-28 Jim Meyering <jim@meyering.net>
4405
4406 Automatically generated dependencies are important even
4407 when all of the sources in a directory come from gnulib.
4408 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
4409 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
4410
4411 2006-09-23 Jim Meyering <jim@meyering.net>
4412
4413 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
4414
4415 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4416
4417 * bootstrap: Add support for --force.
4418 (usage): New function. Describe usage less tersely.
4419 (CVS_only_file): New var.
4420
01e972b3
PE
44212006-09-21 Paul Eggert <eggert@cs.ucla.edu>
4422
4423 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4424 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
4425 Adjust white space and comments to match GNU style better.
4426
c63d3e90
PE
44272006-09-20 Bob Rossi <bob@brasko.net>
4428
4429 * data/push.c (yyresult_get): Remove function.
4430 (YYPUSH_MORE): Add #define.
4431 (yypushparse): Modify return value.
4432
e70f46d1
PE
44332006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4434
4435 * stamp-h.in: Remove; no longer needed.
4436 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
4437 Remove config.h, config.hin, intl (no longer created).
4438 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
4439 stamp-h1.
4440
4441 Sync bootstrap from coreutils, as follows:
4442
4443 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
4444
4445 * bootstrap (symlink_to_gnulib): New function.
4446 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
4447 to copies-of-gnulib.
4448 (cp_mark_as_generated, slurp, gnulib_files):
4449 Avoid making a copy if it's the same as the old version.
4450 (gnulib_files): Add support for this variable (used by Bison).
4451
a92be413
PE
44522006-09-20 Paul Eggert <eggert@cs.ucla.edu>
4453
4454 * src/getargs.c (usage): Rework to use conventions similar to
4455 coreutils, to make translation a bit easier and the code a bit
4456 smaller. Problem reported by Tim Van Holder.
4457
4f82b42a
PE
44582006-09-15 Paul Eggert <eggert@cs.ucla.edu>
4459
3b2942e6
PE
4460 Use some of gnulib's new modules, taken from coreutils.
4461
4462 * bootstrap: Sync from coreutils, except add support for gnulib_files.
4463 * bootstrap.conf: New file.
4464 (gnulib_modules): Add configmake, inttypes, unistd.
4465 (XGETTEXT_OPTIONS): Add complain, complain_at,
4466 fatal, fatal_at, warn, warn_at, unexpected_end.
4467 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
4468 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
4469 (gl_EARLY): Add.
4470 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
4471 (gl_INIT): Add
4472 (GNULIB_AUTOCONF_SNIPPET): Remove.
4473 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
4474 the pickiest.
4475 * lib/.cvsignore: Add inttypes_.h.
4476 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
4477 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
4478 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
4479 no-longer-necessary initializations.
4480 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
4481 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
4482 use the unistd module.
4483 * src/system.h: Likewise.
4484 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
4485 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
4486 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
4487 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
4488 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
4489 * src/system.h: Include inttypes.h unconditionally, now that we
4490 use the inttypes module. Don't bother to include stdint.h, since
4491 inttypes.h now does that for us.
4492 (LOCALEDIR): Remove, now that we use the configmake module.
4493 * src/getargs.c: Include configmake.h.
4494 * src/main.c: Likewise.
4495 * src/output.c: Likewise.
4496 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
4497 not from $abs_top_builddir, since config.h moved.
4498
4499
4f82b42a
PE
4500 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
4501 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
4502
4503 * src/parse-gram.y (symbol_declaration): Don't put statements
4504 before declarations; it's not portable to C89.
4505 * src/scan-code.l (handle_action_at): Likewise.
4506
4507 * src/scan-code.l: Always initialize braces_level; the old code
4508 left it uninitialized and therefore had undefined behavior.
4509
4510 Don't attempt to redefine 'assert', since it runs afoul of
4511 systems where standard headers (mistakenly) include <assert.h>.
4512 Instead, define and use our own alternative, called 'aver'.
4513 * src/reader.c: Don't include assert.h, since we no longer
4514 use assert.
4515 * src/scan-code.l: Likewise.
4516 * src/system.h (assert): Remove, replacing with....
4517 (aver): New function, taking a bool arg. All uses changed.
4518 * src/tables.c (pack_vector): Ensure that aver arg is bool,
4519 not merely an integer.
4520
31c10e38
PE
45212006-09-15 Bob Rossi <bob@brasko.net>
4522
4523 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
4524 * data/c.m4 (YYPUSH): New.
4525 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
4526 * src/getargs.c (push_parser): New var.
4527 * src/getargs.h (push_parser): New declaration.
4528 * src/output.c (prepare): Add macro insertion of `push_flag'.
4529 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
4530 (prologue_declaration): Parse %push-parser.
4531 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
4532 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
4533 list of removed lines from the traces observed.
4534 (AT_CHECK_CALC_LALR): Added push parser tests.
4535
fa7b79c0
PE
45362006-09-13 Paul Eggert <eggert@cs.ucla.edu>
4537
21fe08ca
PE
4538 * NEWS: Version 2.3a.
4539 * configure.ac (AC_INIT): Likewise.
4540
e8ec4d9b
PE
4541 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
4542 "#define YYSTYPE int" that caused "make maintainer-check" to fail
4543 due to header ordering dependencies. I don't know why the #define
4544 was there.
4545
fa7b79c0
PE
4546 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
4547 runtime cost when YYDEBUG is not defined, and so that some tests
4548 that used to fail now work. Problem and initial suggestion by
4549 Paolo Bonzini.
4550 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
4551 * data/glr.cc (b4_parser_class_name):
4552 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
4553 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
4554 (yydebug_) [YYDEBUG]: New member.
4555 (yycdebug_): Now defined only if YYDEBUG.
4556 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
4557 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
4558 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
4559 if YYYDEBUG.
4560 (debug_stream, set_debug_stream, debug_level, set_debug_level):
4561 Define only if YYDEBUG.
4562 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
4563 set_debug_level.
4564 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
4565 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
4566 AT_CHECK_CALC_GLR_CC that are working now.
4567
4ec13d60
PE
45682006-09-12 Paul Eggert <eggert@cs.ucla.edu>
4569
4570 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
4571 We don't need them in glr.cc, and glr.c defines them.
4572 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
4573 assumes that defining it to anything is the same as defining
4574 it to 1. Problem reported by Paolo Bonzini.
4575
8e1687ae
PE
45762006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
4577
4578 * data/c.m4 (b4_null, b4_case): Define.
4579 * src/output.c (prepare_symbols): Use b4_null.
4580 (user_actions_output): Use b4_case.
4581
3dc5e96b
PE
45822006-09-11 Paul Eggert <eggert@cs.ucla.edu>
4583
aef3da86
PE
4584 * data/glr.c (b4_shared_declarations): Put start-header first,
4585 before any #includes that we generate, so that feature-test
4586 macros work. Problem reported by Michael Deutschmann in
4587 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
4588 * data/lalr1.cc: Likewise.
4589 * doc/bison.texinfo (Prologue): Document that feature-test macros
4590 should be defined before any Bison declarations.
4591 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
4592 that depend on location.hh after, not before, Bison decls, since
4593 we now include location.hh after the first user prologue.
4594
3dc5e96b
PE
4595 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
4596 Sander Brandenburg in
4597 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
4598 Also, fix minor white space and comment issues.
aef3da86
PE
4599 (Prologue): Mention that it's better to define feature-test macros
4600 before Bison declarations. Problem reported by Michael Deutschmann.
4601
4602 * README-cvs: Fix typo: "&" should be "&&". Problem reported
4603 by Jim Meyering.
4604 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
4605 This adjusts to recent gnulib changes.
3dc5e96b 4606
b2a0b7ca
JD
46072006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4608
4609 Finish implementation of per-type %destructor/%printer. Discussed
4610 starting at
4611 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
4612 and
4613 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
4614 * NEWS (2.3+): Add a description of this feature to the default
4615 %destructor/%printer description.
4616 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
4617 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4618 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
4619 list node contains a semantic type.
4620 * src/symtab.c, src/symtab.h: Extend with a table that associates
4621 semantic types with their %destructor's and %printer's.
4622 (semantic_type_from_uniqstr, semantic_type_get,
4623 semantic_type_destructor_set, semantic_type_printer_set): New functions
4624 composing the public interface of that table.
4625 (symbol_destructor_get, symbol_destructor_location_get,
4626 symbol_printer_get, symbol_printer_location_get): If there's no
4627 per-symbol %destructor/%printer, look up the per-type before trying
4628 the default.
4629 * tests/actions.at (Per-type %printer and %destructor): New test case.
4630 * tests/input.at (Default %printer and %destructor redeclared):
4631 Extend to check that multiple occurrences of %symbol-default in a
4632 single %destructor/%printer declaration is an error.
4633 (Per-type %printer and %destructor redeclared, Unused values with
4634 per-type %destructor): New test cases.
4635
3be03b13
JD
46362006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
4637
4638 Require default %destructor/%printer to be declared using
4639 %symbol-default instead of an empty symbol list, and start working on
4640 new per-type %destructor/%printer. Discussed at
4641 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
4642 * NEWS (2.3+): Add %symbol-default to example.
4643 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 4644 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
4645 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
4646 (generic_symlist, generic_symlist_item): New nonterminals for creating
4647 a list in which each item is a symbol, semantic type, or
4648 %symbol-default.
4649 (grammar_declaration): Use generic_symlist in %destructor and %printer
4650 declarations instead of symbols.1 or an empty list.
4651 (symbol_declaration, precedence_declaration, symbols.1): Update actions
4652 for changes to symbol_list.
4653 * src/reader.c: Update for changes to symbol_list.
4654 * src/scan-code.l: Likewise.
4655 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
4656 * src/symlist.c, src/symlist.h: Extend such that a list node may
4657 represent a semantic type or a %symbol-default in addition to just an
4658 ordinary symbol. Add switched functions for setting %destructor's and
4659 %printer's.
4660 * tests/actions.at, tests/input.at: Add %symbol-default to all default
4661 %destructor/%printer declarations.
4662
3508ce36
JD
46632006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
4664
4665 Whether the default %destructor/%printer applies to a particular symbol
4666 isn't a question of whether the user *declares* that symbol (in %token,
4667 for example). It's a question of whether the user by any means
4668 *defines* the symbol at all (by simply using a char token, for
4669 example). $end is defined by Bison whereas any other token with token
4670 number 0 is defined by the user. The error token is always defined by
4671 Bison regardless of whether the user declares it with %token, but we
4672 may one day let the user define error as a nonterminal instead.
4673 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
4674 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
4675 the meaning of "user-defined".
4676 * tests/actions.at (Default %printer and %destructor for user-declared
4677 end token): Rename to...
4678 (Default %printer and %destructor for user-defined end token): ...
4679 this.
4680
4681 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
4682 computation of whether to apply the default, don't maintain a list of
4683 every Bison-defined symbol. Instead, just check for a first character
4684 of '$', which a user symbol cannot have, and check for the error token.
4685
9350499c
JD
46862006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
4687
4688 Don't apply the default %destructor or %printer to the error token,
4689 $undefined, or $accept. This change fits the general rule that the
4690 default %destructor and %printer are only for user-declared symbols,
4691 and it solves several difficulties that are described in the new test
4692 cases listed below.
4693 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
4694 * tests/actions.at (Default %printer and %destructor are not for error
4695 or $undefined, Default %printer and %destructor are not for $accept):
4696 New test cases.
4697
4d7370cb
JD
46982006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
4699
4700 Allow %start after the first rule.
4701 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
4702 when parsing the first rule.
4703 (check_and_convert_grammar): Search for it here after all grammar
4704 declarations have been parsed. Skip midrules, which have dummy LHS
4705 nonterminals.
4706 * src/symtab.c (symbol_is_dummy): New function.
4707 * src/symtab.h (symbol_is_dummy): Declare it.
4708 * tests/input.at (%start after first rule): New test.
4709
6d0ef4ec
JD
47102006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4711
4712 Redo some of the previous commit: add back the ability to use
4713 non-aliased/undeclared string literals since it might be useful to
4714 those declaring %token-table.
4715 * src/reader.c (check_and_convert_grammar): Undo changes in previous
4716 commit: don't worry about complaints from symbols_pack.
4717 * src/symtab.c (symbol_new, symbol_class_set,
4718 symbol_check_alias_consistency): Undo changes in previous commit: count
4719 each string literal as a new symbol and token, assign it a symbol
4720 number, and don't complain about non-aliased string literals.
4721 (symbols_pack): Since symbol_make_alias still does not decrement symbol
4722 and token counts but does still set aliased tokens to the same number,
4723 symbol_pack_processor now leaves empty slots in the symbols array.
4724 Remove those slots.
4725 * tests/regression.at (Undeclared string literal): Remove test case
4726 added in previous commit since non-aliased string literals are allowed
4727 again.
4728 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
4729 remove unnecessary string literal declarations.
4730 * tests/sets.at (Firsts): Likewise.
4731
965537bc
JD
47322006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
4733
4734 Don't allow an undeclared string literal, but allow a string literal to
4735 be used before its declaration.
4736 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
4737 symbols_pack complained.
4738 * src/symtab.c (symbol_new): Don't count a string literal as a new
4739 symbol.
4740 (symbol_class_set): Don't count a string literal as a new token, and
4741 don't assign it a symbol number since symbol_make_alias does that.
4742 (symbol_make_alias): It's not necessary to decrement the symbol and
4743 token counts anymore. Don't assume that an alias declaration occurs
4744 before any uses of the identifier or string, and thus don't assert that
4745 one of them has the highest symbol number so far.
4746 (symbol_check_alias_consistency): Complain if there's a string literal
4747 that wasn't declared as an alias.
4748 (symbols_pack): Bail if symbol_check_alias_consistency failed since
4749 symbol_pack asserts that every token has been assigned a symbol number
4750 although undeclared string literals have not.
4751 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 4752 string literal): New test cases.
965537bc
JD
4753 (Characters Escapes, Web2c Actions): Declare string literals as
4754 aliases.
4755 * tests/sets.at (Firsts): Likewise.
4756
47aee066
JD
47572006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
4758
4759 In the grammar scanner, STRING_FINISH unclosed constructs and return
4760 them to the parser in order to improve error messages.
4761 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
4762 SC_BRACED_CODE, SC_PROLOGUE): Implement.
4763 * tests/input.at (Unclosed constructs): New test case.
4764 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
4765 seen.
4766
4767 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
4768 unused global.
4769
1f6b3679
JD
47702006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
4771
4772 Handle string aliases for character tokens correctly.
4773 * src/symtab.c (symbol_user_token_number_set): If the token has an
4774 alias, check and set its alias's user token number instead of its own,
4775 which is set to indicate the alias. Previously, every occurrence of
4776 the character token in the grammar overwrote that alias indicator with
4777 the character code.
4778 * tests/input.at (String aliases for character tokens): New test.
4779
219741d8
JD
47802006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
4781
4782 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
4783
11daa4e7
PE
47842006-08-11 Paul Eggert <eggert@cs.ucla.edu>
4785
4786 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
4787 to prevent failures when building on older platforms.
4788 Check for autopoint failure.
4789 Set XGETTEXT_OPTIONS to values that check for C format strings,
4790 so that translators are warned about them (this also helps
4791 prevent core dumps).
4792
4793 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
4794 function, since it simplifies our code a bit.
4795
4796 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
4797 rather than -W, so we don't get bogus warnings about sign comparisons.
4798 Add -Wpointer-arith, since that warning is useful (it reports code
4799 that does not conform to C89 and that some compilers reject).
4800 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
4801 since it's no longer needed.
4802
f9bfc42a
JD
48032006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
4804
4805 Clean up scanners a bit.
4806 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
4807 definitions so gcc won't warn when obstack_for_string is unused.
4808 * src/scan-code.l: config.h and system.h are already #include'd by
4809 scan-code-c.c, so get rid of them here.
4810 * src/scan-gram.l: Likewise.
4811 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
4812 definitions rather than duplicating the rest of it.
4813 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
4814
06e8700a
JD
48152006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
4816
4817 Suppress signed/unsigned comparison warnings for yycheck.
4818 * data/c.m4 (b4_safest_int_type): New macro.
4819 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
4820 a signed int type, cast it to b4_safest_int_type first.
4821 * data/yacc.c: Likewise.
4822 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
4823 also overwritten.
4824
9c437126
PE
48252006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
4826
4827 * doc/bison.texinfo: Fix some typos.
4828
284d8a13
PE
48292006-08-02 Paul Eggert <eggert@cs.ucla.edu>
4830
4831 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
4832 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
4833
4834 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
4835 the latest gnulib does this a different way.
4836 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
4837 translation was patched, so stop omitting it.
4838
ec5479ce
JD
48392006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4840
4841 Enable declaration of default %printer/%destructor. Make the parser
4842 use these for all user-declared grammar symbols for which the user does
4843 not declare a specific %printer/%destructor. Thus, the parser uses it
4844 for token 0 if the user declares it but not if Bison generates it as
4845 $end. Discussed starting at
4846 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
4847 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
4848 and
4849 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
4850 * NEWS (2.3+): Mention.
4851 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
4852 declare a %destructor for a mid-rule's semantic value. It's just
4853 impossible to declare one specific to it.
4854 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
4855 code. Describe default %destructor form.
4856 * src/parse-gram.y (grammar_declaration): Parse default
4857 %printer/%destructor declarations.
4858 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
4859 and symbol_destructor_location_get rather than accessing the destructor
4860 and destructor_location members of struct symbol.
4861 (symbol_printers_output): Likewise but for %printer's.
4862 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
4863 again.
4864 * src/symtab.c (default_destructor, default_destructor_location,
4865 default_printer, default_printer_location): New static global
4866 variables to record the default %destructor and %printer.
4867 (symbol_destructor_get, symbol_destructor_location_get,
4868 symbol_printer_get, symbol_printer_location_get): New functions to
4869 compute the appropriate %destructor and %printer for a symbol.
4870 (default_destructor_set, default_printer_set): New functions to set the
4871 default %destructor and %printer.
4872 * src/symtab.h: Prototype all those new functions.
4873 * tests/actions.at (Default %printer and %destructor): New test to
4874 check that the right %printer and %destructor are called, that they're
4875 not called for $end, and that $$ and @$ work correctly.
4876 (Default %printer and %destructor for user-declared end token): New
4877 test to check that the default %printer and %destructor are called for
4878 a user-declared end token.
4879 * tests/input.at (Default %printer and %destructor redeclared, Unused
4880 values with default %destructor): New tests to check related grammar
4881 warnings and errors.
4882
868d2d96
JD
48832006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
4884
4885 Clean up handling of %destructor for the end token (token 0).
4886 Discussed starting at
4887 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
4888 and
4889 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
4890
4891 Make the skeletons consistent in how they pop the end token and invoke
4892 its %destructor.
4893 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
4894 state, which has token number 0, since this would invoke the
4895 %destructor for the end token.
4896 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
4897 until after shifting the end token, or else it won't be popped.
4898 * data/yacc.c (yyparse): Likewise.
4899
4900 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
4901 it's the end token. Upon termination, destroy an unshifted lookahead
4902 even when it's the end token.
4903 * data/lalr1.cc (yy::parser::parse): Likewise.
4904 * data/yacc.c (yyparse): Likewise.
4905
4906 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
4907 value warnings for the end token when the user gives the end token a
4908 %destructor.
4909
4910 * tests/actions.at (Printers and Destructors): Test all the above.
4911
62a9592d
PE
49122006-07-24 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 Update to latest gnulib and gettext versions.
4915 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
4916 Add fopen-safer.
4917 (gnulib_files): Add m4/warning.m4. Don't worry about files
4918 overwritten by autopoint.
4919 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
4920 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
4921 rejects them.
4922 Don't use autoreconf; instead, invoke autopoint etc. by hand,
4923 so that we can remove the intl files at a better time.
4924 (intl_files_to_remove): Remove aclocal.m4, since it gets
4925 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
4926 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
4927 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
4928 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
4929 Remove datarootdir hack; no longer needed.
4930 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
4931 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
4932 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
4933 strdup.h.
4934 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
4935 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
4936
10d6970f
PE
49372006-07-20 Paul Eggert <eggert@cs.ucla.edu>
4938
4939 * bootstrap: Adjust to today's change to gnulib-tool by invoking
4940 it with --assume-autoconf='latest-stable'.
4941
50a33993
JD
49422006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
4943
4944 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
4945 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
4946 YYSTYPE' and `{'.
4947 * src/muscle_tab.h (muscle_grow): Replace the header comments with
4948 those from muscle_tab.c since the old ones are misleading.
4949
2ce4ed68
AD
49502006-07-13 Akim Demaille <akim@epita.fr>
4951
4952 Support %define "KEY" {VALUE}.
4953 * src/scan-code.h, src/scan-code.l (translate_action)
4954 (translate_rule_action, translate_symbol_action, translate_code):
4955 Return char *, not const char *.
4956 * src/parse-gram.y (declaration): Rename as...
4957 (prologue_declaration): this.
4958 (string_content): Remove this nonterminal, use STRING.
4959 (braceless, content, content.opt): New nonterminal.
4960 Use them.
4961 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
4962 as value.
4963 * src/scan-gram.l (getargs.h): Don't include it.
4964
db7e5eb5
PE
49652006-07-12 Paul Eggert <eggert@cs.ucla.edu>
4966
4967 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
4968 rather than a for-loop that declares a local bool variable. This
4969 should work around a compatibility problem with a Cray x1e C++
4970 compiler reported by Hung Nguyen in
4971 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
4972 The for-loop was introduced in the 2004-11-17 change but I don't
4973 know why it was needed.
4974
a5d80ba5
AD
49752006-07-12 Akim Demaille <akim@epita.fr>
4976
4977 * data/c.m4: Comment changes.
4978
23eb2a69
AD
49792006-07-10 Akim Demaille <akim@lrde.epita.fr>
4980
4981 * src/complain.c (error_message, ERROR_MESSAGE): New.
4982 To factor...
4983 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
4984 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
4985
ddc8ede1
PE
49862006-07-09 Paul Eggert <eggert@cs.ucla.edu>
4987
4988 * NEWS: Instead of %union, you can define and use your own union type
4989 YYSTYPE if your grammar contains at least one <type> tag.
4990 Your YYSTYPE need not be a macro; it can be a typedef.
4991 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
4992 (Union Decl, Decl Summary): Document this.
4993 * data/glr.c (YYSTYPE): Implement this.
4994 * data/glr.cc (YYSTYPE): Likewise.
4995 * data/lalr1.cc (YYSTYPE): Likewise.
4996 * data/yacc.c (YYSTYPE): Likewise.
4997 * src/output.c (prepare): Output tag_seen_flag.
4998 * src/parse-gram.y (declaration, grammar_declaration):
4999 Use 'union_seen' rather than 'typed' to determine whether
5000 %union has been seen, since grammars can now be typed without
5001 %union.
5002 (symbol_declaration, type.opt, symbol_def):
5003 Keep track of whether a tag has been seen.
5004 * src/reader.c (union_seen, tag_seen): New vars.
5005 (typed): remove.
5006 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5007 * src/scan-code.l (untyped_var_seen): New variable.
5008 (handle_action_dollar): Adjust to above changes.
5009 (handle_action_dollar, handle_action_at):
5010 Improve overflow checking for outlandish numbers.
5011 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5012 avoid new diagnostics generated by above changes.
5013 * tests/regression.at (YYSTYPE typedef): Add test to check
5014 for type tags without %union.
5015
5016 * src/symlist.c (symbol_list_length): Return int, not unsigned
5017 int, since callers expect int. This may need to get revisited
5018 once we have proper integer overflow checking.
5019
5020 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5021 object is now static.
5022
5023 * src/getargs.c (flags_argmatch): Return void, not int,
5024 to pacify ./configure --enable-gcc-warnings.
5025
5026 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5027 since last_string is already defined to FLEX_PREFIX (last_string).
5028
7b42569e
AD
50292006-07-09 Akim Demaille <akim@lrde.epita.fr>
5030
5031 Implement --warnings/-W.
5032 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5033 replaced by...
5034 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5035 Adjust callers.
5036 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5037 (warnings_args, warnings_types): New.
5038 (getargs, short_options, long_options): Accept -W/--warnings.
5039 Sort the options by alphabetical order, upper case letter right
5040 before its lower case.
5041
3b452f4e
JD
50422006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5043
5044 Change %merge result type clash warnings to errors. Discussed at
5045 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5046 * src/reader.c (record_merge_function_type): Use complain_at.
5047 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5048 declared later): Update test case results.
5049
b8a41559
AD
50502006-07-09 Akim Demaille <akim@lrde.epita.fr>
5051
5052 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5053 to be in alphabetical order.
5054 (trace_args): Spelling fixes.
5055
cd9e1ba2
PE
50562006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5057
5058 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5059 so they don't collide with user-defined macros.
5060 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5061 this was never guaranteed, and now that we're using gnulib stdint,
5062 which defines int_fast16_t to long int, the problem is exposed.
5063
cb48f191
PE
50642006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5065
b8445a15
PE
5066 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5067 need the full POSIX semantics (and weren't implementing them
5068 anyway).
5069
cb48f191
PE
5070 Adjust to Autoconf 2.60 and today's gnulib.
5071 * bootstrap (gnulib_modules): Add stdint.
5072 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5073 no longer copies it.
5074 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5075 since stdint needs the former and wcwidth (which is now required
5076 by mbswidth) needs the latter.
5077 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5078 work around a compatibility glitch between gettext 0.14.6 and
5079 Autoconf 2.60.
5080 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5081 Do not check for uintptr_t, since new stdint module does the right
5082 thing.
5083 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5084 Add stdint.h, stdint_.h, wcwidth.h.
5085 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5086 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5087 stdint.m4, wchar_t.m4, wcwidth.m4.
5088 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5089 usual order for ../lib/*.h files.
5090 (file_name_split): Use last_component, not base_name, to adjust
5091 to gnulib changes.
5092 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5093 for ../lib/*.h files.
5094 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5095 Define unconditionally, since we now assume the stdint module.
5096 * src/scan-skel.l: Include <dirname.h>.
5097 (BASE_QPUTS): Use last_component, not base_name.
5098 * src/system.h: Include <unlocked-io.h> in the usual order
5099 for ../lib/*.h files. Include <stdint.h> unconditionally,
5100 since we now use the stdint module.
5101 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5102 HAVE_UINTPTR_T, since we now use the stdint module.
5103 (base_name): Remove decl, since files now include <dirname.h>
5104 to get the decl.
5105
cd48d21d
AD
51062006-07-08 Akim Demaille <akim@lrde.epita.fr>
5107
5108 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5109 New, default to 1.
5110 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5111 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5112 default.
5113 * tests/calc.at: Adjust.
5114
8ec0a172
AD
51152006-07-08 Akim Demaille <akim@lrde.epita.fr>
5116
b8445a15 5117 * data/c.m4 (b4_basename): New.
8ec0a172
AD
5118 (b4_syncline): Also output the location of its invocation (from
5119 the skeleton).
5120 (b4_user_action, b4_define_user_action, b4_user_actions)
5121 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5122 (b4_user_stype): New.
5123 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5124
4a678af8
JD
51252006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5126
5127 In the grammar file, the first column is 1 not 0 on the first line as
5128 on every other line.
5129 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5130 * tests/input.at (Torturing the Scanner): Update output.
5131
5132 * src/scan-gram.l (scanner_cursor): Declare it static.
5133
dd60572a
JD
51342006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5135
5136 In warnings, say "previous declaration" rather than "first
5137 declaration".
5138 * src/symtab.c (redeclaration): Do that here.
5139 * src/reader.c (record_merge_function_type): In the case of a result
5140 type clash, report the previous declaration rather than the very first
5141 one in the grammar file.
5142 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5143 declared later): Add a third declaration to check this behavior.
5144 * tests/input.at (Incompatible Aliases): Update output.
5145
2073e1b6
AD
51462006-06-27 Akim Demaille <akim@epita.fr>
5147
5148 * doc/Doxyfile.in: New.
5149 * doc/Makefile.am: Use it.
5150 * src/lalr.h, src/symtab.h: Initial doxygenation.
5151
8ee5b538
JD
51522006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5153
5154 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
5155 declared after the %merge. This continues the effort of the previous
5156 patch.
8ee5b538
JD
5157 * src/reader.c (get_merge_function): Don't set the merger type yet.
5158 (record_merge_function_type): New function for setting the merger type
5159 and checking for clashes.
5160 (grammar_current_rule_merge_set): Set the location of the %merge for
5161 the current rule.
5162 (packgram): Invoke record_merge_function_type for each rule now that
5163 all symbol type declarations have been parsed.
5164 * src/reader.h (merger_list.type_declaration_location): New member
5165 storing the location of the first %merge from which the type for this
5166 merging function was derived.
5167 * src/symlist.h (symbol_list.merger_declaration_location): New member
5168 storing the location of a rule's %merge, if any.
5169 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5170 declared later): New test to catch the error fixed by the above patch.
5171
ffa4ba3a
JD
51722006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5173
5174 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
5175 declarations appear after the rules. Discussed at
5176 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5177 and
5178 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5179 Don't mistake the type of $$ in a midrule to be that of its parent
5180 rule's $$.
ffa4ba3a
JD
5181 * src/reader.c (grammar_current_rule_end): Don't invoke
5182 grammar_rule_check yet since not all symbol declarations may have been
5183 parsed yet.
5184 (grammar_midrule_action): Likewise.
5185 Don't record whether the midrule's $$ has been used yet since actions
5186 haven't been translated yet.
5187 Record the midrule's parent rule and its RHS index within the parent
5188 rule.
5189 (grammar_current_rule_action_append): Don't translate the action yet
5190 since not all symbol declarations may have been parsed yet and, thus,
5191 warnings about types for $$, $n, @$, and @n can't be reported yet.
5192 (packgram): Translate the action and invoke grammar_rule_check now that
5193 all symbol declarations have been parsed.
5194 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5195 after parsing the entire grammar file, the symbol list here in the case
5196 of a midrule is actually the midrule's empty RHS, so reference its
5197 parent rule's RHS where necessary.
5198 On the other hand, now that you can already know it's a midrule, you
5199 aren't forced to think $$ has the same type as its parent rule's $$.
5200 (handle_action_at): In the case of a midrule, reference the parent rule
5201 where necessary.
5202 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5203 members.
5204 (symbol_list_length): Now that this is invoked after all rules have
5205 been parsed, a NULL symbol (rather than a NULL symbol list node)
5206 terminates a rule. symbol_list_print already does this correctly.
5207 * src/symlist.h (symbol_list.midrule_parent_rule,
5208 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5209 remember their relationships with their parents.
5210 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5211 fixed by the above patch.
5212 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5213 implementing...
5214 (Unused values): ... this old test case and...
5215 (Unused values before symbol declarations): ... this new test case.
5216 This one is the same as `Unused values' except that all symbol
5217 declarations appear after the rules in order to catch the rest of the
5218 errors fixed by the above patch.
5219
e256e17f
JD
52202006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5221
300a1930
JD
5222 More cleanup.
5223 * src/reader.c (current_rule): Declare it static since it's no longer
5224 used outside this file.
5225 (grammar_current_rule_action_append): Remove redundant arguments from
5226 translate_rule_action invocation.
5227 * src/reader.h (current_rule): Remove this unused extern.
5228 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5229 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 5230
381ecb06
JD
52312006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5232
5233 Clean up yesterday's patch.
5234 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5235 to...
5236 * src/reader.c (grammar_current_rule_action_append): ... here for
5237 consistency with grammar_current_rule_symbol_append.
5238 * tests/regression.at (Braced code in declaration in rules section):
5239 Make yyerror and yylex static as usual.
5240
4210cd0b
JD
52412006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5242
5243 Fix bug that mistakes braced code in a declaration in the rules section
5244 to be a rule action. Mentioned at
5245 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5246 * src/scan-gram.l: Move midrule action detection from the start of the
5247 scanning of any braced code to...
5248 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5249 action. For readability, use $2 and @2 rather than the equivalent
5250 global variables.
5251 * tests/regression.at (Braced code in declaration in rules section):
5252 New test to catch the error fixed by the above patch.
5253
5254 Work on code readability some.
5255 * src/scan-code.l (current_rule): Get rid of this misleading and
5256 redundant declaration: it's actually extern'ed in reader.h.
5257 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5258 translate_action): Add a rule argument and use it instead of the global
5259 current_rule.
5260 (translate_rule_action): This already receives current_rule through an
5261 argument, so pass it on to translate_action instead of assigning
5262 current_rule to current_rule.
5263 (translate_symbol_action, translate_code): Pass rule = NULL to
5264 translate_action.
5265
34f98f46
JD
52662006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5267
5268 Rename %before-definitions to %start-header and %after-definitions to
5269 %end-header. Don't use these declarations to separate pre-prologue
5270 blocks from post-prologue blocks. Add new order-independent
5271 declarations %before-header and %after-header as alternatives to the
5272 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5273 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5274 * NEWS (2.3+): Update for these changes.
5275 * data/glr.c (b4_before_definitions): Update to...
5276 (b4_start_header): ... this.
5277 (b4_after_definitions): Update to...
5278 (b4_end_header): ... this.
5279 * data/glr.cc: Likewise.
5280 * data/lalr1.cc: Likewise.
5281 * data/yacc.c: Likewise.
5282 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5283 prologue blocks with %*-header declarations.
5284 (Calc++ Parser): Likewise.
91661ebb 5285 (Decl Summary): Update names.
148d66d8 5286 (Table of Symbols): Update description.
34f98f46
JD
5287 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5288 (PERCENT_END_HEADER): ... this.
5289 (PERCENT_BEFORE_DEFINITIONS): Update to...
5290 (PERCENT_START_HEADER): ... this.
5291 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5292 (declaration): Update token names and m4 macro names.
5293 When parsing %end-header and %start-header, invoke translate_code
5294 before muscle_code_grow, and no longer set global booleans to remember
5295 whether these declarations have been seen.
5296 Parse new %after-header and %before-header.
5297 * src/reader.c (before_definitions, after_definitions): Remove.
5298 (prologue_augment): Accept a new bool argument to specify whether to
5299 augment the pre-prologue or post-prologue.
5300 * src/reader.h (before_definitions, after_definitions): Remove these
5301 extern's.
5302 (prologue_augment): Add new bool argument.
5303 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
5304 (PERCENT_END_HEADER): ... this.
5305 (PERCENT_BEFORE_DEFINITIONS): Update to...
5306 (PERCENT_START_HEADER): ... this.
5307 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5308 * tests/actions.at (Printers and Destructors): Update names.
5309
31b2b07e
JD
53102006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
5311
5312 Add comparison operators for C++ location classes. Discussed at
5313 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
5314 * data/c++.m4 (b4_define_location_comparison): New boolean %define
5315 declaration indicating whether filename_type has an operator==. If
5316 filename_type is `std::string', it defaults to `1', `0' otherwise.
5317 * data/location.cc: Iff b4_define_location_comparison is `1', add
5318 operator== and operator!= for class position and for class location.
5319
5320 Some minor fixes.
5321 * src/scan-action.l: Remove unused file.
5322 * src/symtab.c (symbol_printer_set): Use printer_location not
5323 destructor_location.
5324 * src/symtab.h (struct symbol): Replace incorrect source comment for
5325 printer members.
5326 * tests/input.at (Incompatible Aliases): Update output with correct
5327 printer location.
5328
9bc0dd67
JD
53292006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
5330
5331 Don't put the pre-prologue in the header file. For the yacc.c code
5332 file and the glr.c header and code files, move the pre-prologue before
5333 the token definitions. Add new %before-definitions and
5334 %after-definitions to declare code that will go in both the header file
5335 and code file. Discussed at
5336 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
5337 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
5338 and
5339 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
5340 * NEWS (2.3+): Describe these changes.
5341 * data/glr.c (b4_pre_prologue): Move from within to before...
5342 (b4_shared_declarations): ... this.
5343 Add new b4_before_definitions before b4_token_enums.
5344 Add new b4_after_definitions at the end.
5345 * data/glr.cc (b4_pre_prologue): Replace with...
5346 (b4_before_definitions): ... this in the header file.
5347 (b4_after_definitions): New near the end of the header file.
5348 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
5349 code file right before including the header file.
5350 (b4_before_definitions): New in the previous position of
5351 b4_pre_prologue in the header file.
5352 (b4_after_definitions): New near the end of the header file.
5353 * data/yacc.c: Clean up some m4 quoting especially in the header file.
5354 (b4_token_enums_defines): In the code file, move to right before
5355 YYSTYPE for consistency with the header file.
5356 (b4_before_definitions): New right before b4_token_enums_defines in
5357 both the header and code file.
5358 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
5359 header and code file.
5360 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
5361 of prologues for %union dependencies.
91661ebb
JD
5362 (Decl Summary): In %defines description, mention the effect of
5363 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
5364 (Calc++ Parser): Forward declare driver in a %before-definitions rather
5365 than in the pre-prologue so that make check succeeds.
148d66d8 5366 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
5367 %after-definitions.
5368 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
5369 %before-definitions.
5370 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
5371 (declaration): Parse those declarations and append to
5372 b4_before_definitions and b4_after_definitions, respectively.
5373 * src/reader.c (before_definitions, after_definitions): New bools to
5374 track whether those declarations have been seen.
5375 (prologue_augment): Add to the post-prologue if %union,
5376 %before-definitions, or %after-definitions has been seen.
5377 * src/reader.h (before_definitions, after_definitions): New extern's.
5378 * src/scan-gram.l: Scan the new declarations.
5379 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
5380 prologue block in a %before-definitions or a %after-definitions based
5381 on whether the %union is declared.
5382 * tests/regression.at (Early token definitions with --yacc, Early token
5383 definitions without --yacc): Move tests for token definitions into the
5384 post-prologue since token names are no longer defined in the
5385 pre-prologue.
5386
203b9274
AD
53872006-06-20 Akim Demaille <akim@epita.fr>
5388
5389 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
5390 (symbol_get): Use it.
5391 * src/parse-gram.y: Use it.
5392
a7ee59cf
JD
53932006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
5394
5395 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
5396 build succeeds when configured with --enable-gcc-warnings.
5397
5a2baae7
PE
53982006-06-19 Paul Eggert <eggert@cs.ucla.edu>
5399
33ad1a9c
PE
5400 * src/parse-gram.y (char_name): New function.
5401 (CHAR, STRING, string_content): For %printer, properly escape.
5402 (ID): Prefer fputs to fprintf.
5403 (id): Reindent to be consistent with other rules.
5404 Properly quote char.
5405
5a2baae7
PE
5406 The Translation Project changed its way of publishing translations
5407 to maintainers. I haven't received any responses to my request
5408 for supporting the old way, or for documenting the new way. I
5409 have modified 'bootstrap' to use screen scraping
5410 (in this case, HTML scraping). This is unreliable and inelegant,
5411 but I don't see any better way. Yuck.
5412 * bootstrap (TP_URL, WGET_COMMAND): New vars.
5413 (get_translations): New function, which uses HTML scraping to
5414 deduce locations of latest translations.
5415 Use this function to grab both bison and bison-runtime .po files.
5416 Don't bother priming the pump for the runtime-po domain any more,
5417 as it's now translated better than bison is.
5418
58d7a1a1
AD
54192006-06-19 Akim Demaille <akim@epita.fr>
5420
5421 * src/scan-gram.l: No longer "parse" things after `%union' until
5422 `{'. Rather, return a single "%union" token.
5423 No longer make symbols: return strings, and leave the conversion
5424 to symbols to the parser.
5425 (SC_PRE_CODE, token_type): Remove.
5426 * src/parse-gram.y (%union): New field `character'.
5427 Sort tokens.
5428 (CHAR): New token.
5429 (ID, ID_COLON): Now that the scanner no longer makes them
5430 identifiers, adjust all uses to invoke symbol_get.
5431 (id_colon): New, wraps the conversion from string to symbol.
5432 (%union): Accept a possible union_name.
5433 (symbol): Now can be a char.
5434 * data/c.m4 (b4_union_name): Leave a default value.
5435 * data/glr.c, data/yacc.c: Use it.
5436
b931235e
JD
54372006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
5438
5439 For associating token numbers with token names for "yacc.c", don't use
5440 #define statements unless `--yacc' is specified; always use enum
5441 yytokentype. Most important discussions start at:
5442 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
5443 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
5444 and
5445 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
5446 * NEWS (2.3+): Mention.
5447 * data/c.m4 (b4_yacc_if): New.
5448 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
5449 token #define's.
5450 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
5451 on token name definitions.
5452 * src/getargs.c (usage): Capitalize `Yacc' in English.
5453 * src/output.c (prepare): Define b4_yacc_flag.
5454 * tests/regression.at (Early token definitions): Test that tokens names
5455 are defined before the pre-prologue not just before the post-prologue.
5456 Remove this test case and copy to...
5457 (Early token definitions with --yacc): ... this to test #define's.
5458 (Early token definitions without --yacc): ... and this to test enums.
5459
9e6e7ed2
PE
54602006-06-11 Paul Eggert <eggert@cs.ucla.edu>
5461
5462 * NEWS: Reword the post-2.3 change to not be so optimistic about
5463 removing the old "look-ahead" spelling.
5464 Update previous look-ahead/lookahead change reports.
5465 * REFERENCES: look-ahead -> lookahead (since that's
5466 what he actually wrote).
5467 * doc/refcard.tex: look ahead -> lookahead,
5468 look-ahead -> lookahead
5469
742e4900
JD
54702006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
5471
5472 For consistency, use `lookahead' instead of `look-ahead' or
5473 `look_ahead'. Discussed starting at
5474 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
5475 and then at
5476 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
5477 * NEWS: For the next release, note the change to `--report'.
5478 * TODO, doc/bison.1: Update English.
5479 * doc/bison.texinfo: Update English.
5480 (Understanding Your Parser, Bison Options): Document as
5481 `--report=lookahead' rather than `--report=look-ahead'.
5482 * src/conflicts.c: Update English in comments.
5483 (lookahead_set): Rename from look_ahead_set.
5484 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
5485 (resolve_sr_conflict): Rename local look_ahead_tokens to
5486 lookahead_tokens, and update other uses.
5487 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
5488 count_rr_conflicts, conflicts_free): Update uses.
5489 * src/getargs.c (report_args): Move "lookahead" before alternate
5490 spellings.
5491 (report_types): Update uses.
5492 (usage): For `--report' usage description, state `lookahead' spelling
5493 rather than `look-ahead'.
5494 * src/getargs.h (report.report_lookahead_tokens): Rename from
5495 report_look_ahead_tokens.
5496 * src/lalr.c: Update English in comments.
5497 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
5498 (state_lookahead_tokens_count): Rename from
5499 state_look_ahead_tokens_count.
5500 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5501 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
5502 Rename local n_look_ahead_tokens to n_lookahead_tokens.
5503 Update other uses.
5504 Update English in output.
5505 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
5506 * src/print.c: Update English in comments.
5507 (lookahead_set): Rename from look_ahead_set.
5508 (print_reduction): Rename argument lookahead_token from
5509 look_ahead_token.
5510 (print_core, state_default_rule, print_reductions, print_results):
5511 Update uses.
5512 * src/print_graph.c: Update English in comments.
5513 (print_core): Update uses.
5514 * src/state.c: Update English in comments.
5515 (reductions_new): Update uses.
5516 (state_rule_lookahead_tokens_print): Rename from
5517 state_rule_look_ahead_tokens_print, and update other uses.
5518 * src/state.h: Update English in comments.
5519 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
5520 (state_rule_lookahead_tokens_print): Rename from
5521 state_rule_look_ahead_tokens_print.
5522 * src/tables.c: Update English in comments.
5523 (conflict_row, action_row): Update uses.
5524 * tests/glr-regression.at
5525 (Incorrect lookahead during deterministic GLR,
5526 Incorrect lookahead during nondeterministic GLR): Rename
5527 print_look_ahead to print_lookahead.
5528 * tests/torture.at: Update English in comments.
5529 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
5530 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
5531 (Many lookahead tokens): Update uses.
5532 * data/glr.c: Update English in comments.
5533 * lalr1.cc: Likewise.
5534 * yacc.c: Likewise.
5535 * src/conflicts.h: Likewise.
5536 * src/lalr.h: Likewise.
5537 * src/main.c: Likewise.
5538 * src/output.c: Likewise.
5539 * src/parse-gram.c: Likewise.
5540 * src/tables.h: Likewise.
5541 * tests/calc.at: Likewise.
5542
3c40d0b5
JD
55432006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
5544
5545 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
5546
5d278082
PE
55472006-06-07 Paul Eggert <eggert@cs.ucla.edu>
5548
5549 * TODO: Add request from Nelson H. F. Beebe to be able to install
5550 Bison without installing the yacc script.
5551
9e668899
JD
55522006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5553
5554 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
5555 and yytext if they're already #define'd.
5556 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
5557 * src/scan-code-c.c: ... here.
5558 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
5559 <config.h>.
5560
0c8e079f
JD
55612006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
5562
5563 Get Bison to build again when configured with --enable-gcc-warnings.
5564 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
5565 missing #include's.
5566 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
5567 loc argument as it shadows a global.
5568 * src/scan-gram.l: Remove stray comma that prevents boundary_set
5569 invocation.
5570
5571 * src/.cvsignore: Add scan-code.c.
5572
2346344a
AD
55732006-06-07 Akim Demaille <akim@epita.fr>
5574
5575 * src/scan-gram.l: Move the "add a trailing ; to actions" code
5576 to...
5577 * src/scan-code.l: here.
5578 * tests/input.at (Torturing the Scanner): Fix another location
5579 error.
5580
4862bdfd
AD
55812006-06-07 Akim Demaille <akim@epita.fr>
5582
5583 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
5584
e9071366
AD
55852006-06-06 Akim Demaille <akim@epita.fr>
5586
5587 Extract the parsing of user actions from the grammar scanner.
5588 As a consequence, the relation between the grammar scanner and
5589 parser is much simpler. We can also split "composite tokens" back
5590 into simple tokens.
5591 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
5592 * src/scan-gram.l (add_column_width, adjust_location): Move to and
5593 rename as...
5594 * src/location.h, src/location.c (add_column_width)
5595 (location_compute): these.
5596 Fix the column count: the initial column is 0.
5597 (location_print): Be robust to ending column being 0.
5598 * src/location.h (boundary_set): New.
5599 * src/main.c: Adjust to scanner_free being renamed as
5600 gram_scanner_free.
5601 * src/output.c: Include scan-code.h.
5602 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
5603 Use boundary_set.
5604 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
5605 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
5606 which is now, again, a separate token.
5607 Adjust all dependencies.
5608 Whereever actions with $ and @ are used, use translate_code.
5609 (action): Remove this nonterminal which is now useless.
5610 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
5611 (grammar_current_rule_action_append): Use translate_code.
5612 (packgram): Bound check ruleno, itemno, and rule_length.
5613 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
5614 (last_string, last_braced_code_loc, max_left_semantic_context)
5615 (scanner_initialize, scanner_free, scanner_last_string_free)
5616 (gram_out, gram_lineno, YY_DECL_): Move to...
5617 * src/scan-gram.h: this new file.
5618 (YY_DECL): Rename as...
5619 (GRAM_DECL): this.
5620 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
5621 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5622 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5623 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5624 Move these declarations, and...
5625 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
5626 these to...
5627 * src/flex-scanner.h: this new file.
5628 * src/scan-gram.l (rule_length, rule_length_overflow)
5629 (increment_rule_length): Remove.
5630 (last_braced_code_loc): Rename as...
5631 (gram_last_braced_code_loc): this.
5632 Adjust to the changes of the parser.
5633 Move all the handling of $ and @ into...
5634 * src/scan-code.l: here.
5635 * src/scan-gram.l (handle_dollar, handle_at): Remove.
5636 (handle_action_dollar, handle_action_at): Move to...
5637 * src/scan-code.l: here.
5638 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
5639 scan-code.h, scan-code-c.c, scan-gram.h.
5640 (EXTRA_bison_SOURCES): Add scan-code.l.
5641 (BUILT_SOURCES): Add scan-code.c.
5642 (yacc): Be robust to white spaces.
5643
5644 * tests/conflicts.at, tests/input.at, tests/reduce.at,
5645 * tests/regression.at: Adjust the column numbers.
5646 * tests/regression.at: Adjust the error message.
7891a7c4 5647
184e42f0
JD
56482006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5649
5650 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5651 Use Akim's wording from
5652 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
5653
7891a7c4
JD
56542006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
5655
5656 Between Bison releases, manually append `+' to the previous Bison
5657 release number, and use that as a signal to automatically print the
5658 ChangeLog's CVS Id keyword from --version. Discussed starting at
5659 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
5660 * ChangeLog: Add Id header.
5661 * configure.ac (AC_INIT): Append `+' to `2.3'.
5662 * src/.cvsignore: Add revision.c.
5663 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
5664 (BUILT_SOURCES): Add revision.c.
5665 (revision.c): New target rule. This file defines a new global variable
5666 named revision. It initializes it with either the Id from ChangeLog
5667 or, if VERSION doesn't contain `+', with the empty string.
5668 * src/getargs.c (version): Print the value of revision.
5669 * src/revision.h: Extern revision.
5670
4ad3ed84
PE
56712006-06-05 Paul Eggert <eggert@cs.ucla.edu>
5672
5673 * NEWS: Version 2.3.
5674 * configure.ac (AC_INIT): Likewise.
5675
02103984
PE
56762006-05-30 Paul Eggert <eggert@cs.ucla.edu>
5677
5678 * data/glr.c (YYRECOVERING): Define to be a function-like macro
5679 with no arguments, not as an object-like macro. This is for
5680 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
5681 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
5682 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
5683 Document this.
5684
2c08afa5
JD
56852006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
5686
5687 * src/getargs.c (usage): Back out yesterday's modification of the
5688 --help output so that we don't have to wait for translation before
5689 releasing 2.3.
5690
6077da58
PE
56912006-05-29 Paul Eggert <eggert@cs.ucla.edu>
5692
5693 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
5694 Problem reported by Akim Demaille.
5695
2a26b6c2
JD
56962006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5697
5698 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
5699
aefef0d6
PE
57002006-05-26 Paul Eggert <eggert@cs.ucla.edu>
5701
5702 * data/yacc.c (yy_reduce_print): Omit trailing white space in
5703 generated source code. Problem reported by Frans Englich in
5704 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
5705
fcd8e201
PE
57062006-05-22 Paul Eggert <eggert@cs.ucla.edu>
5707
5708 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
5709 shell, not within 'make', so that 'make' by an ordinary builder
5710 (using GNU make) does not worry about configuring gzip. This also
5711 works around a bug reported independently by Keith Thompson and by
5712 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
5713 stderr rather than stdout, messing up the build logs.
5714
7b5cdcbd
JD
57152006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5716
5717 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
5718 to make sure that YYID will never be unused. This fixes a 'make
5719 maintainer-check' failure caused by the recent changes to the 'Trivial
5720 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
5721 not used.
5722 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
5723
5ad0a449
JD
57242006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
5725
5726 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
5727 state before an empty RHS is always resolved here. Only the location
5728 of that state is guaranteed to be resolved, and that's enough. This
5729 fixes the remaining bug reported by Derek M. Jones in
5730 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5731 * tests/glr-regression.at (Uninitialized location when reporting
5732 ambiguity): Test the above case.
5733 Also, the embedded comments in this test case claim it checks the case
5734 of an empty RHS that has inherited the initial location. However, the
5735 corresponding LHS was already resolved, so yyresolveLocations didn't
5736 actually have reason to modify it. Fix this by forcing
5737 nondeterministic operation at the beginning of the parse.
5738
50cce58e
PE
57392006-05-20 Paul Eggert <eggert@cs.ucla.edu>
5740
5741 * data/c.m4 (b4_yy_symbol_print_generate):
5742 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
5743 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
5744 of the bugs reported today by Derek M Jones in
5745 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
5746 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
5747 defined to be a type name without parens or brackets.
5748 (Location Type): Similarly for YYLTYPE.
5749 * tests/regression.at (Trivial grammars): Put in a test for this
5750 bug that will be caught by 'make maintainer-check' (though not,
5751 alas, by 'make check' unless your compiler is picky).
5752
ab8d9dc5
PE
57532006-05-19 Paul Eggert <eggert@cs.ucla.edu>
5754
0d2c8934 5755 * NEWS: Version 2.2.
ab8d9dc5
PE
5756 * configure.ac (AC_INIT): Likewise.
5757
9138c575
JD
57582006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
5759
5760 * data/glr.c (yyreportTree): Make room in yystates for the state
5761 preceding the RHS. This fixes the segmentation fault reported by Derek
5762 M. Jones in
5763 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
5764 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
5765 to the user. Reported for yyreportTree by Derek M. Jones later in the
5766 same thread.
5767 * THANKS: Add Derek M. Jones.
5768 Update my email address.
5769 Fix typo in Steve Murphy's name.
5770
276f48df
PE
57712006-05-14 Paul Eggert <eggert@cs.ucla.edu>
5772
d6645148
PE
5773 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
5774 checking against YYLAST that caused the parser to miss a potential
5775 alternative in its diagnostic.
5776 Problem reported by Maria Jose Moron Fernandez in
5777 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
5778 * data/lalr1.cc (yysyntax_error_): Likewise.
5779 * data/yacc.c (yysyntax_error): Likewise.
5780 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
5781 tokens, in case we run into an older C compiler.
5782 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
5783 Use them to check for the off-by-one error fixed above.
5784
276f48df
PE
5785 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
5786 YYSIZE_T, not size_t.
5787 * tests/regression.at (Trivial grammars): New test, to catch
5788 the error fixed by the above patch.
5789
cd8b5791
AD
57902006-05-14 Akim Demaille <akim@lrde.epita.fr>
5791
5792 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
5793 scheme.
5794 Reported by Steve Murphy.
5795
34376418
AD
57962006-05-14 Akim Demaille <akim@lrde.epita.fr>
5797
5798 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
5799 * data/glr.cc: b4_location_flag is now b4_locations_flag.
5800
327afc7c
AD
58012006-05-14 Akim Demaille <akim@lrde.epita.fr>
5802
5803 Implement --trace=m4.
5804 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
5805 * src/output.c (output_skeleton): When set, pass -dV to m4.
5806
5807 Factor the handling of flags in m4.
5808 * src/output.c (prepare): Rename the muscle names debug, defines,
5809 error_verbose to debug_flag, defines_flag, error_verbose_flag.
5810 * data/c.m4: Adjust.
5811 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
5812 Use b4_define_flag_if to define other b4_FLAG_if macros.
5813 (b4_location_if): As a consequence, rename as...
5814 (b4_locations_if): this, for consistency.
5815 Adjust all the skeletons.
5816
ba9ecd19
AD
58172006-05-14 Akim Demaille <akim@lrde.epita.fr>
5818
5819 * etc/bench.pm: Shorten bench names.
5820
4e83ea15
AD
58212006-05-14 Akim Demaille <akim@lrde.epita.fr>
5822
5823 * src/output.h, src/output.c (error_verbose): Move to...
5824 * src/getargs.h, src/getargs.c: here.
5825 Sort the flags.
5826 Adjust dependencies.
5827
6e93d810
PE
58282006-05-13 Paul Eggert <eggert@cs.ucla.edu>
5829
5830 * data/c.m4 (b4_copyright): Put the special exception for Bison
5831 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
5832 uses changed. Suggested by Akim Demaille. Also, wrap the
5833 copyright notice, in case it is longer than 80 columns. Replace
5834 comma by newline after title.
6e93d810 5835
eaea13f5
PE
58362006-05-11 Paul Eggert <eggert@cs.ucla.edu>
5837
5838 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
5839 incompatibility, not a bug. Mention that it wasn't fixed as of
5840 flex 2.5.33.
5841
3cf084ec
AD
58422006-05-11 Akim Demaille <akim@lrde.epita.fr>
5843
5844 * examples/extexi: Enforce the precedence of concatenation over
5845 >>.
0a9f1c7d 5846 Reported by Tommy Nordgren.
3cf084ec 5847
32c96bd7
AD
58482006-05-11 Akim Demaille <akim@lrde.epita.fr>
5849
5850 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
5851 with the member "token".
f94705b2 5852 Reported by Martin Nylin.
32c96bd7 5853
eaea13f5
PE
58542006-05-08 Paul Eggert <eggert@cs.ucla.edu>
5855
5856 * data/glr.c: Switch to Bison 2.2 special-exception language in
5857 the copyright notice. Use more-regular format for titles and
5858 copyright notices.
5859 * data/glr.cc: Likewise.
5860 * data/location.cc: Likewise.
5861 * data/yacc.cc: Likewise.
5862 * doc/bison.texinfo (Conditions): Document this.
5863 * NEWS: likewise. Upgrade version to 2.2.
5864
6e2d1146
AD
58652006-04-27 Akim Demaille <akim@lrde.epita.fr>
5866
5867 * data/glr.cc: Remove dead code.
5868
47671055
PE
58692006-04-25 Paul Eggert <eggert@cs.ucla.edu>
5870
5871 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
5872 that variable and the line breaks the bootstrap. Problem reported
5873 by Juan M. Guerrero.
5874
ed2e6384
AD
58752006-04-24 Akim Demaille <akim@lrde.epita.fr>
5876
5877 * doc/bison.texinfo (Multiple start-symbols): New.
5878
3cedc2dc
AD
58792006-04-24 Akim Demaille <akim@lrde.epita.fr>
5880
5881 * etc/README, etc/bench.pl: New.
5882
b2ddc3f3
AD
58832006-04-03 Akim Demaille <akim@lrde.epita.fr>
5884
5885 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
5886 rule.
5887 Reported by Mickael Labau.
5888 * tests/input.at (Torturing the Scanner): Test it.
5889
91e3ac9a
PE
58902006-03-16 Paul Eggert <eggert@cs.ucla.edu>
5891
5892 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
5893 Problem reported by Bob Rossi.
5894
58952006-03-13 Paul Eggert <eggert@cs.ucla.edu>
5896
5897 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
5898 and didn't really work.
5899 For the index, use @ifnotinfo, not @iftex.
5900 Minor cleanups of spacing and terminology.
5901
5cf61e93
AD
59022006-03-12 Akim Demaille <akim@lrde.epita.fr>
5903
5904 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
5905 of AT_NAME_PREFIX when %name-prefix is not used.
5906
aa08666d
AD
59072006-03-12 Akim Demaille <akim@lrde.epita.fr>
5908
5909 Apply --prefix to C++ skeletons too: they change the namespace.
5910 The test suite already exercize these cases.
5911 * data/c++.m4 (b4_namespace): New.
5912 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
5913 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
5914 * data/yacc.c, data/glr.c: Remove a useless `[]'.
5915 * doc/bison.texinfo: Document it.
5916 (Option Cross Key): Use @multitable in all formats. It looks
5917 nicer, even in TeX outputs.
5918 (Rules): Use the same code whatever the output type is.
5919 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
5920 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
5921 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 5922
45567173
AD
59232006-03-10 Akim Demaille <akim@lrde.epita.fr>
5924
5925 * TODO: Remove dead items.
5926
e9d8f881 59272006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
5928
5929 * doc/FAQ: Remove, merged into...
5930 * doc/bison.texinfo (FAQ): this.
5931 * doc/Makefile.am (EXTRA_DIST): Adjust.
5932
c095d689
AD
59332006-03-10 Akim Demaille <akim@lrde.epita.fr>
5934
5935 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
5936 even if empty.
5937 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
5938 * doc/bison.texinfo (Calc++ Scanner): Use it.
5939
6e0f8287
PE
59402006-03-09 Paul Eggert <eggert@cs.ucla.edu>
5941
5942 Fix two nits reported by twlevo, plus one more that I discovered.
5943
5944 * src/assoc.h (assoc_to_string): Give a name to the arg, as
5945 this is the usual Bison style.
5946 * src/location.h (location_print): Likewise.
5947
5948 * src/reader.h (token_name): Likewise.
5949
d6b771c3
PE
59502006-03-08 Paul Eggert <eggert@cs.ucla.edu>
5951
5952 Fix some nits reported by twlevo.
5953 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
5954 and "POSIX". Use more-modern syntax for URLs. Mention C++
5955 and ask for Java. Don't hardwire OS version numbers. Add
5956 copyright notice.
5957 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
5958 * src/conflicts.c (solved_conflicts_obstack): Now static.
5959
1e137b71
JD
59602006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
5961
5962 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
5963 page. Say "you can use it" not "you may use it" as on the web page;
5964 we're describing capabilities not granting permission.
5965
73f2e47e
PE
59662006-03-06 Paul Eggert <eggert@cs.ucla.edu>
5967
6d05403d
PE
5968 * data/glr.c (yyresolveLocations): Rename local variables to avoid
5969 shadowing warnings. Use usual patter for iterating through RHS.
5970 * tests/glr-regression.at
5971 (Uninitialized location when reporting ambiguity):
5972 Modify yylex so that it uses its argument, rather than trying
5973 to rely on ARGSUSED (which doesn't work for gcc with warnings).
5974 const char -> char const.
5975
73f2e47e
PE
5976 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
5977 Don't use tabs inside commands; it messes up 'ps'.
5978 Problem reported by twlevo.
5979
8710fc41
JD
59802006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
5981
5982 * tests/glr-regression.at (Uninitialized location when reporting
5983 ambiguity): New test case.
5984 * data/glr.c (yyresolveLocations): New function, which uses
5985 YYLLOC_DEFAULT.
5986 (yyresolveValue): Invoke yyresolveLocations before reporting an
5987 ambiguity.
5988 * doc/bison.texinfo (Default Action for Locations): Note
5989 YYLLOC_DEFAULT's usage for ambiguity locations.
5990 (GLR Semantic Actions): Cross-reference those notes.
5991
ae952af2
JD
59922006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
5993
5994 * tests/glr-regression.at (Leaked semantic values when reporting
5995 ambiguity): Remove unnecessary union and type declarations.
5996 (Leaked lookahead after nondeterministic parse syntax error): New test
5997 case.
5998 * data/glr.c (yyparse): Check for zero stacks remaining before
5999 attempting to shift the lookahead so that you don't lose it.
6000
35ee866a
JD
60012006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6002
6003 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6004 * tests/glr-regression.at (Leaked semantic values when reporting
6005 ambiguity): New test case.
6006 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6007 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6008 now unnecessary yystackp parameter.
6009 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6010 destructors can be called.
6011
6012 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6013 in existing testcases.
6014
520181ab
JD
60152006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6016
6017 Don't leak semantic values for parent RHS when a user action cuts the
6018 parser, and clean up related code a bit.
6019 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
6020 cuts parse): Rename to...
6021 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
6022 for leaked parent RHS values.
6023 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6024 between an unresolved state (non-empty chain of semantic options) and
6025 an incomplete one (signaled by an empty chain).
ae952af2 6026 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
6027 successfully or unsuccessfully resolved yyGLRState to...
6028 (yyresolveValue): ... here so that yyresolveValue always leaves a
6029 yyGLRState with consistent data and thus is easier to understand.
6030 Remove the yyvalp and yylocp parameters since they are always just
6031 taken from the yys parameter. When reporting a discarded merged value
6032 in debugging output, note that it is incompletely merged. Document the
6033 interface.
6034 (yyresolveAction): If resolving any of the RHS states fails, destroy
6035 them all rather than leaking them. Thus, as long as user actions are
6036 written to clean up the RHS correctly, yyresolveAction always cleans up
6037 the RHS of a semantic option. Document the interface.
6038
18d9185c
PE
60392006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6042 led to a segmentation fault in GNU Pascal. Problem reported
6043 by Waldek Hebisch.
6044
841a7737
JD
60452006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6046
6047 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6048 mid-rule action inside a nonterminal symbol in order to declare a
6049 destructor for its semantic value.
6050
fc3f467f
PE
60512006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6052
6053 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6054 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6055 __cplusplus && ! defined _STDLIB_H && !
6056 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6057 defined free))]: Include <stdlib.h> rather than rolling our own
6058 declarations of malloc and free, to avoid problems with
6059 incompatible declarations (using 'throw') C++'s stdlib.h. This
6060 should fix Debian bug 340012
6061 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6062 reported by Guillaume Melquiond.
6063
a3af26dd
PE
60642006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6065
4d7bc38c
PE
6066 * NEWS: Clarify symbols versus types in unused-value warnings.
6067
a3af26dd
PE
6068 * configure.ac (AC_INIT): Bump version number.
6069
4e26c69e
PE
60702006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6071
6072 * NEWS: Version 2.1a.
6073 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6074 since C99 requires this.
6075
498e897c
PE
60762006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6077
6078 * m4/c-working.m4: New file.
6079 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6080
57bb17ca
PE
60812006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6082
6083 * Makefile.maint: Merge from coreutils.
6084
0be105dc
PE
60852006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6086
6087 More portability fixes for problems summarized by Nelson H. F. Beebe.
6088
6089 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6090 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6091 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6092 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6093 messes up because C++ code is compiled in 32-bit mode but linked
6094 in 64-bit mode.
6095
6fc0c024
PE
60962006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6097
6098 More portability fixes for problems summarized by Nelson H. F. Beebe.
6099
7870f699
PE
6100 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6101 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6102
6fc0c024
PE
6103 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6104 nodist_PROGRAMS, since we don't need to actually compile the
6105 example if we're just doing a plain 'make'. This avoids bothering
6106 the installer unnecessarily about problems due to weird C++
6107 compilers.
6108
fe6c2fde
PE
61092006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6110
6111 More portability fixes for problems summarized by Nelson H. F. Beebe.
6112
6113 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6114 than #include "...", and compile with -I'.'. The old method was
6115 not portable, according to Posix and the C standard, and it does
6116 not work with Sun C 5.7, where previous #line directives affect
6117 the working directory used in later #include "..." directives.
6118
927b425b
JMG
61192006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6120
6121 Various DJGGP specific issues in /djgpp
6122
d9735e9e
PE
61232006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6124
6125 More portability fixes for problems summarized by Nelson H. F. Beebe.
6126
6127 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6128 '#include <map>' works and that you can apply ++ to iterators.
6129
5a6755af
PE
61302006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6131
67a0dc4f
PE
6132 Work around portability problems summarized by Nelson H. F. Beebe in
6133 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6134
8c86f0ef
PE
6135 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6136 that '#include <string>' works.
6137
de35dd59
PE
6138 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6139 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6140 "warning: sorry: semantics of inline function static data `const
6141 unsigned char translate_table[262]' are wrong (you'll wind up with
6142 multiple copies)".
6143
67a0dc4f
PE
6144 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6145 or, xor to not_, and_, or_, and xor_, respectively. This works
6146 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6147 random system header somewhere that includes the equivalent of
6148 <iso646.h>.
6149
5a6755af
PE
6150 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6151 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 6152 Suite Version 2.0.
5a6755af 6153
3f001415
JD
61542006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6155
6156 During deterministic GLR operation, user actions should be able to
6157 influence the parse by changing yychar. To make this easier to fix and
6158 to make glr.c easier to evolve in general, don't maintain yytoken in
6159 parallel with yychar; just compute yytoken when needed.
6160 * tests/glr-regression.at (Incorrect lookahead during deterministic
6161 GLR): Check that setting yychar in a user action has the intended
6162 effect.
6163 * data/glr.c (yyGLRStack): Remove yytokenp member.
6164 (yyclearin): Don't set *yytokenp.
6165 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6166 yychar rather than *yytokenp to determine the current lookahead.
6167 Compute yytoken locally when needed.
6168 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6169 point to.
6170
6171 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6172 after `--report' documentation.
6173
e2a8c0f5
PE
61742006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6175
6176 * src/parse-gram.y (grammar_declaration): Location of printer
6177 symbol is @1, not list->location. Bug reported by twlevo.
6178 * tests/input.at (Incompatible Aliases): Adjust to above change.
6179
6b702268
PE
61802006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6181
27622431
PE
6182 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6183 all the test at once. This makes the output easier to read in the
6184 normal case.
6185
6b702268
PE
6186 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6187 got from <http://bro-ids.org/download.html>. The bug is that
6188 when two actions appeared in succession, the second one was
6189 scanned before the first one was added to the grammar rule
6190 as a midrule action. Bison then output the incorrect warning
6191 "parse.y:905.17-906.36: warning: unused value: $3".
6192 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6193 associated with a value.
6194 (rhs): Don't invoke grammar_current_rule_action_append.
6195 (action): Invoke it here instead.
6196 * src/reader.c (grammar_midrule_action): Now extern.
6197 (grammar_current_rule_action_append): Don't invoke
6198 grammar_midrule_action; that is now the scanner's job.
6199 * src/reader.h (last_string, last_braced_code_loc):
6200 (grammar_midrule_action): New decls.
6201 * src/scan-gram.l (last_string): Now extern, sigh.
6202 (last_braced_code_loc): New extern variable.
6203 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6204 rule already has an action.
6205 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6206 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6207 Add some tests to check that the above changes fixed the bug.
6208
d40ba6c2
PE
62092006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6210
6211 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6212 All used changed. Check whether the symbol has a destructor,
6213 not whether it is typed.
6214 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6215 that the values are still reported as unused. All line numbers
6216 adjusted.
6217
401aace6
PE
62182006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6219
6220 Work around a bug in bro 0.8, which underparenthesizes its
6221 definition of YYLLOC_DEFAULT.
6222 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6223 their arguments.
6224 * data/lalr1.cc: Likewise.
6225 * data/yacc.cc: Likewise.
6226
06f01bc4
PE
62272006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6228
401aace6
PE
6229 Work around a bug in Pike 7.0, and give the Pike folks a
6230 better way to override the usual int widths.
6231 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6232 user can override the types.
6233 (short): #undef, to work around a bug in Pike 7.0.
6234 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6235 (union yyalloc.yyss): Use yytype_int16 rather than short.
6236 All uses changed.
6237 (yysigned_char): Remove.
6238 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6239 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6240 * tests/regression.at (Web2c Actions): Adjust to above changes.
6241
6242 * src/reader.c (check_and_convert_grammar): New function.
6243 (reader): Close the input file even if something went wrong during
6244 parsing. Minor file descriptor leak reported by twlevo.
6245
06f01bc4
PE
6246 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6247 to pacify gcc -Wswitch-default.
6248 * src/scan-gram.l (adjust_location): Use a default: break; case
6249 to pacify gcc -Wswitch-default.
6250 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6251 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6252 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6253 Move these decls to scan-skel.l, since they don't need to be
6254 visible elsewhere.
6255 * src/scan-skel.l: Accept the above decls.
6256 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6257 is used.
6258
02650b7f
PE
62592006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6260
6261 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6262 since we don't want to insist on a version number at the start
6263 of the changelog every time.
6264 * Makefile.maint: Sync from coreutils a bit better.
6265 (sc_trailing_blank): Renamed from sc_trailing_space.
6266 All uses changed.
6267 (sc_no_if_have_config_h, sc_require_config_h):
6268 (sc_prohibit_assert_without_use): New rules.
6269 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6270 (sc_dd_max_sym_length): Fix leading spaces in rule.
6271 (sc_system_h_headers): Prefix with @.
6272 (sc_useless_cpp_parens, m4-check): Output line numbers.
6273 (changelog-check): Allow version only in head.
6274 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6275 satisfy new Makefile.maint rule.
6276 * data/glr.c: Likewise.
6277 * data/glr.cc: Likewise.
6278 * data/lalr1.cc: Likewise.
6279 * data/yacc.c: Likewise.
6280 * lib/ebitsetv.c: Likewise.
6281 * lib/lbitset.c: Likewise.
6282 * lib/subpipe.c: Likewise.
6283 * lib/timevar.c: Likewise.
6284 * src/system.h: Likewise.
6285 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6286 * djgpp/Makefile.maint: Add copyright notice.
6287 * djgpp/README.in: Likewise.
6288 * djgpp/config.bat: Likewise.
6289 * djgpp/config.site: Likewise.
6290 * djgpp/config_h.sed: Likewise.
6291 * djgpp/djunpack.bat: Likewise.
6292 * djgpp/config.sed: Fix copyright notice to match standard format.
6293 * djgpp/subpipe.h: Likewise.
6294 * lib/bitsetv-print.c: Likewise.
6295 * lib/bitsetv.c: Likewise.
6296 * lib/subpipe.h: Likewise.
6297 * lib/timevar.c: Likewise.
6298 * lib/timevar.h: Likewise.
6299 * djgpp/subpipe.c: Use standard recipe for config.h.
6300 * lib/abitset.c: Likewise.
6301 * lib/bitset.c: Likewise.
6302 * lib/bitset_stats.c: Likewise.
6303 * lib/bitsetv-print.c: Likewise.
6304 * lib/bitsetv.c: Likewise.
6305 * lib/ebitsetv.c: Likewise.
6306 * lib/get-errno.c: Likewise.
6307 * lib/lbitset.c: Likewise.
6308 * lib/subpipe.c: Likewise.
6309 * lib/timevar.c: Likewise.
6310 * lib/vbitset.c: Likewise.
6311 * tests/local.at: Likewise.
6312 * src/scan-gram.l: Don't include verify.h, since system.h does
6313 that for us.
6314 * .x-sc_require_config_h: New file.
6315 * .x-sc_unmarked_diagnostics: New file.
6316
287c78f6
PE
63172006-01-20 Paul Eggert <eggert@cs.ucla.edu>
6318
287c78f6
PE
6319 Be a bit more systematic about using 'abort'.
6320 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
6321 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
6322 Put 'default: abort ();' before some other case, to satisfy older
6323 pedantic compilers.
6324 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6325 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
6326 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
6327 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
6328 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
6329 (get_decision_str, get_orientation_str, get_node_alignment_str):
6330 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
6331 (get_linestyle_str, get_arrowstyle_str): Likewise.
6332 * src/conflicts.c (resolve_sr_conflict):
6333 Use a default case rather than one for the one remaining enum
6334 value, to catch invalid enum values as well.
6335 * src/lalr.c (set_goto_map, map_goto):
6336 Prefer "assert (FOO);" to "if (!FOO) abort ();".
6337 * src/nullable.c (nullable_compute, token_definitions_output):
6338 Likewise.
6339 * src/reader.c (packgram, reader): Likewise.
6340 * src/state.c (transitions_to, state_new, state_reduction_find):
6341 Likewise.
6342 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
6343 (symbol_pack): Likewise.
6344 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
6345 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
6346 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
6347 * src/system.h: Don't include <assert.h>.
6348 (assert): New macro.
6349
6350 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
6351 (Destructor Decl, Parser Function, Pure Calling):
6352 Describe rules for braces inside C code more carefully.
287c78f6 6353
c66dfadd
PE
63542006-01-19 Paul Eggert <eggert@cs.ucla.edu>
6355
c21493b8
PE
6356 Fix some porting glitches found by Nelson H. F. Beebe.
6357 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
6358 compilers that don't understand that abort () does not return.
6359 * src/state.c (transitions_to): Likewise.
6360 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6361 that '#include <cstdlib>' works.
6362 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
6363 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
6364 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
6365 for the benefit of some pre-C99 compilers.
6366
b6e3facf
PE
6367 * bootstrap: Undo changes to gnulib files that autoreconf made.
6368
c66dfadd
PE
6369 Minor fixups to get 'make maintainer-check' to work.
6370 * configure.ac: Don't use -Wnested-externs, as it's incompatible
6371 with the new verify.h implementation.
6372 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
6373 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
6374 * data/yacc.c (YYUSE): Likewise.
6375 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
6376 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
6377 * src/parse-gram.y (declaration): Don't pass a string constant
6378 to a function that expects char *, since GCC might complain
6379 about the constant value.
6380 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
6381 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
6382 before #defining them.
6383 * tests/glr-regression.at
6384 (Incorrectly initialized location for empty right-hand side in GLR):
6385 In yyerror, use the msg arg.
6386 (Corrupted semantic options if user action cuts parse):
6387 (Incorrect lookahead during deterministic GLR):
6388 (Incorrect lookahead during nondeterministic GLR):
6389 Don't name a local var 'index'; it shadows string.h's 'index'.
6390
ed94ef2a
AD
63912006-01-19 Akim Demaille <akim@epita.fr>
6392
6393 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
6394 location, not just parts of it.
6395
e9ad4aec
PE
63962006-01-18 Paul Eggert <eggert@cs.ucla.edu>
6397
d6ca7905
PE
6398 * NEWS: Document the fact that multiple %unions are now allowed.
6399 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
6400 * TODO: This feature is now implemented, so remove it from
6401 the wishlist.
d6ca7905 6402
ef1b70e0
PE
6403 * Makefile.maint: Merge with coreutils Makefile.maint.
6404 (CVS_LIST): Use build-aux version if available.
6405 (VERSION_REGEXP): New macro.
6406 (syntax-check-rules): Add sc_no_if_have_config_h,
6407 sc_prohibit_assert_without_use, sc_require_config_h,
6408 sc_useless_cpp_parens.
6409 (sc_obsolete_symbols): Check for O_NDELAY.
6410 (sc_dd_max_sym_length): Track coreutils.
6411 (sc_unmarked_diagnostics): Look in all files, not just *.c.
6412 (sc_useless_cpp_parens): New rule.
6413 (news-date-check): Look for version or today's date.
6414 (changelog-check): Don't require version number near head.
6415 (copyright-check): Use current year instead of hardwiring 2005.
6416 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
6417 (announcement): Add --gpg-key-ID.
6418
6419 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
6420 with "file system".
6421
2073ce56 6422 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
6423 array. Problem reported by twlevo.
6424 * src/reader.c (packgram): Prepend a new sentinel before ritem.
6425 * src/lalr.c (build_relations): Rely on new sentinel.
6426 * src/gram.c (gram_free): Adjust to new sentinel.
6427
b7691f15
JD
64282006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
6429
6430 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
6431 yylookaheadNeeds. All uses updated.
6432 (yysplitStack): Rename local yynewLookaheadStatuses to
6433 yynewLookaheadNeeds.
6434 * data/glr-regression.at (Incorrect lookahead during nondeterministic
6435 GLR): In comments, change `lookahead status' to `lookahead need'.
6436
ddee1b06
PH
64372006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6438
6439 * data/glr.c (yysplitStack): A little stylistic rewrite.
6440
12f4614d
PH
64412006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6442
6443 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
6444
32c29292
JD
64452006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
6446
6447 * doc/bison.texinfo: Fix some typos.
6448 (GLR Semantic Actions): New subsection discussing special
6449 considerations because GLR semantic actions might be deferred.
6450 (Actions): Mention look-ahead usage of yylval.
6451 (Actions and Locations): Mention look-ahead usage of yylloc.
6452 (Special Features for Use in Actions): Add YYEOF entry and mention it
6453 in the yychar entry.
6454 In the yychar entry, remove mention of the local yychar case (pure
6455 parser) since this is irrelevant information when writing semantic
148d66d8 6456 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
6457 yychar is otherwise described as an external variable.
6458 In the yychar entry, don't call it the `current' look-ahead since it
6459 isn't when semantic actions are deferred.
6460 In the yychar and yyclearin entries, add note about deferred semantic
6461 actions.
6462 Add yylloc and yylval entries discussing look-ahead usage.
6463 (Look-Ahead Tokens): When discussing yychar, don't call it the
6464 `current' look-ahead, and do mention yylval and yylloc.
6465 (Error Recovery): Cross-reference `Action Features' when mentioning
6466 yyclearin.
148d66d8 6467 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
6468 look-ahead.
6469 In the yylloc and yylval entries, mention look-ahead usage.
6470
de366a2f 64712006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
6472
6473 * tests/glr-regression.at: Update copyright year to 2006.
6474
bf70fa87
JD
64752006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6476
6477 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
6478 use during nondeterministic operation to track which stacks have
6479 actually needed the current lookahead.
6480 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
6481 Allocate, deallocate, resize, and otherwise shuffle space for
6482 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
6483 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
6484 appropriately during nondeterministic operation.
6485 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
6486 members to store the current lookahead to be used by the deferred
6487 user action.
6488 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
6489 from which the RHS is taken. Set the lookahead members of the new
6490 yySemanticOption according to the lookahead status for stack yyk.
6491 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
6492 yyaddDeferredAction.
6493 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
6494 members of yySemanticOption before invoking yyuserAction, and then set
6495 them back to their current values afterward.
6496 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
6497 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
6498 * tests/glr-regression.at: Remove `.' from the ends of recent test case
6499 titles for consistency.
6500 (Leaked merged semantic value if user action cuts parse): In order to
6501 suppress lint warnings, use arguments in merge function, and assign
6502 char value < 128 in main.
6503 (Incorrect lookahead during deterministic GLR): New test case.
6504 (Incorrect lookahead during nondeterministic GLR): New test case.
6505
05449a2c
JD
65062006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6507
de366a2f 6508 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
6509 !yyvaluep as signal that no semantic value is available to print.
6510 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
6511 to print a semantic value.
6512
4158e0a1 65132006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 6514
4158e0a1
JD
6515 * tests/glr-regression.at: For consistency with my newer test cases,
6516 don't thank myself.
6517
d659304d
JD
65182006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6519
6520 * data/glr.c (yyresolveValue): When merging semantic options, if at
6521 least one user action succeeds but a later one cuts the parse, then
6522 destroy the semantic value before returning rather than leaking it.
6523 (yyresolveStates): If a user action cuts the parse and thus
6524 yyresolveValue fails, ignore the (unset) semantic value rather than
6525 corrupting the yyGLRState, and empty the semantic options list since
6526 the user actions should have called all necessary destructors.
6527 Simplify code with YYCHK.
6528 * tests/glr-regression.at (Corrupted semantic options if user action
6529 cuts parse): New test case.
6530 (Undesirable destructors if user action cuts parse): New test case.
6531 Before applying any of this patch, this test case never actually failed
6532 for me... but only because the corrupted semantic options usually
6533 masked this bug.
6534 (Leaked merged semantic value if user action cuts parse): New test
6535 case.
6536
6ec2c0f2
AD
65372006-01-05 Akim Demaille <akim@epita.fr>
6538
6539 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
6540
1b9c21fb
PE
65412006-01-04 Paul Eggert <eggert@cs.ucla.edu>
6542
6543 * data/c.m4 (b4_c_modern): New macro, with a new provision for
6544 _MSC_VER. Problem reported by Cenzato Marco.
6545 (b4_c_function_def): Use it.
6546 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
6547 b4_c_modern.
6548 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
6549 than rolling our own.
6550
84866159
AD
65512006-01-04 Akim Demaille <akim@epita.fr>
6552
6553 Also warn about non-used mid-rule values.
6554 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
6555 member.
6556 (symbol_list_new): Adjust.
6557 * src/reader.c (symbol_typed_p): New.
6558 (grammar_rule_check): Use it.
6559 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
6560 Check its rule.
6561 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
6562 Use it.
6563 * tests/actions.at (Exotic Dollars): Adjust.
6564
378f4bd8
AD
65652006-01-04 Akim Demaille <akim@epita.fr>
6566
6567 * src/reader.c (grammar_midrule_action): If $$ is set in a
6568 mid-rule, move the `used' bit to its lhs.
6569 * tests/input.at (Unused values): New.
6570 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
6571
e2a21b6f
PE
65722006-01-03 Paul Eggert <eggert@cs.ucla.edu>
6573
54662697
PE
6574 * doc/bison.texinfo (Bison Options): Say more accurately what
6575 --yacc does.
6576 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
6577 about declarations in the grammar when in Yacc mode, as POSIX does
6578 not require a diagnostic when the grammar uses extensions.
6579
6580 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
6581
073f9288
PE
6582 Warn about dubious constructions like "%token T T".
6583 Reported by twlevo.
6584 * src/symtab.h (struct symbol.declared): New member.
6585 * src/symtab.c (symbol_new): Initialize it to false.
6586 (symbol_class_set): New arg DECLARING, specifying whether
6587 this is a declaration that we want to warn about, if there
6588 is more than one of them. All uses changed.
6589
1221b78a
PE
6590 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
6591 Allow multiple %union directives, whose contents concatenate.
6592 * src/parse-gram.y (grammar_declaration): Likewise.
6593 Use muscle_code_grow, so that we don't need stype_line any more.
6594 All uses changed.
6595
6596 * src/muscle_tab.c (muscle_grow): Fix comment.
6597
e2a21b6f
PE
6598 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
6599 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
6600 Update copyright year to 2006.
6601
8f7e3cf9
AD
66022006-01-03 Akim Demaille <akim@epita.fr>
6603
6604 Have glr.cc pass (some of) the calc.at tests.
6605 * data/glr.cc (b4_parse_param_orig): New.
6606 (b4_parse_param): Improve its definition, and bound it more
6607 clearly in the skeleton.
6608 (b4_epilogue): Append, instead of prepending, in order to keep
6609 #line consistency.
6610 Simplify the generation of auxiliary functions: locations and
6611 purity are mandated.
6612 (b4_global_tokens_and_yystype): Honor it.
6613 * data/location.cc (c++.m4): Don't include it.
6614 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
6615 and AT_SKEL_CC_IF.
6616 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
6617 AT_LALR1_CC_IF.
6618 Be sure to initialize the first position's filename.
6619 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
6620 mandated anyway.
6621 (AT_CHECK_CALC_GLR_CC): New.
6622 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
6623
3953ed88
AD
66242006-01-02 Akim Demaille <akim@epita.fr>
6625
6626 * src/output.c (output_skeleton): Don't hard wire the inclusion of
6627 c.m4.
0a96ba81 6628 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
6629 * data/glr.cc: Do not include stack.hh.
6630
9ecafbbf
AD
66312006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6632
6633 * data/glr.c: Reformat whitespace with tabs.
6634 (b4_lpure_formals): Remove this unused m4 macro.
6635 * tests/cxx-type.at: Reformat whitespace with tabs.
6636 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
6637 since it's a member. Rename type to isNterm for clarity.
6638
c4d497a0
AD
66392005-12-29 Akim <akim@sulaco.local>
6640
6641 Let glr.cc catch up with symbol_value_print.
6642 * data/glr.cc (b4_yysymprint_generate): Replace by...
6643 (b4_yy_symbol_print_generate): this.
6644 (yy_symbol_print, yy_symbol_value_print): Declare them.
6645
4517da37
PE
66462005-12-28 Paul Eggert <eggert@cs.ucla.edu>
6647
6648 * src/location.h (boundary): Note that a line or column equal
6649 to INT_MAX indicates an overflow.
6650 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
6651 (rule_length_overflow, increment_rule_length, add_column_width):
6652 New functions.
6653 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
6654 (<SC_BRACED_CODE>"}"):
6655 Use increment_rule_length rather than incrementing it by hand.
6656 (adjust_location, handle_syncline): Diagnose overflow.
6657 (handle_action_dollar, handle_action_at):
6658 Fix bug with monstrosities like $-2147483648.
6659 Remove now-unnecessary checks.
6660 (scan_integer): Verify assumptions and remove now-unnecessary checks.
6661 (convert_ucn_to_byte): Verify assumptions.
6662 (handle_syncline): New arg LOC. All callers changed.
6663 Don't store through a value derived from char const * pointer.
6664
6665 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
6666 GCC warnings.
6667
e3233bf6
PE
66682005-12-27 Paul Eggert <eggert@cs.ucla.edu>
6669
6670 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
6671 Remove unnecessary forward static decls.
6672
8f3596a6
AD
66732005-12-27 Akim Demaille <akim@epita.fr>
6674
6675 * src/reader.c (grammar_current_rule_check): Also check that $$
6676 is used.
6677 Take the rule to check as argument, hence rename as...
6678 (grammar_rule_check): this.
6679 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
6680 Rename as...
6681 (grammar_rule_begin, grammar_rule_end): these, for consistency.
6682 (grammar_midrule_action, grammar_symbol_append): Now static.
6683 * tests/torture.at (input): Don't rely on the default action
6684 being always performed.
6685 * tests/calc.at: "Set" $$ even when the action is "cut" with
6686 YYERROR or other.
6687 * tests/actions.at (Exotic Dollars): Instead of using unused
6688 values, check that the warning is issued.
6689
721be13c
PE
66902005-12-22 Paul Eggert <eggert@cs.ucla.edu>
6691
6692 * NEWS: Improve wording for unused-value warnings.
6693
a0af42fc
AD
66942005-12-22 Akim Demaille <akim@epita.fr>
6695
6696 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
6697 (b4_yysymprint_generate): Rename as...
6698 (b4_yy_symbol_print_generate): this.
6699 Generate yy_symbol_print instead of yysymprint.
6700 Generate also yy_symbol_value_print, and use it.
6701
affac613
AD
67022005-12-22 Akim Demaille <akim@epita.fr>
6703
721be13c 6704 * NEWS: Warn about unused values.
affac613
AD
6705 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
6706 a `used' member.
6707 (symbol_list_n_get, symbol_list_n_used_set): New.
6708 (symbol_list_n_type_name_get): Use symbol_list_n_get.
6709 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
6710 * src/reader.c (grammar_current_rule_check): Check that values are
6711 used.
6712 * src/symtab.c (symbol_print): Accept 0.
6713 * tests/existing.at: Remove the type information.
6714 Empty the actions.
6715 Remove useless actions (beware of mid-rule actions: perl -000
6716 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
6717 * tests/actions.at (Exotic Dollars): Use unused values.
6718 * tests/calc.at: Likewise.
6719 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6720 Likewise.
6721
6722 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
6723 rule_useful_p.
6724
9d9b8b70
PE
67252005-12-21 Paul Eggert <eggert@cs.ucla.edu>
6726
8bb4c753
PE
6727 Undo 2005-12-01 tentative license wording change. The wording is
6728 still being reviewed by the lawyers, and we don't want to wait for
6729 them before publishing a test release. For now, revert to the
6730 previous wording.
6731 * NEWS: Undo 2005-12-01 change.
6732 * data/glr.c: Revert to previous license wording.
6733 * data/glr.cc: Likewise.
6734 * data/lalr1.cc: Likewise.
6735 * data/location.cc: Likewise.
6736 * data/yacc.c: Likewise.
6737
9d9b8b70
PE
6738 * NEWS: Reword %destructor vs YYABORT etc.
6739 * data/glr.c: Use American spacing, for consistency.
6740 * data/glr.cc: Likewise.
6741 * data/lalr1.cc: Likewise.
6742 * data/yacc.c: Likewise.
6743 * data/yacc.c: Reformat comments slightly.
6744 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
6745 for consistency. Fix some spelling errors and reword recently-included
6746 text slightly.
6747 * tests/cxx-type.at: Cast results of malloc, for C++.
6748
2c3b392a
AD
67492005-12-21 Joel E. Denny <address@hidden>
6750
6751 * tests/cxx-type.at: Construct a tree, count the parents of shared
6752 nodes, and free each node once and only once. Previously, the memory
6753 for semantic values was leaked instead.
6754
d6cff4dc
AD
67552005-12-21 Joel E. Denny <address@hidden>
6756
6757 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
6758 (yylval, yylloc): If pure, #define to yystackp->yyval and
6759 yystackp->yyloc similar to yychar and yynerrs.
6760 (yyparse): If pure, remove local yylval and yylloc. Add local
6761 yystackp to accommodate pure definitions of yylval and yylloc.
6762 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
6763 yylvalp and yyllocp to &yylval and &yylloc.
6764 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
6765 namespace. Previously, nerrs and char were missing, but lval and lloc
6766 weren't necessary.
6767 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
6768 yylvalp and yyllocp parameters since, if pure, these are now always
6769 accessible through yystackp. If not pure, they are still accessible
6770 globally.
6771 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
6772 `if (YYID (N))' to pacify lint.
6773
a85284cf
AD
67742005-12-21 Akim Demaille <akim@epita.fr>
6775
6776 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
6777 destroy the RHS symbols of a rule.
6778 * data/yacc.c (yylen): Initialize to 0.
6779 Keep its value to the number of items to possibly shift.
6780 In particular, a regular successful parse that ends on YYFINAL by
6781 a (internal) YYACCEPT must not have yylen != 0.
6782 (yyerrorlab, yyreturn): Pop the RHS.
6783 Reorder a bit to emphasize the `shifting' bits of code.
6784 (YYPOPSTACK): Now accept a number of items to pop.
6785 * data/lalr1.cc: Likewise.
6786 * data/glr.c: Formatting changes.
6787 Use goto instead of fall through.
6788 * doc/bison.texinfo (Destructor Decl): Complete.
6789
d508c281
JMG
67902005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6791
6792 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6793 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
6794 * djgpp/config.bat: Replace every occurence of the file name
6795 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6796 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6797 * djgpp/config.sed: Replace every occurence of the file name
6798 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
6799 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
6800 * djgpp/djunpack.bat: DJGPP specific file.
6801 * djgpp/fnchange.lst: DJGPP specific file.
6802 * djgpp/README.in: Add new information about how to unpack the bison
6803 source on MSDOS and other systems which have 8.3 file name restrictions
6804 using djunpack.bat and fnchange.lst.
6805
3e7a2cd9
PE
68062005-12-12 Paul Eggert <eggert@cs.ucla.edu>
6807
6808 * bootstrap (build_cvs_prefix): Remove; unused.
6809 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
6810 when getting gnulib.
6811
68122005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
6813
6814 * data/glr.c: Reorder typedef declarations for structs to match order
6815 of struct declarations.
6816 Rename yystack everywhere to yystackp except in yyparse where it's not
6817 a pointer.
6818 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
6819 consistency.
6820 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
6821 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
6822 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
6823 lint.
6824
877519f8
PE
68252005-12-09 Paul Eggert <eggert@cs.ucla.edu>
6826
0eca5a39
PE
6827 * tests/sets.at (Accept): Fix typos in regular expression used to
6828 sed out the final state number.
6829
2cec9080
PE
6830 Work around portability problem on Solaris 10: flex-generated
6831 files include <stdio.h> before <config.h>, which messes up
6832 because the latter defines __EXTENSIONS__. Address the problem
6833 by creating two new little files that include <config.h> first,
6834 then include the flex-generated files. Rewrite everyone else
6835 to include <config.h> first, as well.
6836 * lib/timevar.c: Always include "config.h".
6837 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
6838 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
6839 (EXTRA_bison_SOURCES): New macro.
6840 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
6841 * src/system.h: Don't include config.h.
6842 * src/LR0.c: Include <config.h> first.
6843 * src/assoc.c: Likewise.
6844 * src/closure.c: Likewise.
6845 * src/complain.c: Likewise.
6846 * src/conflicts.c: Likewise.
6847 * src/derives.c: Likewise.
6848 * src/files.c: Likewise.
6849 * src/getargs.c: Likewise.
6850 * src/gram.c: Likewise.
6851 * src/lalr.c: Likewise.
6852 * src/location.c: Likewise.
6853 * src/main.c: Likewise.
6854 * src/muscle_tab.c: Likewise.
6855 * src/nullable.c: Likewise.
6856 * src/output.c: Likewise.
6857 * src/parse-gram.y: Likewise.
6858 * src/print.c: Likewise.
6859 * src/print_graph.c: Likewise.
6860 * src/reader.c: Likewise.
6861 * src/reduce.c: Likewise.
6862 * src/relation.c: Likewise.
6863 * src/state.c: Likewise.
6864 * src/symlist.c: Likewise.
6865 * src/symtab.c: Likewise.
6866 * src/tables.c: Likewise.
6867 * src/uniqstr.c: Likewise.
6868 * src/vcg.c: Likewise.
6869
877519f8
PE
6870 * src/parse-gram.y: Fix minor problems uncovered by lint.
6871 (current_lhs, current_lhs_location): Now static.
6872 (current_assoc): Remove unused variable.
6873
6874 Cleanups so that Bison-generated parsers have less lint.
6875 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
6876 Prepend /*ARGSUSED*/, for lint's sake.
6877 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
6878 definition if 'lint' is defined.
6879 (YYID): New macro (or function, if lint).
6880 All uses of /*CONSTCOND*/0 replaced by YYID(0).
6881 * data/yacc.c: Likewise.
6882 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
6883 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
6884 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
6885 is C++ only.
6886 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
6887 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
6888 Use YYID(0) rather than 0, for lint.
6889 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
6890 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
6891
f5228370
PE
68922005-12-07 Paul Eggert <eggert@cs.ucla.edu>
6893
6894 * tests/glr-regression.at
6895 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6896 Close memory leak reported by twlevo.
6897
69ce078b
PE
68982005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
6899
6ff99711
PE
6900 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
6901 all stacks.
6902 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
6903 * tests/glr-regression.at (No users destructors if stack 0 deleted):
6904 New test case.
6905 (Duplicated user destructor for lookahead): This test now is expected
6906 to succeed.
6907
af3412cd
PE
69082005-12-01 Paul Eggert <eggert@cs.ucla.edu>
6909
32b5b719 6910 * NEWS: Document the following change.
af3412cd
PE
6911 * data/yacc.c: Say "parser skeleton" rather than "file", since
6912 it's no longer just a file.
6913 * data/glr.c: Grant a special exception for C GLR parsers, that
6914 reads like the already-existing exception for C LALR(1) parsers.
6915 * data/glr.cc: Likewise.
6916 * data/lalr1.cc: Likewise.
6917 * data/location.cc: Likewise.
6918 * data/yacc.c: Reword the "written by" statement to clarify that
6919 it was the parser skeleton, not the entire output file.
6920 * data/glr.c: Written by Paul Hilfinger.
6921 * data/glr.cc: Written by Akim Demaille.
6922 * data/lalr1.cc: Likewise.
6923
035aa4a0
PE
69242005-11-18 Paul Eggert <eggert@cs.ucla.edu>
6925
d9963c85
PE
6926 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
6927 Fix typos in previous change that broke 'make check'.
6928 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
6929 supported in C.
6930 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
6931 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
6932 We can revert this once things settle down.
6933
035aa4a0
PE
6934 * src/conflicts.c (conflicts_print): Don't print file name twice
6935 when %expect fails because there were no conflicts.
6936 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
6937 change.
6938 * tests/conflicts.at (%expect not enough, %expect too much):
6939 (%expect with reduce conflicts): Adjust to new behavior.
6940
69412005-11-18 Akim Demaille <akim@epita.fr>
6942
6943 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
6944 errors.
6945 * NEWS: Document this.
6946 * doc/bison.texinfo (Expect Decl): Likewise.
6947
d1ff7a7c
AD
69482005-11-16 Akim Demaille <akim@epita.fr>
6949
6950 Generalize the display of semantic values and locations in traces.
6951 * data/glr.c (yy_reduce_print): Fix indices (again).
6952 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
6953 literal integers.
6954 * data/lalr1.cc (yyreduce_print): Rename as...
6955 (yy_reduce_print): this.
6956 Display values and locations.
6957 * data/yacc.c (yy_reduce_print): Likewise.
6958 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
6959 (yysymprint): Move higher to be visible from yy_reduce_print).
6960 (yyparse): Adjust.
6961 * tests/calc.at: Adjust the expected length of the traces.
6962
6de5398d
AD
69632005-11-14 Akim Demaille <akim@epita.fr>
6964
6965 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
6966 from 1 to N, while values and location start at 0.
6967 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
6968
a1373f55
AD
69692005-11-14 Akim Demaille <akim@epita.fr>
6970
6971 * data/glr.c (yy_reduce_print): Fix the $ number.
6972
613d8952
AD
69732005-11-14 Akim Demaille <akim@epita.fr>
6974
6975 "Use" parse parameters.
6976 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
6977 * data/glr.c, data/glr.cc: Use them.
6978 * data/glr.c (YYUSE): Have a C++ definition that supports
6979 non-pointer types.
6980
b2741627
AD
69812005-11-14 Akim Demaille <akim@epita.fr>
6982
6983 * data/glr.c (yyexpandGLRStack): Declare only if defined.
6984
5059b5c8
AD
69852005-11-14 Akim Demaille <akim@epita.fr>
6986
42249483
AD
6987 * data/glr.cc: New.
6988 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 6989
4626a15d
AD
69902005-11-12 Akim Demaille <akim@epita.fr>
6991
6992 Let position and location be PODs.
6993 * data/location.cc (position::initialize, location::initialize): New.
6994 (position::position, location::location): Define only if
6995 b4_location_constructors is defined.
6996 * data/lalr1.cc (b4_location_constructors): Define it for backward
6997 compatibility.
6998 * doc/bison.texinfo (Initial Action Decl): Use initialize.
6999
70002005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
7001
7002 * data/lalr1.cc: Move the body of the ctor and dtor into the
7003 parser file (instead of the header).
7004 Wrap the implementations in a "namespace yy".
7005
70062005-11-12 Akim Demaille <akim@epita.fr>
7007
7008 Have glr.c include its header file when created.
7009 * data/glr.c (b4_shared_declarations): New.
7010 Output them verbatim in the parser if !%defines, otherwise
7011 output then in the header file, and include it instead.
7012
1989d947
AD
70132005-11-11 Akim Demaille <akim@epita.fr>
7014
7015 * data/glr.c: Comment changes.
7016
70172005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
7018
7019 When yydebug, report semantic and location values for reductions.
7020 * data/glr.c (yy_reduce_print): Report the semantic values and the
7021 locations.
7022 (YY_REDUCE_PRINT): Adjust.
7023 (yyglrReduce): Use them.
7024 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7025 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7026 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7027 traces.
7028
02998094
AD
70292005-11-10 Akim Demaille <akim@epita.fr>
7030
7031 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7032 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7033 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7034
5210672f
PE
70352005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7036
7037 * m4/cxx.m4, examples/Makefile.am: Don't build
7038 examples/calc++ if no C++ compiler is available. (trivial change)
7039
a8991a1d
AD
70402005-11-09 Akim Demaille <akim@epita.fr>
7041
7042 * src/scan-skel.l: Use a couple of asserts.
7043
36b5e963
AD
70442005-11-03 Akim Demaille <akim@epita.fr>
7045
7046 In some (weird) cases, the final state number is incorrect.
7047 Reported by Alexandre Duret-Lutz.
7048 * src/LR0.c (state_list_append): Remove the computation of
7049 final_state.
7050 (save_reductions): Do it here.
7051 (get_state): Alpha conversion.
7052 (generate_states): Use a for loop.
7053 * src/gram.h (item_number_is_rule_number)
7054 (item_number_is_symbol_number): New.
7055 * src/state.c: Use assert.
7056 * src/system.h: Include assert.h.
7057 * tests/sets.at (Accept): New.
7058
44e7ead1
PH
70592005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7060
7061 * data/glr.c (yyfill): Adjust comment.
36b5e963 7062 (yyresolveAction): Initialize default location properly
44e7ead1
PH
7063 for empty right-hand sides.
7064 (yydoAction): Ditto.
7065 Add comment explaining apparently dead code.
36b5e963
AD
7066 * tests/glr-regression.at
7067 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 7068 New test.
36b5e963 7069
e10a80ee
PE
70702005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7071
7072 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7073 gnulib when interrupted. This fixes some race conditions and
7074 works around some portability problems (one noted by Paul
7075 Hilfinger).
7076
067b32ee
AD
70772005-10-22 Akim <akim@epita.fr>
7078
7079 * Makefile.cfg: Adjust to config -> build-aux.
7080 Reported by twledo.
7081
4b367315
AD
70822005-10-21 Akim Demaille <akim@epita.fr>
7083
7084 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7085 the %parse-params.
7086 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7087 * data/yacc.c (b4_Pure_if): Rename as...
7088 (b4_yacc_pure_if): this.
7089 (YY_SYMBOL_PRINT, yyparse): Adjust.
7090 * doc/bison.texinfo: Formatting changes.
7091
24cc23d9
AD
70922005-10-21 Akim Demaille <akim@epita.fr>
7093
7094 Finish the transition config -> build-aux.
7095 * configure.ac, Makefile.am: Use build-aux.
7096 * config/prev-version, config/announce-gen, config/Makefile.am:
7097 Move to...
7098 * build-aux/prev-version, build-aux/announce-gen,
7099 * build-aux/Makefile.am: here.
7100
d4476375
AD
71012005-10-14 Akim Demaille <akim@epita.fr>
7102
7103 * examples/calc++/test: Use set -x only when VERBOSE.
7104
302c0aee
PE
71052005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7106
7107 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7108 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7109
7625ec2c
AD
71102005-10-13 Akim Demaille <akim@epita.fr>
7111
7112 * src/scan-skel.l: Output the base name parts of the parser and
7113 header file names.
302c0aee 7114 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
7115 additional checks.
7116 Use this to exercise C++ outputs in subdirs.
7117 Reported by Oleg Smolsky.
7118
ba0fe3c7
PE
71192005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7120
7121 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7122 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7123 Problem reported by John P. Hartmann.
7124 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7125 already defined it.
7126
9b8a5ce0
AD
71272005-10-12 Akim Demaille <akim@epita.fr>
7128
7129 * src/parse-gram.y (version_check): Exit 63 to please missing
7130 (stands for "version mismatch).
7131 * tests/input.at, doc/bison.texinfo: Adjust.
7132
4f6e011e
PE
71332005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7134
7135 Work around portability problems with Visual Age C compiler
7136 (xlc and xlC_r) reported by John P. Hartmann.
7137 * data/location.cc (initial_column, initial_line): Remove.
7138 All uses replaced by 0 and 1.
7139 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7140 that xlc complains about.
7141 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 7142 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 7143 as __STDC__.
4d7aa45e
PE
7144 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7145 __STDC_VERSION__. Use it everywhere instead of looking at
7146 __STDC__ and __cplusplus.
4f6e011e 7147
a1b3bf8c
AD
71482005-10-10 Akim Demaille <akim@epita.fr>
7149
7150 * examples/calc++/test: Be quiet unless VERBOSE.
7151
412e44aa
PE
71522005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7153
2a4647a3
PE
7154 * data/c.m4 (yydestruct, yysymprint):
7155 Use YYUSE instead of casting to void.
7156 * data/glr.c (YYUSE): New macro.
7157 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7158 Use it instead of rolling our own.
7159 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7160 (YYCHK1):
7161 Use /*CONSTCOND*/ to suppress lint warnings.
7162 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7163 (YY_STACK_PRINT): Use 'false' not '0'.
7164 (YYUSE): New macro.
7165 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7166 * data/yacc.c (YYUSE): New macro.
7167 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7168 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7169 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7170
7171
412e44aa
PE
7172 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7173 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7174
88c6637f
PE
71752005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7176
2f4f028d
PE
7177 Undo the parts of the unlocked-I/O change that substituted
7178 putc or puts for printf. This might hurt performance a bit,
7179 but some people prefer the printf style.
7180 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7181 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7182 All uses replaced by YYFPRINTF and YYDPRINTF.
7183 * data/yacc.c: Likewise.
7184 * lib/bitset.c (bitset_print): Likewise.
7185 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7186 putc and puts.
7187 * lib/lbitset.c (debug_lbitset): Likewise.
7188 * src/closure.c (print_firsts, print_fderives): Likewise.
7189 * src/gram.c (grammar_dump): Likewise.
7190 * src/lalr.c (look_ahead_tokens_print): Likewise.
7191 * src/output.c (escaped_output): Likewise.
7192 (user_actions_output): Break apart two printfs.
7193 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7194 * src/reduce.c (reduce_print): Likewise.
7195 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7196 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7197
88c6637f
PE
7198 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7199 Use assignments rather than casts-to-void to suppress
7200 unused-variable warnings. This pacifies 'lint'.
7201 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7202 unused-variable warnings.
7203
fb32e373
JMG
72042005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7205
7206 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7207
edb8f44f
PE
72082005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7209
fb9c0b33
PE
7210 Use unlocked I/O for a minor performance improvement on hosts like
7211 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7212 is to use the gnlib unlocked-io module, and to prefer putc and
7213 puts to printf when either will work (since the latter doesn't
7214 come in an unlocked flavor).
7215 * bootstrap (gnulib_modules): Add unlocked-io.
7216 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7217 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7218 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7219 and similarly for puts and putc and printf.
7220 * data/yacc.c: Likewise.
7221 * lib/bitset.c (bitset_print): Likewise.
7222 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7223 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7224 to printf.
7225 * lib/lbitset.c (debug_lbitset): Likewise.
7226 * src/closure.c (print_firsts, print_fderives): Likewise.
7227 * src/gram.c (grammar_dump): Likewise.
7228 * src/lalr.c (look_ahead_tokens_print): Likewise.
7229 * src/output.c (escaped_output): Likewise.
7230 (user_actions_output): Coalesce two printfs.
2f4f028d 7231 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
7232 * src/reduce.c (reduce_print): Likewise.
7233 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 7234 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 7235
edb8f44f
PE
7236 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7237 this confuses xgettext.
7238
b50d2359
AD
72392005-10-02 Akim Demaille <akim@epita.fr>
7240
7241 * bootstrap (gnulib_modules): Add strverscmp.
7242 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7243 * m4/.cvsignore: Add strverscmp.m4.
7244 * src/parse-gram.y (%require): New token, new rule.
7245 (version_check): New.
7246 * src/scan-gram.l (%require): Adjust.
7247 * tests/input.at (AT_REQUIRE): New.
7248 Use it.
7249 * doc/bison.texinfo (Require Decl): New.
7250 (Calc++ Parser): Use %require.
7251
21667f64
AD
72522005-10-02 Akim Demaille <akim@epita.fr>
7253
7254 * data/location.cc: New.
7255
2b81e969
AD
72562005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7257 Akim Demaille <akim@epita.fr>
7258
7259 Make sure -odir/foo.cc creates dir/location.hh etc.
7260 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7261 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7262 (spec_defines_file): Now const.
7263 (dir_prefix): New.
7264 (short_base_name): Remove.
7265 * src/files.c: Adjust.
7266 (dirname.h): Include.
7267 (base_name): Don't prototype it.
7268 (finput): Remove, duplicates gram_in.
7269 (full_base_name, short_base_name): Replace by...
7270 (all_but_ext, all_but_tab_ext): these.
7271 (compute_base_names): Rename as...
7272 (compute_file_name_parts): this.
7273 Update to compute the new variables, including dir_prefix.
7274 Adjust dependencies.
7275 * src/output.c (prepare): Output them.
7276 * src/reader.c: Adjust to use gram_in, not finput.
7277 * src/scan-skel.l (@dir_prefix@): New.
7278
ad6a9b97
JMG
72792005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7280
7281 * lib/subpipe.c: New function end_of_output_subpipe() added
7282 to allow support for non-posix systems. This is a no-op function
7283 for posix systems.
7284
7285 * lib/subpipe.h: New function end_of_output_subpipe() added
7286 to allow support for non-posix systems. This is a no-op function
7287 for posix systems.
7288
7289 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7290 handle the lack of pipe/fork functionality on non-posix systems.
7291
7292 * djgpp/Makefile.maint: DJGPP specific file.
7293
7294 * djgpp/README.in: DJGPP specific file.
7295
7296 * djgpp/config.bat: DJGPP specific configuration file.
7297
7298 * djgpp/config.sed: DJGPP specific configuration file.
7299
7300 * djgpp/config.site: DJGPP specific configuration file.
7301
7302 * djgpp/config_h.sed: DJGPP specific configuration file.
7303
7304 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
7305
7306 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
7307
fc695704
AD
73082005-10-02 Akim Demaille <akim@epita.fr>
7309
7310 * data/location.cc: New, extract from...
7311 * data/lalr1.cc: here.
7312 (location.hh): Include it after the user prologue, in case the
7313 filename type is defined by the user.
7314 Forward declation location and position before the pre-prologue.
7315 (yyresult_): Rename as...
7316 (yyresult): this, it's a local variable, not an attribute.
7317 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
7318
73192005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
7320
7321 * examples/extexi: Restore the #line generation.
7322
fb9712a9
AD
73232005-09-30 Akim Demaille <akim@epita.fr>,
7324 Alexandre Duret-Lutz <adl@gnu.org>
7325
7326 Move the token type and YYSTYPE in the parser class.
7327 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
7328 (parser::token): New, from the moved free definition of tokens.
7329 (parser::semantic_value): Now a full definition instead of an
7330 indirection to YYSTYPE.
7331 (b4_post_prologue): No longer included in the header file, but
7332 in the implementation file.
7333 * doc/bison.texi (C+ Language Interface): Update.
7334 * src/parse-gram.y: Support unary %define.
7335 * tests/actions.at: Define global_tokens_and_yystype for backward
7336 compatibility until we update the tests.
7337 * tests/calc.at: Idem.
7338 (first_line, first_column, last_line, last_column): Define for lalr1.cc
7339 to simplify the code.
7340
55f0c7b1
PE
73412005-09-29 Paul Eggert <eggert@cs.ucla.edu>
7342
7343 Port to SunOS 4.1.4, which lacks strtoul and strerror.
7344 Ah, the good old days! Problem reported by Peter Klein.
7345 * bootstrap (gnulib_modules): Add strerror, strtoul.
7346 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
7347 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
7348
fb9712a9 73492005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
7350
7351 * data/c.m4 (b4_error_verbose_if): New.
7352 * data/lalr1.cc: Use it.
7353 (YYERROR_VERBOSE_IF): Remove.
7354 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
7355 parser members, replaced by...
7356 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
7357 local variables.
7358 (yysyntax_error_): Takes the state number as argument.
7359 (yyreduce_print_): Use the argument yyrule, not the former
7360 attribute yyn_.
7361
8a6f72f3
PE
73622005-09-26 Paul Eggert <eggert@cs.ucla.edu>
7363
7364 * bootstrap (gnulib_modules): Add verify.
7365 * lib/.cvsignore: Add verify.h.
7366 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
7367 * src/system.h (verify): Remove.
7368 Include verify.h instead.
7369 * src/tables.c (tables_generate): Use new API for 'verify'.
7370
0d50976f
PE
73712005-09-21 Paul Eggert <eggert@cs.ucla.edu>
7372
ebc3737e
PE
7373 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
7374 local variables whose names begin with 'yy'.
7375 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7376 Trivial changes from Joel E. Denny.
7377
0d50976f
PE
7378 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
7379 it itself.
7380 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
7381 don't use alloca any more.
7382
7383 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
7384 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 7385 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
7386 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
7387 to match yacc.c, to test more hosts.
7388
a05b79df
PE
73892005-09-20 Paul Eggert <eggert@cs.ucla.edu>
7390
55289366
PE
7391 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
7392 doesn't affect behavior.
7393 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
7394 Solaris, AIX, MSC.
7395 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
7396 This works a bit better with glibc, if user code has already included
7397 stdlib.h.
7398 * doc/bison.texinfo (Bison Parser): Document that users can't
7399 arbitrarily use malloc and free for other purposes. Document
7400 that <alloca.h> and <malloc.h> might be included.
7401 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
7402 user must declare alloca.
7403
a05b79df
PE
7404 * HACKING (release): Forwarn the Translation Project about
7405 stable releses.
7406
3ab2ca22
AD
74072005-09-20 Akim Demaille <akim@epita.fr>
7408
7409 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
7410
a9739e7c
PE
74112005-09-19 Paul Eggert <eggert@cs.ucla.edu>
7412
a702593e
PE
7413 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
7414 (YYSTACK_ALLOC_MAXIMUM): Use it.
7415 (yysyntax_error): New function.
7416 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
7417 multiple syntax errors are reported, and alloca is being used.
7418 Instead, reallocate buffers twice as big each time, so that
7419 we waste at most half the allocated memory. Start with a small
7420 (128-byte) buffer that will suffice in most cases anyway.
7421 Use yysyntax_error to do most of the work.
7422
7423 * doc/bison.texinfo (Error Reporting, Table of Symbols):
7424 yynerrs is the number of errors reported, not the number of
7425 errors encountered.
7426
a9739e7c
PE
7427 * tests/glr-regression.at (Duplicated user destructor for lookahead):
7428 Mark it as expected to fail.
7429 Cast result of malloc; problem reported by twlevo@xs4all.nl.
7430 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
7431 Don't start user-code symbols with "yy", to avoid name space problems.
7432
f479c6c6
AD
74332005-09-19 Akim Demaille <akim@epita.fr>
7434
7435 Remove the traits, failed experiment.
7436 It never proved useful, and anyway because of the current
7437 definition, it was not possible to have several specialization of
7438 this traits, making it useless.
7439 * data/lalr1.cc (yy:traits): Remove.
7440 Inline its definitions in the parser class.
7441
e2586f82
AD
74422005-09-19 Akim Demaille <akim@epita.fr>
7443
7444 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
7445 least Mac OSX with a /usr/local install of gettext.
7446
2e8cf949
AD
74472005-09-19 Akim Demaille <akim@epita.fr>
7448
7449 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
7450 and yytoken for similarity with the other skeletons.
7451
c7fb0b90
AD
74522005-09-19 Akim Demaille <akim@epita.fr>
7453
4e26c69e 7454 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 7455
1bd0deda
PE
74562005-09-16 Paul Eggert <eggert@cs.ucla.edu>
7457
7458 * NEWS: Version 2.1.
7459
7460 * NEWS: Remove notice of yytname change, since it was never in an
7461 official release.
7462 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
7463 diagnostic.
7464 * src/output.c (prepare): Likewise.
7465 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
7466 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
7467 is not defined. This is an awful hack, but it's enough for now.
7468 All callers changed.
7469 * tests/glr-regression-at (make_value): Args are const pointers now,
7470 to avoid GCC warning.
7471 (Duplicated user destructor for lookahead): New test. Currently
7472 skipped. It fails on my host but I'm not sure it'll always fail.
7473
74742005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
7475
7476 * src/symtab.h (struct symbol): Declare the printer and destructor
7477 as const, to avoid accidental calls to free.
7478 (symbol_destructor_set, symbol_printer_set): Adjust.
7479 * src/symtab.c: Adjust.
7480
1bd0deda 74812005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
7482
7483 * data/c.m4 (b4_token_enums): New.
7484 (b4_token_defines): Rename as...
7485 (b4_token_enums_defines): this.
7486 (b4_token_defines): New, output only the #defines.
7487 * data/yacc.c, data/glr.c: Adjust.
7488 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
7489 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
7490 as default values.
7491
dbcdae2d
AD
74922005-09-16 Akim Demaille <akim@epita.fr>
7493
7494 * data/lalr1.cc (yylex_): Remove, inline its code.
7495 (yyreport_syntax_error_): Remove, replaced by...
7496 (yysyntax_error_): this which returns a string and leaves to the
7497 caller the call to the users' error function.
7498 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
7499 Move from members of the parser object...
7500 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
7501 to local variables of the parse function.
7502
70d8f291
AD
75032005-09-16 Akim Demaille <akim@epita.fr>
7504
7505 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
7506 since it's in Bison's name space.
7507
b47dbebe
PE
75082005-09-15 Paul Eggert <eggert@cs.ucla.edu>
7509
ae199bf1
PE
7510 * data/glr.c (yyresolveValue): Add default case to pacify
7511 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
7512
b47dbebe
PE
7513 * NEWS: Document when yyparse started to return 2.
7514 * doc/bison.texinfo (Parser Function): Document when yyparse
7515 returns 2.
7516
7517 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
7518 (b4_filename_type): Renamed back from b4_file_name_type. All uses
7519 changed.
7520 (class position): file_name -> filename (reverting). All uses changed.
7521
75222005-09-14 Paul Eggert <eggert@cs.ucla.edu>
7523
7524 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
7525 do anything if $@ exists. This reverts part of the 2005-07-07
7526 patch.
7527
00292f66
PE
75282005-09-11 Paul Eggert <eggert@cs.ucla.edu>
7529
7530 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
7531 contains obsolete information and isn't worth distributing as a
7532 separate file anyway.
7533 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
7534 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
7535 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
7536 (yyparse): Abort if user code uses longjmp to throw an unexpected
7537 value.
7538
a420f962
PE
75392005-09-09 Paul Eggert <eggert@cs.ucla.edu>
7540
00292f66
PE
7541 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
7542 Suggested by twlevo@xs4all.nl.
7543
127287e9
PE
7544 * data/glr.c (YYCHK1): Do not assume YYE is in range.
7545 This avoids a diagnostic from gcc -Wswitch-enum.
7546 Problem reported by twlevo@xs4all.nl.
7547
a420f962
PE
7548 * doc/bison.texinfo: Don't use "filename", as per GNU coding
7549 standards. Use "file name" or "file" or "name", depending on
7550 the context.
7551 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
7552 not to hack/foo.tab.c.
7553 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
7554 * data/glr.c: b4_filename -> b4_file_name.
7555 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
7556 All uses changed.
7557 (class position): filename -> file_name. All uses changed.
7558 * data/yacc.c: b4_filename -> b4_file_name.
7559 * lib/bitset.h: filename -> file_name in local vars.
7560 * lib/bitset_stats.c: Likewise.
7561 * src/files.c: Likewise.
7562 * src/scan-skel.l ("@output ".*\n): Likewise.
7563 * src/files.c (file_name_split): Renamed from filename_split.
7564 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
7565
75662005-09-08 Paul Eggert <eggert@cs.ucla.edu>
7567
7568 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
7569 to accommodate latest gnulib.
7570
7571 * tests/glr-regression.at (Duplicate representation of merged trees):
7572 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
7573
7574 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
7575 needed.
7576
42a6501d
PE
75772005-08-26 Paul Eggert <eggert@cs.ucla.edu>
7578
7579 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
7580 All uses changed. Invoke user destructor after an error during a
7581 split parse (trivial change from Joel E. Denny).
7582
7583 * tests/glr-regression.at
7584 (User destructor after an error during a split parse): New test case.
7585 Problem reported by Joel E. Denny in:
7586 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
7587
ef9a1faf
PE
75882005-08-25 Paul Eggert <eggert@cs.ucla.edu>
7589
5b4aaf78
PE
7590 * README-cvs: Give URLs for recommended tools.
7591 Mention Gzip version problem, and bootstrapping issues.
7592 Remove troubleshooting section, as it's somewhat obsolete.
7593
b5240ba5
PE
7594 * bootstrap (no_cache): New var, to accommodate different wget
7595 variants. Use it instead of '-C off'. Problem reported by
7596 twlevo@xs4all.nl.
7597
ef9a1faf
PE
7598 * data/glr.c (yydestroyStackItem): New function.
7599 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
7600 debugging information. Problem reported by Joel E. Denny.
7601
e6efa9da
AD
76022005-08-25 Akim Demaille <akim@epita.fr>
7603
7604 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
7605
adc90f13
PE
76062005-08-24 Paul Eggert <eggert@cs.ucla.edu>
7607
7608 * data/glr.c (yyrecoverSyntaxError, yyreturn):
7609 Don't invoke destructor on unresolved entries.
7610 * tests/glr-regression.at
7611 (User destructor for unresolved GLR semantic value): New test case.
7612 Problem reported by Joel E. Denny in:
7613 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
7614
f9315de5
PE
76152005-08-21 Paul Eggert <eggert@cs.ucla.edu>
7616
15d29c1f
PE
7617 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
7618 Add strnlen.c.
7619 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
7620 lib-prefix.m4, po.m4.
7621
dd5f2af2
PE
7622 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
7623 in yydestruct diagnostic, since it might not be an error.
7624 Problem reported by Joel Denny near end of
7625 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 7626 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
7627 * data/yacc.c (yyreturn): Likewise.
7628 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
7629
7630 * src/files.c: Remove obsolete FIXME comment.
7631
7632 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
7633 with the other templates, and to fix bogus run-on messages such
7634 as the one reported at the end of
7635 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
7636 All callers changed to avoid the newline.
7637 (yyprocessOneStack): Output two lines rather than one, to accommodate
7638 the above change. This changes the debug output format slightly.
7639
f9315de5
PE
7640 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
7641 reported by Joel E. Denny in
7642 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
7643 (trivial change).
7644 * tests/glr-regression.at (Duplicate representation of merged trees):
7645 New test, from Joel E. Denny in:
7646 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
7647 * THANKS: Add Joel E. Denny.
7648
7649 * configure.ac (AC_INIT): Bump to 2.0c.
7650
04098407
PE
76512005-07-24 Paul Eggert <eggert@cs.ucla.edu>
7652
7653 * NEWS: Version 2.0b.
7654
ca5d2013
PE
7655 * Makefile.am (SUBDIRS): Put examples before tests, so that
7656 "make check" doesn't finish with "All 1 tests passed".
7657
3d54b576
PE
7658 * tests/regression.at (Token definitions): Don't rely on
7659 AT_PARSER_CHECK for data that contains backslashes. It currently
7660 uses 'echo', and 'echo' isn't portable if its argument contains
7661 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
7662 that the byte '\0xff' is not printable in the C locale; it is,
7663 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
7664 not printable, so use '\0x81' to test.
7665
d53ae497
PE
7666 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
7667 version of GCC, since the macro is used with non-GCC compilers.
7668
fc01665e
PE
7669 Fix core dump reported by Pablo De Napoli in
7670 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
7671 * tests/regression.at (Invalid inputs with {}): New test.
7672 * src/parse-gram.y (token_name): Translate type before using
7673 it as an index.
7674
04098407
PE
7675 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
7676 the user's name space. All uses changed to __attribute__
7677 ((__unused__)).
7678 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
7679 Add __attribute__ ((__noreturn__)).
7680
7681 * etc/clcommit: Remove. We weren't using it, and it failed
7682 "make maintainer-distcheck".
7683 * Makefile.maint: Merge from coreutils.
7684 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
7685 (syntax-check-rules): Change list of rules as described below.
7686 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
7687 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
7688 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
7689 (sc_trailing_space): New rules.
7690 (sc_xalloc_h_in_src): Remove.
7691 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
7692 (sc_space_tab, sc_error_exit_success, sc_changelog):
7693 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
7694 (makefile-check, po-check, author_mark_check):
7695 (makefile_path_separator_check, copyright-check):
7696 Use grep -n, to make it easier to find violations.
7697 Use CVS_LIST and CVS_LIST_EXCEPT.
7698 (header_regexp, h_re): Remove.
7699 (dd_c): New macro.
7700 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
7701 (my-distcheck): Use more-modern GCC flags.
7702 (signatures, %.asc): Remove.
7703 (rel-files, announcement): Remove signatures.
7704 Restore old updating code, even though we don't use it, so
7705 that we're the same as coreutils.
7706 (alpha, beta, major): Depend on news-date-check.
7707 Make the upload commands.
7708
7709 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
7710 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
7711 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
7712 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
7713 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
7714 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
7715 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
7716 * tests/sets.at: Likewise.
7717
7718 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
7719 we comment out the Autoconf version number.
7720 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
7721 it's error-prone and "make maintainer-distcheck" rejects it.
7722
7723 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
7724 Indent calls to "error" to pacify "make maintainer-distcheck",
7725 when the calls are not intended to be translated.
7726 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
7727
7728 * src/Makefile.am (DEFS): Use +=, to pacify
7729 "make maintainer-distcheck".
7730 (bison_SOURCES): Add scan-skel.h.
7731 (sc_tight_scope): New rule, from coreutils.
7732
7733 * src/files.c (src_extension, header_extension):
7734 Now static, not extern.
7735 * src/getargs.c (short_options): Likewise.
7736 * src/muscle_tab.c (muscle_table): Likewise.
7737 * src/parse-gram.y (current_class, current_type, current_prec):
7738 Likewise.
7739 * src/reader.c (grammar_end, previous_rule_end): Likewise.
7740 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
7741 * src/main.c (main): Cast bindtextdomain and textdomain calls to
7742 void, to avoid warning when NLS is disabled.
7743 * src/output.c: Include scan-skel.h.
7744 (scan_skel): Remove decl, since scan-skel.h does this.
7745 (output_skeleton):
7746 Indent calls to "error" to pacify "make maintainer-distcheck".
7747 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
7748 * src/reader.h (gram_end, gram_lineno): New decls to pacify
7749 "make maintainer-distcheck".
7750 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
7751 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
7752 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
7753 (skel_lex_destroy, scan_skel): Move these decls to...
7754 * src/scan-skel.h: New file.
7755 * src/uniqstr.c (uniqstr_assert):
7756 Indent calls to "error" to pacify "make maintainer-distcheck".
7757
7758 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
7759 not @VAR@.
7760
7761 * tests/torture.at: Revamp to avoid misuse of atoi that
7762 "make maintainer-distcheck" complained about.
7763
7764 * examples/extexi (message): Don't print a message more than once,
7765 and omit line-number decoration that makes Emacs compile think
7766 that informative messages are worth worrying about.
7767
77682005-07-22 Paul Eggert <eggert@cs.ucla.edu>
7769
7770 * configure.ac: Update version number.
7771
7772 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
7773 accidentally.
7774 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
7775 autogenerated by the maintainer.
7776 * examples/calc++/.cvsignore: Add *.yy.
7777
7778 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
7779 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7780 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7781
7782 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
7783
7784 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
7785 from maintainer-distcheck about casting the argument of 'free'.
7786
7787 * NEWS: Mention recent yytname changes.
7788 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
7789
7790 * bootstrap: For translations that have not yet been upgraded to
7791 the new runtime-po domain, prime the pump by extracting the
7792 relevant strings from the obsolete translations. This code can be
7793 removed once the bison-runtime domain has been translated by each
7794 team.
7795
7796 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
7797 now that token names are already quoted.
7798
7799 Fix problem reported by Anthony Heading.
7800 * data/glr.c (YYTOKEN_TABLE): New macro.
7801 (yytname): Define if YYTOKEN_TABLE.
7802 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
7803 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
7804 (YYERROR_VERBOSE): Define the same way the other skeletons do.
7805 * src/output.c (prepare_symbols): Output token_table_flag.
7806
0ffda363
PE
78072005-07-21 Paul Eggert <eggert@cs.ucla.edu>
7808
7809 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
7810 again if the first call fails.
7811
7812 * data/glr.c (yytnamerr): New function.
7813 (yyreportSyntaxError): Use it to dequote most string literals.
7814 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
7815 with other skeletons. All uses changed.
7816 (yytnameerr_): New function.
7817 (yyreport_syntax_error): Use it to dequote most string literals.
7818 * data/yacc.c (yytnamerr): New function.
7819 (yyerrlab): Use it to decode most string literals.
7820 * doc/bison.texinfo (Decl Summary, Calling Convention):
7821 Clarify quoting convention of yytname.
7822 * src/output.c (prepare_symbols): Quote all names. This undoes
7823 the 2005-04-17 change, which is now accomplished (mostly) via
7824 changes in the parsers as described above.
7825 * tests/regression.at (Token definitions, Web2c Actions):
7826 Undo most 2005-04-17 change here, too.
7827
78282005-07-20 Paul Eggert <eggert@cs.ucla.edu>
7829
7830 Fix more problems reported by twlevo@xs4all.nl.
7831 * tests/cxx-type.at: Don't pipe output of ./types through sed to
7832 remove trailing spaces. This loses the exit status of ./types,
7833 and isn't needed since ./types shouldn't be emitting trailing
7834 spaces.
7835 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
7836 as the stack isn't valid in that case.
7837
7838 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
7839 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
7840 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
7841 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
7842 is used.
7843 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
7844 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7845 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7846 Likewise.
7847
7848 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
7849 overly-picky compilers that reject 'char *foo = "bar";'.
7850
7851 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
7852 to FILE * parameter, not to stderr. This fixes a typo introduced
7853 in the 2005-07-12 change.
7854
7855 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
7856 warnings from GCC 4.
7857
7858 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
7859 (yyglrShiftDefer, yysplitStack):
7860 Remove unused parameters b4_pure_formals. All uses changed.
7861 (yyglrShift): Remove unused parameters b4_user_formals.
7862 All uses changed.
7863 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
7864
6100a9aa
PE
78652005-07-18 Paul Eggert <eggert@cs.ucla.edu>
7866
258b75ca
PE
7867 Destructor cleanups and regularization among the three skeletons.
7868 * NEWS: Document the behavior changes.
7869 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
7870 stack before failing, as the cleanup code will do it for us now.
7871 * data/lalr1.cc (yyerrlab): Likewise.
7872 * data/glr.c (yyparse): Pop everything off the stack before
7873 freeing it, so that destructors get called properly.
7874 * data/lalr1.cc (yyreturn): Likewise.
7875 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
7876 This is more consistent.
7877 * doc/bison.texinfo (Destructor Decl): Mention more reasons
7878 why destructors might be called. 1.875 -> 2.1.
7879 (Destructor Decl, Decl Summary, Table of Symbols):
7880 Some English-language cleanups for %destructor.
7881 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7882 Add output line for destructor of start symbol.
7883 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
7884 because of that same extra output line.
7885
1a059451
PE
7886 * NEWS: Document minor wording changes in diagnostics of
7887 Bison-generated parsers.
7888 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
7889 Remove unused formals. All uses changed.
7890 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
7891 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
7892 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
7893 Rename yyoverflowab to yyexhaustedlab.
7894 When memory exhaustion occurs during syntax-error reporting,
7895 report it separately rather than in a single diagnostic; this
7896 eases translation.
7897 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
7898 (Memory Exhausted): Renamed from Parser Stack Overflow.
7899 Revamp wording slightly to prefer "memory exhaustion".
7900 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
7901
97460c78
PE
7902 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
7903
30757c8c
PE
7904 Add i18n support to the GLR skeleton. Partially fix the C++
7905 skeleton; a C++ expert needs to finish this. Remove debugging
7906 msgids; there's little point to having them translated, since they
7907 can be understood only by someone who can read the
7908 (English-language) source code.
7909
7910 Generate runtime-po/bison-runtime.pot automatically, so that we
7911 don't have to worry about garbage getting in that file. We'll
7912 make sure after the next official release that old msgids don't
7913 get lost. See
7914 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
7915
7916 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
7917 Now auto-generated.
7918 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
7919 Fix typos in explanations of the runtime file.
7920 * bootstrap: Change gettext keyword from YYI18N to YY_.
7921 Use standard Makefile.in.in in runtime-po, since we'll arrange
7922 for backward-compatible bison-runtime.po files in a different way.
7923 * data/glr.c (YY_): New macro, from yacc.c.
7924 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
7925 Translate messages intended for users.
7926 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
7927 the wording in the other skeletons. We don't know that the memory
7928 is virtual.
7929 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
7930 Use same method that yacc.c uses.
7931 Don't translate debugging messages.
7932 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
7933 it doesn't work (yet), and requires C++ expertise to fix.
7934 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
7935 Move defn to a more logical place, to be consistent with other
7936 skeletons.
7937 Don't translate debugging messages.
7938 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
7939 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
7940 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
7941 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
7942
ac8c5689
PE
7943 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
7944 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
7945 void, not int.
7946 * tests/glr-regression.at (Badly Collapsed GLR States):
7947 Likewise.
7948 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7949 yylex should return 0 at EOF rather than aborting.
7950
6100a9aa
PE
7951 Improve tests for stack overflow in GLR parser.
7952 Problem reported by twlevo@xs4all.nl.
7953 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
7954 All uses removed.
7955 (yyStackOverflow): Just longjmp, but with value 2 so that caller
7956 can handle the problem.
7957 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
7958 (yyparse): New local variable yyresult to record the result.
7959 Use result of setjmp to set it, rather than storing itinto
7960 struct.
7961 (yyDone): Remove label.
7962 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
7963 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
7964 if YYABORT is used).
7965 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
7966 yyparse status; put status > 1 into diagnostic.
7967 Check that status==2 works.
7968 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
7969 Use exit status 3 for failure to open (which shouldn't happen).
7970
15f40952
PE
79712005-07-17 Paul Eggert <eggert@cs.ucla.edu>
7972
67fd79c4
PE
7973 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
7974 1 on syntax error; just let yyparse do its thing.
7975 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
7976 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
7977 (Exploding the Stack Size with Alloca):
7978 (Exploding the Stack Size with Malloc):
7979 Expect exit status 2, not 1, since the parser is supposed to blow
7980 its stack. Problem reported by twlevo@xs4all.nl.
7981
15f40952
PE
7982 * data/glr.c (yyparse): Don't assume that the initial calls
7983 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
7984 Print a stack-overflow message and fail instead.
7985 Initialize the line-number information before creating the stack,
7986 so that the stack-overflow message can report line zero safely.
7987
f32c66b5
PE
79882005-07-14 Paul Eggert <eggert@cs.ucla.edu>
7989
a22ff96f 7990 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
7991 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
7992 (yyuserMerge): Provide a default case if b4_mergers is empty.
7993 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
7994 * tests/glr-regression.at
7995 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 7996 Add casts to pacify C++ compilers.
1beb0b24
PE
7997 * tests/glr-regression.at (Improper merging of GLR delayed action
7998 sets): Declare yylex before using it.
f32c66b5 7999 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
8000 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8001 test for valgrind; valgrind is independent of g++.
8002 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8003 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8004 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8005 Use a destructor, so that we can expand the stack. Change
8006 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 8007
d741bd1b
PE
80082005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8009
8010 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8011 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8012
0410a6e0
PE
80132005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8014
8015 * PACKAGING: New file, suggested by Bruno Haible and taken from
8016 similar wording in gettext's PACKAGING file.
8017 * NEWS: Mention PACKAGING.
8018 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8019
f7ab6a50
PE
80202005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8021
baf785db 8022 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
8023 * bootstrap: Get runtime translations into runtime-po.
8024 Create runtime-po files automatically, if possible.
8025 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8026 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8027 does not infringe on the user's name space.
8028 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8029 * doc/bison.texinfo (Internationalization): Revamp the English
8030 and Texinfo syntax a bit, to try to make it clearer.
8031 (Bison Options, Option Cross Key): Mention --print-localedir.
8032 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8033 YYENABLE_NLS. Quote a bit more.
8034 * runtime-po/.cvsignore: New file.
8035 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8036 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8037 * runtime-po/quot.sed: Likewise.
8038 * runtime-po/boldquot.sed: Likewise.
8039 * runtime-po/en@quot.header: Likewise.
8040 * runtime-po/en@boldquot.header: Likewise.
8041 * runtime-po/insert-header.sin: Likewise.
8042 * runtime-po/remove-potcdate.sin: Likewise.
8043 * runtime-po/Makevars: Likewise.
8044 * runtime-po/LINGUAS: Likewise.
8045 * runtime-po/de.po: Likewise; we will rely on the translation project
8046 to maintain this, so "bootstrap" should get it.
0410a6e0 8047 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
8048 its value.
8049 * src/main.c (main): Bind the bison-runtime domain, too.
8050
80512005-07-12 Bruno Haible <bruno@clisp.org>
8052
8053 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8054 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8055 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8056 * runtime-po: New directory.
8057 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8058 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8059 * runtime-po/Rules-quot: New file, copied from po/.
8060 * runtime-po/quot.sed: Likewise.
8061 * runtime-po/boldquot.sed: Likewise.
8062 * runtime-po/en@quot.header: Likewise.
8063 * runtime-po/en@boldquot.header: Likewise.
8064 * runtime-po/insert-header.sin: Likewise.
8065 * runtime-po/remove-potcdate.sin: Likewise.
8066 * runtime-po/Makevars: New file.
8067 * runtime-po/POTFILES.in: New file.
8068 * runtime-po/LINGUAS: New file.
8069 * runtime-po/bison-runtime.pot: New file.
8070 * runtime-po/de.po: New file.
8071 * m4/bison.m4: New file.
8072 * Makefile.am (SUBDIRS): Add runtime-po.
8073 (aclocaldir, aclocal_DATA): New variables.
8074 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8075 Define aclocaldir.
8076 * src/getargs.c (usage): Document --print-localedir option.
8077 (PRINT_LOCALEDIR_OPTION): New enum item.
8078 (long_options): Add --print-localedir option.
8079 (getargs): Handle --print-localedir option.
8080 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8081 (Internationalization): New section.
8082
22dda0f0
AD
80832005-07-12 Akim Demaille <akim@epita.fr>
8084
8085 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8086 for consistency with the rest of the code.
8087 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8088 Add separators.
8089
82b248ad
AD
80902005-07-12 Akim Demaille <akim@epita.fr>
8091
8092 * src/parse-gram.y: Use %printer instead of YYPRINT.
8093
fa0e9314
AD
80942005-07-12 Akim Demaille <akim@epita.fr>
8095
867a3e00
AD
8096 * src/symtab.h, src/symtab.c (symbol_print): New.
8097 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8098 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8099
81002005-07-12 Akim Demaille <akim@epita.fr>
8101
8102 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
8103 b4_at_dollar and b4_dollar_dollar.
8104
e054b190
PE
81052005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8106
8107 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8108 and Pennello's paper.
8109
34160ec4
PE
81102005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8111
407d4a75
PE
8112 * data/yacc.c (yyparse): Undo previous patch. Instead,
8113 set yylsp[0] and yyvsp[0] only if the initial action
8114 sets yylloc and yylval, respectively.
8115
34160ec4
PE
8116 * data/yacc.c (yyparse): In the initial action, set
8117 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8118 This avoids the use of undefined variables if the initial
8119 action does not set yylloc and/or yylval.
8120
c3d5a4a7
PE
81212005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8122
b34d96c1
PE
8123 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8124 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8125 Remove from CVS. These files are automatically generated.
8126 * examples/extexi: Clarify that this file is now part of Bison,
8127 not GNU M4, and that it works with any POSIX-compatible Awk.
8128 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8129 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8130 so that we also get calc++-parser.yy. Geneate it.
8131 Use $(AWK), not gawk, since any conforming Awk will do.
8132 Put comment before action, since older 'make' can't handle comment
8133 in action.
8134 $(BUILT_SOURCES): List all built sources, not just some of them.
8135 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8136 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8137 $($(calc_sources_generated)): Remove unnecessary test for existence
8138 of target. (This had a shell syntax error anyway; a stray "x".)
8139 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8140 calc++-parser.yy.
8141 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8142
c3d5a4a7
PE
8143 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8144 implied by the other modules.
8145
828c373b
AD
81462005-07-06 Akim Demaille <akim@epita.fr>
8147
8148 Bind examples/calc++ to the package.
8149 * examples/calc++/Makefile: Remove, replaced by...
8150 * examples/calc++/Makefile.am: ... this new file.
8151 * examples/calc++/test: Remove input.
8152 * examples/calc++/compile: Remove.
8153 * examples/Makefile.am: New.
8154 * configure.ac, Makefile.am: Adjust.
8155 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8156
63cb01d6
PE
81572005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8158
fd2df2ed
PE
8159 * data/glr.c (yyFail): Drastically simplify; since the format argument
8160 never had any % directives, we can simply pass it to yyerror.
8161 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8162 be modified later, as that is the usual style in glr.c.
8163 Problems reported by Paul Hilfinger.
8164
63cb01d6
PE
8165 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8166 and size overflow errors.
8167 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8168 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8169 (YYSIZEMAX): New macro.
8170 (yystpcpy): New function, taken from yacc.c.
8171 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8172 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8173 so that we don't have to maintain their signatures.
8174 (yyFail): Check for buffer overflow, by using vsnprintf rather
8175 than vsprintf. Allocate a bigger buffer if possible.
8176 Report an error if buffer allocation fails.
8177 (yyStackOverflow): New function.
8178 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8179 the initialization was successful. It might fail if storage was
8180 exhausted.
8181 (yyexpandGLRStack): Add more checks for storage allocation failure.
8182 Use yyStackOverflow to report failures.
8183 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8184 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8185 Don't assume stack number fits in int.
8186 (yysplitStack): Check for storage allocation failure.
8187 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8188 can print diagnostics on storage allocation failure. All callers
8189 changed.
8190 (yyresolveValue): Use yybool for boolean.
8191 (yyreportSyntaxError): Check for size-calculation overflow.
8192 This code is taken from yacc.c.
8193 (yyparse): Check for storage allocation errors when allocating
8194 the initial stack.
8195
1c59e0a1
AD
81962005-07-05 Akim Demaille <akim@epita.fr>
8197
8198 Extract calc++ from the documentation.
8199 * doc/bison.texinfo (Calc++): Add the extraction marks.
8200 * examples/extexi: New, from the aborted GNU Programming 2E.
8201 Separate the different paragraph of a file with empty lines.
8202 * examples/Makefile: Use it to extract the whole calc++ example.
8203
8a0adb01
AD
82042005-06-24 Akim Demaille <akim@epita.fr>
8205
8206 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8207 class typedefs.
8208
12545799
AD
82092005-06-22 Akim Demaille <akim@epita.fr>
8210
8211 * doc/bison.texinfo (C++ Language Interface): First stab.
8212 (C++ Parsers): Remove.
8213
99be0235
AD
82142005-06-22 Akim Demaille <akim@epita.fr>
8215
8216 * data/lalr1.cc (yylex_): Honor %lex-param.
8217
0ffd4fd1
AD
82182005-06-22 Akim Demaille <akim@epita.fr>
8219
8220 Start a set of simple examples.
8221 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8222 * examples/calc++/calc++-driver.hh,
8223 * examples/calc++/calc++-parser.yy,
8224 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8225 * examples/calc++/compile, examples/calc++/test: New.
8226
0925ebb4
PE
82272005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8228
8229 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8230 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8231 which stems from the 2005-05-27 patch.
8232
43d3b664
PH
82332005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8234
8235 * data/glr.c: Modify treatment of unused parameters to permit use
8236 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8237
3062864d
PE
82382005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8239
8240 Fix infringement on user name space reported by Janos Zoltan Szabo.
8241 * data/yacc.c (yyparse): strlen -> yystrlen.
8242
989b5b8e
AD
82432005-05-30 Akim Demaille <akim@epita.fr>
8244
8245 * data/lalr1.cc (_): New.
8246 Translate the various messages.
8247
bedf57f5
PE
82482005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8249
8250 Fix infringement on user name space reported by Bruno Haible.
8251 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8252 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8253 the user's name space.
8254 (alloca): Include <stdlib.h> to get it, if it's not built in.
8255 (YYMALLOC, YYFREE): Define only if needed.
8256 (malloc, free): Declare, but only if needed, as this infringes on
8257 the user name space.
8258
4d1801f1
PE
82592005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8260
8261 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8262 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8263 with %d format.
8264 * lib/ebitset.c (min, max): Undef before defining.
8265 * lib/vbitset.c (min, max): Likewise.
8266 * lib/subpipe.c (create_subpipe): Save local variables in case
8267 vfork clobbers them.
8268
82692005-05-24 Bruno Haible <bruno@clisp.org>
8270
8271 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8272 error message syntax used by gcc-4.0.
8273
b94a9e1e
PE
82742005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8275
85ac3861
PE
8276 * README: Mention m4 1.4.3. Remove obsolete advice about
8277 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8278
b94a9e1e
PE
8279 * bootstrap: Remove workaround for problem I encountered with
8280 gettext 0.14.1; it seems to be fixed now.
8281
51c30d21
PE
82822005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8283
009ce67d
PE
8284 * NEWS: Version 2.0a.
8285
f2a97c62
PE
8286 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8287 the previous change.
8288
c8775f93
PE
8289 Various maintainer cleanups.
8290 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8291 conftest*, for benefit of CVS commands run at the same time as
8292 "configure". Add build-aux, since "bootstrap" now creates it and
8293 its subfiles.
8294 * Makefile.cfg (move_if_change): Remove.
8295 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
8296 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
8297 (po_repo, do-po-update, po-update, wget_files, get-targets):
8298 (config.guess-url_prefix, config.sub-url_prefix):
8299 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
8300 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
8301 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
8302 Remove.
8303 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
8304 this is now the recommended name.
8305 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
8306 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
8307 ylwrap. These files now go into build-aux.
8308 * config/move-if-change: Remove.
8309 * config/prev-version.txt: Bump from 1.75 to 2.0.
8310
3ea5f0ec
PE
8311 * bootstrap: Add stdio-safer, unistd-safer modules.
8312 Remove m4/glibc2.m4 (introduced by latest gnulib, but
8313 we don't need it).
8314 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
8315 fopen-safer.c, stdio-safer.h, unistd-safer.h.
8316 * lib/subpipe.c: Include "unistd-safer.h".
8317 (create_subpipe): Make sure all the newly-created
8318 file descriptors are > 2, so that diagnostics don't
8319 get sent down them (which might cause Bison to hang, in theory).
8320 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
8321 * src/files.c (xfopen): Use fopen_safer, not fopen.
8322
51c30d21
PE
8323 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
8324 yesterday's yacc.c fix.
8325
cea1469d
PE
83262005-05-21 Paul Eggert <eggert@cs.ucla.edu>
8327
3ea5f0ec
PE
8328 * data/glr.c, data/lalr1.cc: Update copyright date.
8329
cea1469d
PE
8330 Fix a destructor bug reported by Wolfgang Spraul in
8331 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
8332 * data/yacc.c (yyabortlab): Don't call destructor, and
8333 don't set yychar to EMPTY.
8334 (yyoverflowlab): Don't call destructor.
8335 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
8336 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
8337 since we no longer output the message "discarding lookahead token
8338 end of input ()".
8339
5e6f62f2
PH
83402005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8341
8342 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
8343 fix a small glitch in debugging output.
8344 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
8345 after YY_SYMBOL_PRINT where needed.
8346
8347 (struct yyGLRState): Add some comments.
8348 (struct yySemanticOption): Add some comments.
8349 (union yyGLRStackItem): Add comment.
8350
8351 (yymergeOptionSets): Correct this to properly perform the union,
8352 avoiding infinite reported by Michael Rosien.
8353 Update comment.
8354
8355 * tests/glr-regression.at: Add test for GLR merging error reported
8356 by M. Rosien.
cea1469d 8357
0fb669f9
PE
83582005-05-13 Paul Eggert <eggert@cs.ucla.edu>
8359
8360 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
8361 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
8362 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
8363 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
8364 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
8365 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
8366 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
8367 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
8368 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
8369 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
8370 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
8371 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
8372 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
8373 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
8374 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
8375 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
8376 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
8377 src/derives.h, src/files.c, src/files.h, src/getargs.c,
8378 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
8379 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
8380 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
8381 src/output.h, src/parse-gram.c, src/parse-gram.h,
8382 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
8383 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
8384 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
8385 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
8386 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
8387 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
8388 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
8389 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
8390 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
8391 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
8392 tests/reduce.at, tests/regression.at, tests/sets.at,
8393 tests/synclines.at, tests/testsuite.at, tests/torture.at:
8394 Update FSF postal mail address.
8395
51f4735e
PE
83962005-05-11 Paul Eggert <eggert@cs.ucla.edu>
8397
8398 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
8399 Problem reported by Ralf Menzel.
8400
80ce3401
PE
84012005-05-01 Paul Eggert <eggert@cs.ucla.edu>
8402
8403 * tests/actions.at: Test that stack overflow invokes destructors.
8404 From Marcus Holland-Moritz.
8405 * data/yacc.c (yyerrlab): Move the code that destroys the stack
8406 from here....
8407 (yyreturn): to here. That way, destructors are called properly
8408 even if the stack overflows, or the user calls YYACCEPT or
8409 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
8410 (yyoverflowlab): Destroy the lookahead.
8411
84122005-04-24 Paul Eggert <eggert@cs.ucla.edu>
8413
8414 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
8415
72f000b0
PE
84162005-04-17 Paul Eggert <eggert@cs.ucla.edu>
8417
8418 * NEWS: Bison-generated C parsers no longer quote literal strings
8419 associated with tokens.
8420 * src/output.c (prepare_symbols): Don't escape strings,
8421 since users don't want to see C escapes.
8422 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
8423 in diagnostics.
c19683bb 8424 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
8425 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
8426
1094323f
PE
84272005-04-16 Paul Eggert <eggert@cs.ucla.edu>
8428
8429 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
8430 the data size is known to be too small and we can't increase it.
8431 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
8432
ca407bdf
PE
84332005-04-15 Paul Eggert <eggert@cs.ucla.edu>
8434
8435 * src/parse-gram.y: Include quotearg.h.
8436 (string_as_id): Quote $1 before using it as a key, since the
8437 lexer no longer quotes it for us.
8438 (string_content): Don't strip quotes, since lexer no longer
8439 quotes it for us.
8440 * src/scan-gram.l: Include quotearg.h.
8441 ("\""): Omit quote.
8442 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
8443 a key, since the rest of the lexer doesn't quote it.
8444 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
8445 * tests/regression.at (Token definitions): Check for backslashes
8446 in token strings.
8447
8448 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
8449 (YYSIZE_T): Define to unsigned long int when using an older compiler.
8450 (yyparse): Revamp code to generate long syntax error message, to
8451 make it easier to translate, and to avoid problems with arithmetic
8452 overflow. Change "virtual memory" to "memory" in diagnostic, since
8453 we don't know whether the memory is virtual.
8454
1ce59070
PE
84552005-04-13 Paul Eggert <eggert@cs.ucla.edu>
8456
8457 * NEWS: Bison-generated C parsers now use the _ macro to
8458 translate strings.
8459 * data/yacc.c (_) [!defined _]: New macro.
8460 All English strings wrapped inside this macro.
8461 * doc/bison.texinfo (Bison Parser): Document _.
8462 * po/POTFILES.in: Include src/parse-gram.c, since it now
8463 includes translateable strings that parse-gram.y doesn't.
8464
a749a695
PE
84652005-04-12 Paul Eggert <eggert@cs.ucla.edu>
8466
8467 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
8468 reverting the 2004-10-11 change to this function.
8469 (symbol_check_alias_consistency): Don't call symbol_type_set
8470 if the type name is already correct.
8471 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
8472
8fb1053b
PE
84732005-03-25 Paul Eggert <eggert@cs.ucla.edu>
8474
8475 * tests/regression.at (Token definitions): Don't use a token named
8476 c, as that generates a "#define c ..." that runs afoul of buggy
8477 stdlib.h that uses the identifier c as a member of struct
8478 drand48_data. Problem reported by Horst Wente.
8479
ff498c4a
PE
84802005-03-21 Paul Eggert <eggert@cs.ucla.edu>
8481
8482 * bootstrap: Change translation URL from
8483 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
8484 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
8485 redirection glitches. Problem reported by twlevo@xs4all.nl.
8486
65211d70
PE
84872005-03-20 Paul Eggert <eggert@cs.ucla.edu>
8488
8489 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
8490 after operands; POSIX says this isn't portable for the c99 command.
8491
9577fb1f
PE
84922005-03-18 Paul Eggert <eggert@cs.ucla.edu>
8493
8494 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
8495 immediately if a data overrun has occurred; this may help us track
8496 down what may be a spurious failure on MacOS.
8497
78b178f7
PE
84982005-03-17 Paul Eggert <eggert@cs.ucla.edu>
8499
a2599d0f
PE
8500 Respond to problems reported by twlevo@xs4all.nl.
8501
8502 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
8503
78b178f7
PE
8504 * src/vcg.h: Comment fix.
8505 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
8506 (G_CMAX): Change to -1 instead of INT_MAX.
8507
8508 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 8509
7296e729
PE
85102005-03-15 Paul Eggert <eggert@cs.ucla.edu>
8511
8512 * src/tables.c (state_number_to_vector_number): Put it inside an
8513 "#if 0", since it's not currently used. Problem reported by
8514 Roland McGrath.
8515
05ac60f3
PE
85162005-03-06 Paul Eggert <eggert@cs.ucla.edu>
8517
8518 * src/output.c (escaped_output): Renamed from
8519 escaped_file_name_output, since we now use it for symbol tags as
8520 well. All uses changed.
8521 (symbol_destructors_output, symbol_printers_output):
8522 Escape symbol tags too.
8523 Problem reported by Matyas Forstner in
8524 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
8525
8526 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
8527 not needed.
8528 * src/output.c (user_actions_output, token_definitions_output,
8529 symbol_destructors_output, symbol_printers_output): Likewise.
8530 * src/reader.c (prologue_augment): Likewise.
8531 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
8532
8533 * src/vcg.c (output_edge): Don't quote linestyle arg.
8534 Problem reported by twlevo@xs4all.nl.
8535
7eb453ac
PE
85362005-02-28 Paul Eggert <eggert@cs.ucla.edu>
8537
8538 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
8539 example, reported by Derek M Jones. Also, make the example even
8540 more outrageous, to better illustrate how bad the problem is.
8541
4c04c52a
PE
85422005-02-24 Paul Eggert <eggert@cs.ucla.edu>
8543
8544 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
8545 putsym. Typo reported by Sebastian Piping.
8546
a61e1620
PE
85472005-02-23 Paul Eggert <eggert@cs.ucla.edu>
8548
8549 * doc/bison.texinfo (Language and Grammar): some -> same
8550 (Epilogue): int he -> in the
8551 Typos reported by Sebastian Piping via Justin Pence.
8552
9ec93868
PE
85532005-02-07 Paul Eggert <eggert@cs.ucla.edu>
8554
8555 * tests/glr-regression.at (Improper handling of embedded actions
8556 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
8557 embedded actions and $-N in GLR parsers", work around an Autoconf bug
8558 with dollar signs in test names.
8559 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
8560 for a similar reason.
8561
73ce7e7e
PE
85622005-01-28 Paul Eggert <eggert@cs.ucla.edu>
8563
8564 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
8565 wants to redefine G_VIEW.
8566
2e72b98e
PE
85672005-01-27 Paul Eggert <eggert@cs.ucla.edu>
8568
8569 * src/vcg.c (get_view_str): Remove case for normal_view.
8570 Problem reported by twlevo@xs4all.nl.
8571
e0d634e5
PE
85722005-01-24 Paul Eggert <eggert@cs.ucla.edu>
8573
ccf830a4
PE
8574 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
8575 Problem reported by twlevo@xs4all.nl.
8576
e0d634e5
PE
8577 * doc/bison.texinfo: Change @dircategory from "GNU programming
8578 tools" to "Software development". Requested by Richard Stallman
8579 via Karl Berry.
8580
7bbc8cb0
PE
85812005-01-23 Paul Eggert <eggert@cs.ucla.edu>
8582
8583 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
8584 Problem reported by twlevo@xs4all.nl.
8585
08b770bc
PE
85862005-01-21 Paul Eggert <eggert@cs.ucla.edu>
8587
8588 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
8589 keyword; it's not needed with modern compilers, and it doesn't
8590 affect correctness with older compilers. Suggested by
8591 twlevo@xs4all.nl.
8592
95f22ad2
PE
85932005-01-17 Paul Eggert <eggert@cs.ucla.edu>
8594
8595 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
8596 gcc -Wswitch-default.
8597 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8598 * data/yacc.c (yyparse): Likewise.
8599
d229d15c
PE
86002005-01-12 Paul Eggert <eggert@cs.ucla.edu>
8601
8602 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
8603 already. Let config.h define any nonstandard values.
8604
ecadd90f
PE
86052005-01-10 Paul Eggert <eggert@cs.ucla.edu>
8606
8607 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
8608 for the benefit of slower hosts. Problem reported by
8609 Nelson H. F. Beebe.
8610
213744b5
PE
86112005-01-07 Paul Eggert <eggert@cs.ucla.edu>
8612
8613 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
8614 being defined and not used.
8615 * data/lalr1.cc (yyparse): Likewise.
8616 Use "if (false)" rather than "if (0)".
8617
249d3236
PE
86182005-01-05 Paul Eggert <eggert@cs.ucla.edu>
8619
8620 * TODO: Mention that we should allow NUL bytes in tokens.
8621
987cc1fb
PE
86222005-01-02 Paul Eggert <eggert@cs.ucla.edu>
8623
8624 * src/scan-skel.l (<<EOF>>): Don't close standard output.
8625 Problem reported by Hans Aberg.
8626
08fe02d9
PE
86272005-01-01 Paul Eggert <eggert@cs.ucla.edu>
8628
8629 * src/getargs.c (version): Happy new year; update overall
8630 program copyright date from 2004 to 2005.
8631
8632 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
8633 Problem reported by Hans Aberg.
8634 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
8635 (Output file names.): Add a test for the case when standard output
8636 is closed.
8637
010c0266
PE
86382004-12-26 Paul Eggert <eggert@cs.ucla.edu>
8639
8640 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
8641 to fix an oversight in the Bison 2.0 manual.
8642
da12206a
PE
86432004-12-25 Paul Eggert <eggert@cs.ucla.edu>
8644
8645 * NEWS: Version 2.0. Reformat the existing news items since
8646 1.875, so that related items are grouped together.
3a4734aa 8647 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
8648 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
8649
c935d934
PE
8650 * tests/torture.at (Exploding the Stack Size with Alloca): Set
8651 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
8652 otherwise, we're not testing alloca. Unfortunately there's no
8653 simple way to consult HAVE_ALLOCA here.
8654
da12206a
PE
8655 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
8656 for yymsg, too.
8657
8658 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
8659 hand. This avoids a warning about comparing int to size_t when
8660 GCC warnings are enabled.
8661
0a2c5137
PE
86622004-12-22 Paul Eggert <eggert@cs.ucla.edu>
8663
d7e14fc0
PE
8664 * NEWS: Bison-generated parsers no longer default to using the
8665 alloca function (when available) to extend the parser stack, due
8666 to widespread problems in unchecked stack-overflow detection.
8667 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
8668 responsibility to set it to a positive value. This lets the user
8669 specify a value that is not a preprocessor constant.
8670 * data/yacc.c (YYMAXDEPTH): Likewise.
8671 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
8672 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
8673 to be a compile-time constant. However, explain the constraints on it.
8674 Also, explain the constraints on YYINITDEPTH.
8675 (Table of Symbols): Explain that alloca is no longer the default.
8676 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
8677 to 1.
8678
0a2c5137
PE
8679 * doc/bison.texinfo (Location Default Action): Mention that n must
8680 be zero when k is zero. Suggested by Frank Heckenbach.
8681
e019c247
AD
86822004-12-22 Akim Demaille <akim@epita.fr>
8683
8684 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
8685 (parser::state_type, parser::semantic_type, parser::location_type):
8686 Private, not public.
8687 (parser::parse): Return ints, not bool.
8688 Returning a bool introduces a problem: 0 corresponds to false, and
8689 it seems weird to return false on success. Returning true changes
8690 the conventions for yyparse.
8691 Alternatively we could return void and send an exception.
8692 There is no clear consensus (yet?).
8693 (state_stack, semantic_stack, location_stack): Rename as...
8694 (state_stack_type, semantic_stack_type, location_stack_type): these.
8695 Private, not public.
8696 * tests/c++.at: New.
8697 * tests/testsuite.at, tests/Makefile.am: Adjust.
8698
72731bb7
AD
86992004-12-21 Akim Demaille <akim@epita.fr>
8700
8701 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
8702
9a0d8bec
AD
87032004-12-21 Akim Demaille <akim@epita.fr>
8704
8705 Don't impose std::string for filenames.
8706
8707 * data/lalr1.cc (b4_filename_type): New.
8708 (position::filename): Use it.
8709 (parser.hh): Move the inclusion of stack.hh and location.hh below
8710 the user code, so that needed headers for the filename type can be
8711 included first.
72731bb7
AD
8712 Forward declare them before the user code.
8713 * tests/Makefile.am (check-local, installcheck-local): Pass
8714 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 8715
99880de5
AD
87162004-12-20 Akim Demaille <akim@epita.fr>
8717
8718 Use more STL like names: my_class instead of MyClass.
8719
8720 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
8721 (SemanticStack, SemanticType, StateStack, StateType)
8722 (TokenNumberType, Stack, Slice, Traits, Parser::location)
8723 (Parser::value): Rename as...
8724 (location_stack, location_type, rhs_number_type, semantic_stack)
8725 (semantic_type, state_stack, state_type, token_number_type, stack)
8726 (slice, traits, parser::yylloc, parser::yylval): these.
8727
8728 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
8729
9bec482e
PE
87302004-12-19 Paul Eggert <eggert@cs.ucla.edu>
8731
8732 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
8733 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8734
f6fbd3da
PE
87352004-12-17 Paul Eggert <eggert@cs.ucla.edu>
8736
8737 Remove uses of 'short int' and 'unsigned short int'. This raises
8738 some arbitrary limits. It uses more memory but nowadays that's
8739 not much of an issue.
8740
8741 This change does not affect the generated parsers; that's a different
8742 task, as some users will want to conserve memory there.
8743
8744 Ideally we should use size_t to represent all object counts, and
8745 something like ptrdiff_t to represent signed differences of object
8746 counts; but that will require more code-cleanup than I have the
8747 time to do right now.
8748
8749 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
8750 Use size_t, not int or short int, to count objects.
8751 * src/closure.c (nritemset, closure): Likewise.
8752 * src/closure.h (nritemset, closure): Likewise.
8753 * src/nullable.c (nullable_compute): Likewise.
8754 * src/print.c (print_core): Likewise.
8755 * src/print_graph.c (print_core): Likewise.
8756 * src/state.c (state_compare, state_hash): Likewise.
8757 * src/state.h (struct state): Likewise.
8758 * src/tables.c (default_goto, goto_actions): Likewise.
8759
8760 * src/gram.h (rule_number, rule): Use int, not short int.
8761 * src/output.c (prepare_rules): Likewise.
8762 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
8763 errs, reductions): Likewise.
8764 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
8765 Likewise.
8766 * src/tables.c (vector_number, tally, action_number,
8767 ACTION_NUMBER_MINIMUM): Likewise.
8768 * src/output.c (muscle_insert_short_int_table): Remove.
8769
efeed023
AD
87702004-12-17 Akim Demaille <akim@epita.fr>
8771
8772 * data/lalr1.cc: Extensive Doxygenation.
8773 (error_): Rename as...
8774 (error): this, since it is visible to the user.
8775 Adjust callers.
8776 (Parser::message): Now an automatic variable from...
8777 (Parser::yyreport_syntax_error_): here.
8778 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
8779 Parser::error.
8780 * tests/input.at: Escape $.
8781
bc82c5a5
PE
87822004-12-16 Paul Eggert <eggert@cs.ucla.edu>
8783
8784 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
8785 Parenthesize rhs to avoid obscure problems with mistakes like
8786 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
8787 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8788 b4_rhs_location): Likewise.
8789 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
8790 b4_rhs_location): Likewise.
8791
fd19f271
AD
87922004-12-16 Akim Demaille <akim@epita.fr>
8793
8794 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
8795 yacc.c: be sure to stay within yycheck_.
8796 * tests/actions.at: Re-enable C++ tests.
8797
10454ea4
AD
87982004-12-16 Akim Demaille <akim@epita.fr>
8799
8800 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
8801 real.
8802
c5b95ccf
AD
88032004-12-16 Akim Demaille <akim@epita.fr>
8804
8805 Use #define to handle the %name-prefix.
8806
8807 * data/glr.c, data/yacc.c: Comment changes.
8808 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
8809 so that one can refer to yylex in the parser file, and have it
8810 renamed, as is the case with other skeletons.
8811
617a8f12
AD
88122004-12-16 Akim Demaille <akim@epita.fr>
8813
8814 Move lalr1.cc internals into yy*.
8815
8816 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
8817 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
8818 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
8819 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
8820 (empty_, final_, terror_, errcode_, ntokens_)
8821 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
8822 (looka_, ilooka_, error_range_, nerrs_):
8823 Rename as...
8824 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
8825 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
8826 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
8827 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
8828 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
8829 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
8830 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
8831 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
8832 these.
8833
1e547e6e
PE
88342004-12-15 Paul Eggert <eggert@cs.ucla.edu>
8835
8836 Fix some problems reported by twlevo at xs4all.
8837 * src/symtab.c (symbol_new): Report an error if the input grammar
8838 contains too many symbols. This is better than calling abort() later.
8839 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
8840 (struct node, struct graph):
8841 Rename member expand to stretch. All uses changed.
8842 (struct graph): Remove member layoutalgorithm. All uses removed.
8843 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
8844 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
8845 All uses changed.
8846 (N_STRETCH): Rename from N_EXPAND. All uses changed.
8847
735d6bd4
AD
88482004-12-15 Akim Demaille <akim@epita.fr>
8849
8850 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
8851 Add more Doxygen comments.
8852 (symprint_, stack_print_, reduce_print_, destruct_, pop)
8853 (report_syntax_error_, translate_): Rename as...
8854 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
8855 (yypop_, yyreport_syntax_error_, yytranslate_): this.
8856
2e1f5829
AD
88572004-12-15 Akim Demaille <akim@epita.fr>
8858
8859 * data/lalr1.cc (lex_): Rename as...
8860 (yylex_): this.
8861 Move the trace here.
8862 Take the %name-prefix into account.
8863 Reported by Alexandre Duret-Lutz.
8864
a3cb6248
AD
88652004-12-15 Akim Demaille <akim@epita.fr>
8866
8867 Simplify the C++ parser constructor.
8868
8869 * data/lalr1.cc (debug_): Rename as...
8870 (yydebug_): so that the parser's internals are always in the yy*
8871 pseudo namespace.
8872 Adjust uses.
8873 (b4_parse_param_decl): Remove the leading comma as it is now only
8874 called as unique argument list.
8875 (Parser::Parser): Remove the constructor accepting a location and
8876 an initial debugging level.
8877 Remove from the other ctor the argument for the debugging level.
8878 (debug_level_type, debug_level, set_debug_level): New.
8879
8880 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
8881 constructor calls.
8882
07fed891
AD
88832004-12-15 Akim Demaille <akim@epita.fr>
8884
8885 Remove b4_root related material: failure experiment
a3cb6248 8886 (which goal was to allow to derive from a class).
07fed891
AD
8887
8888 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
8889 definitions and uses.
8890
e603eaa5
PE
88912004-12-14 Paul Eggert <eggert@cs.ucla.edu>
8892
8893 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
8894 not 2, since it's not portable to subtract 1 from the start of an
8895 array. The new item 0 is never set or used. All uses changed.
8896
8897 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
8898 the default definition of YYLLOC_DEFAULT. Problem reported
8899 by Frank Heckenbach.
8900
fafb007d
PE
89012004-12-12 Paul Eggert <eggert@cs.ucla.edu>
8902
8903 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
8904 the normal case and one for the error case. Just use the
8905 first one uniformly. Problem reported by Frank Heckenbach.
8906 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
8907 use exactly the same macro in both places.
8908 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
8909 so that the normal-case YYRHSLOC works for the error case too.
8910 All uses changed.
8911 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
8912 (YYLLOC_DEFAULT): Use the same macro as glr.c.
8913 * doc/bison.texinfo (Location Default Action): Don't claim that
8914 we have an array of locations. Use the same macro for both glr
8915 and lalr parsers. Mention YYRHSLOC. Mention what happens when
8916 the index is 0.
8917
48814dcd
PE
89182004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8919
a4e1a53b
PE
8920 * HACKING: Update email addresses to send announcements to.
8921
48814dcd
PE
8922 * configure.ac (AC_INIT): Bump version to 1.875f.
8923
337116ba
PE
89242004-12-10 Paul Eggert <eggert@cs.ucla.edu>
8925
8926 * NEWS: Version 1.875e.
8927 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
8928
8929 * src/scan-skel.l: Include "complain.h", for "fatal".
8930
8931 * src/relation.h (relation_print, relation_digraph):
8932 Relation sizes are of type relation_node, not size_t (this is
8933 merely a doc fix, since the two types are equivalent).
8934 (relation_transpose): Relation sizes are of type relation_node,
8935 not int.
8936 * src/relation.c: Likewise.
8937 (top, infinity): Now of type relation_node, not int.
8938 (traverse, relation_transpose): Use relation_node, not int.
8939
8940 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
8941 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
8942 (yyparse): Remove unused local introduced in 2004-10-25 patch.
8943
8944 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 8945 specifying whether the test should be skipped. Use it tp
337116ba 8946 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 8947 fail on some hosts, and should be skipped.
337116ba 8948
da2a7671
PE
89492004-12-08 Paul Eggert <eggert@cs.ucla.edu>
8950
8951 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
8952 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
8953 unless otherwise specified below.
8954
8955 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
8956 to allocate kernel_base, kernel_items, kernel_size, since
8957 they needn't be initialized to 0.
8958 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
8959 * src/closure.c (new_closure): Likewise, for itemset.
8960 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
8961 * src/lalr.c (set_goto_map): Likewise, for temp_map.
8962 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
8963 (build_relations): Likewise for edge, states1, includes.
8964 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
8965 * src/reader.c (packgram): Likewise, for ritem, rules.
8966 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
8967 * src/relation.c (relation_digraph): Likewise for VERTICES.
8968 (relation_transpose): Likewise for new_R, end_R.
8969 * src/symtab.c (symbols_token_translations_init): Likewise for
8970 token_translations.
8971 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
8972 (token_actions): Likewise for yydefact, actrow, conflrow,
8973 conflict_list.
8974 (save_column): Likewise for froms[symno], tos[symno].
8975 (goto_actions): Likewise for state_count.
8976 (pack_table): Likewise for base, pos, check.
8977 (tables_generate): Likewise for width.
8978
8979 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
8980 for initial core. Just have a separate core, so we needn't worry
8981 about whether kernel_size and kernel_base are initialized.
8982
8983 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
8984 kernel_size, kernel_items): Remove unnecessary initialization.
8985 * src/conflicts.c (conflicts): Likewise.
8986 * src/derives.c (derives): Likewise.
8987 * src/muscle_tablc (muscle_insert): Likewise.
8988 * src/relation.c (relation_digraph): Likewise.
8989 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
8990 conflrow, conflict_table, conflict_list, table, check):
8991 Likewise.
8992
8993 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
8994 This is because all callers pass unsigned int.
8995 * src/closure.h (new_closure): Likewise.
8996
8997 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
8998 (build_relations): Initialize includes[i] in all cases.
8999 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9000 and rules[ruleno].precsym. Initialize members in order.
9001 * src/relation.c (relation_transpose): Always initialize new_R[i]
9002 and end_R[i].
9003 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9004
9005 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9006 conflict_list[0] was always 0, but now it isn't initialized.
9007
9008 * src/table.c (table_grow): When conflict_table grew, the grown
9009 area wasn't cleared. Fix this.
9010
9011 * lib/.cvsignore: Add strdup.c, strdup.h.
9012 * m4/.cvsignore: Add strdup.m4.
9013
00baeeac
PE
90142004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9015
9016 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9017 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9018 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9019 ngotos + 1 without checking for overflow.
9020 (build_relations): Use END_NODE, not -1, to denote end of edges.
9021 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9022 build_relations): Use goto_number, not int, for goto numbers.
9023 * src/tables.c (save_column, default_goto): Likewise.
9024
be3d9d42
AD
90252004-11-23 Akim Demaille <akim@epita.fr>
9026
9027 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9028 of #defining from yystype.
9029 Don't typedef yystype, C++ does not need it.
9030 This lets it possible to forward declare it as union.
9031
78e526d5
PE
90322004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9033
9034 * bootstrap (gnulib_modules): Add extensions.
9035 Problem reported by Jim Meyering.
9036
afbb696d
PE
90372004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9038
9039 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9040 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9041 src/system.h, src/tables.c: XFREE -> free, to accommodate
9042 recent change to gnulib xalloc.h.
78e526d5 9043 Problem reported by Jim Meyering.
afbb696d 9044
c1f8f16a
AD
90452004-11-17 Akim Demaille <akim@epita.fr>
9046
9047 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9048
db7e5eb5 90492004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
9050 Alexandre Duret-Lutz <adl@gnu.org>
9051
9052 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9053 changes.
9054 (YYCDEBUG): Adjust.
9055 Use it instead of cdebug_.
9056 (Parser::debug_stream, Parser::set_debug_stream): New.
9057 (Parser::symprint_): Define cdebug_ for temporary backward
9058 compatibility.
9059 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9060 debug_stream ().
9061
68e11668
AD
90622004-11-17 Akim Demaille <akim@epita.fr>
9063
9064 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9065 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9066 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9067 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9068
97cbc73e
PE
90692004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9070
9071 * data/glr.c (yyloc_default): Remove; not used.
9072 Problem reported by Frank Heckenbach.
9073
e342c3be
AD
90742004-10-25 Akim Demaille <akim@epita.fr>
9075
9076 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9077 Introduce another definition to address simple location arrays.
9078 (yyGLRStack): New member: yyerror_range.
9079 (yyrecoverSyntaxError, yyparse): Update it.
9080 (yyrecoverSyntaxError): Use it when shifting the error token to
9081 have an accurate range, equivalent to the one computed by both
9082 yacc.c and lalr1.cc.
9083 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9084 that column numbers start at column 0, as per GNU Coding
9085 Standards, the others tests, and the doc.
9086 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9087 Adjust to the above change (first column is 0).
9088 And adjust the location of the "<error>", now covering the whole
9089 line.
9090
93602feb 90912004-10-22 Akim Demaille <akim@epita.fr>
04098407 9092 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
9093
9094 Remove some arbitrary limits on goto numbers and relations.
9095 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9096 initial values, since they're never used.
9097 (set_goto_map): ngotos is now unsigned, so test for overflow
9098 by seeing whether it wraps around to zero.
9099 * src/lalr.h (goto_number): Now size_t, not short int.
9100 (GOTO_NUMBER_MAXIMUM): Remove.
9101 * src/relation.c (relation_print, traverse, relation_transpose):
9102 Check for END_NODE rather than looking at sign.
9103 * src/relation.h (END_NODE): New macro.
9104 (relation_node): Now size_t, not short int.
9105
dba08b04
PE
91062004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9107
9108 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9109 keyword, not an identifier. Problem reported by Baron Schwartz in
9110 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9111
df09ef2e
AD
91122004-10-11 Akim Demaille <akim@epita.fr>
9113
9114 * src/symtab.c (symbol_check_alias_consistency): Also check
9115 type names, destructors, and printers.
9116 Reported by Alexandre Duret-Lutz.
9117 Recode the handling of associativity and precedence in terms
9118 of symbol_precedence_set.
9119 Accept no redeclaration at all, not even equal to the previous
9120 value.
9121 (redeclaration): New.
9122 Use it to factor redeclaration complaints.
9123 (symbol_make_alias): Don't set the type of the alias, let
9124 symbol_check_alias_consistency do it as for other features.
9125 * src/symtab.h (symbol): Add new member prec_location, and
9126 type_location.
9127 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9128 * tests/input.at (Incompatible Aliases): New.
9129
146bc99d
PE
91302004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9131
9132 .cvsignore fixes to accommodate gnulib changes,
9133 and the practice of naming build directories "_build".
9134 * .cvsignore: Add "_*". Sort.
9135 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9136 * m4/.cvsignore: Add "*_gl.m4".
9137
e503aa60
AD
91382004-10-06 Akim Demaille <akim@epita.fr>
9139
9140 * src/parse-gram.y (add_param): Fix the truncation of trailing
9141 spaces.
9142
b4a20338
AD
91432004-10-05 Akim Demaille <akim@epita.fr>
9144
9145 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9146 whether the reducion was empty or not. This leaves room to
9147 improve the use of YYLLOC_DEFAULT in such a case.
9148 lalr1.cc is still experimental, so changing this is acceptable.
9149 And finally, there are probably not many users who changed the
9150 handling of locations in GLR, so changing is admissible too.
9151
9152 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9153 empty reduction, set @$ to an empty location ending the previously
9154 stacked symbol.
9155 Adjust uses to make sure the code is triggered on empty
9156 reductions.
9157 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9158 expected output: empty reductions have empty locations.
9159
f85a5e6f
AD
91602004-09-29 Akim Demaille <akim@epita.fr>
9161
9162 * data/lalr1.cc: Move towards a more standard C++ coding style
9163 for templates: Class < T > -> Class<T>.
9164
b203fc2c
AD
91652004-09-29 Akim Demaille <akim@epita.fr>
9166
9167 * data/lalr1.cc: Reinstall the former ctor, for sake of
9168 compatibility, but warn it will be removed.
9169 Move towards a more standard C++ coding style (i.e., type *var ->
9170 type* var).
9171
5b7e1e73
PE
91722004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9173
3fee967f
PE
9174 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9175 since it's less likely to work if NULs are involved in the future.
5b7e1e73 9176
0dcca5c2
AD
91772004-09-27 Akim Demaille <akim@epita.fr>
9178
9179 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9180
6dde1c82
AD
91812004-09-27 Akim Demaille <akim@epita.fr>
9182
9183 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 9184 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
9185 and argument names.
9186 (b4_cc_constructor_call): Likewise.
9187
b233d555
AD
91882004-09-24 Akim Demaille <akim@epita.fr>
9189
9190 * src/parse-gram.y (add_param): Strip the leading and trailing
9191 blanks from a formal argument declaration.
9192 (YY_LOCATION_PRINT): New.
9193
619404e3
AD
91942004-09-24 Akim Demaille <akim@epita.fr>
9195
9196 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9197 after the location.
9198
dd8d9022
AD
91992004-09-24 Akim Demaille <akim@epita.fr>
9200
9201 * doc/bison.texinfo (Table of Symbols): Sort.
9202
0092f063
AD
92032004-09-21 Akim Demaille <akim@epita.fr>
9204
9205 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9206 the useless parentheses.
9207 Suggested by Paul Eggert.
9208
451364ed
AD
92092004-09-20 Akim Demaille <akim@epita.fr>
9210
9211 Let the initial-action act on the look-ahead, and use it for the
9212 "initial push" (corresponding to an hypothetical beginning-of-file).
9213 And let lalr1.cc honor %initial-action.
9214
9215 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9216 example.
9217 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9218 (Parser::Parser): Remove the ctor that used to initialize it.
9219 (Parser::parse): Like in the other skeletons, issue the "starting
9220 parse" message before any action.
9221 Honor %initial-action.
9222 Initialize the stacks with the lookahead.
9223 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9224 look-ahead.
9225 Push them in the stacks.
9226 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9227
18d192f0
AD
92282004-09-20 Akim Demaille <akim@epita.fr>
9229
9230 * doc/bison.texinfo (Initial Action Decl): New.
9231
b8458aa5
AD
92322004-09-20 Akim Demaille <akim@epita.fr>
9233
9234 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9235 clearer criterion to define it.
9236 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9237 When reducing on an empty RHS, use the latest stacked location as
9238 location.
9239 yylloc is not always available.
9240 * data/glr.c: Likewise.
9241 Also, honor initial-actions.
9242
3fc16193
AD
92432004-09-20 Akim Demaille <akim@epita.fr>
9244
9245 * data/yacc.c (YY_LOCATION_PRINT): New.
9246 Define when we know YYLTYPE's structure, i.e., when the default
9247 YYLLOC_DEFAULT is used.
9248 * data/c.m4 (b4_yysymprint_generate): Use it.
9249 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9250 value of the result.
9251 (error_start_): Replace with...
9252 (error_range_): this location array.
9253 This allows to replace code relying on the implementation of
9254 locations by portable code.
9255 * data/yacc.c (yylerrsp): Replace with...
9256 (yyerror_range): this.
9257 Every time a token is popped, update yyerror_range[0], to have an
9258 accurate location for the error token.
9259 * data/glr.c (YY_LOCATION_PRINT): New.
9260 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9261 deference a pointer.
9262 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9263 report the location in %printers.
9264
9265 * src/scan-skel.l: Instead of abort, report error messages to ease
9266 understanding skeleton scanning failures.
9267
ecfe33e7
AD
92682004-09-16 Akim Demaille <akim@epita.fr>
9269
9270 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9271 (iterator, const_iterator): these, to be more in the C++ spirit.
9272 Also, return reverse iterators so that when displaying the stack
9273 we display its bottom first.
9274 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9275 from yacc.c.
9276 We should probably use vector here though.
9277
1576d44d
AD
92782004-09-16 Akim Demaille <akim@epita.fr>
9279
9280 Have more complete shift traces.
9281
9282 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9283 to report Shifts instead of ad hoc YYDPRINTF invocations,
9284 including for the error token.
9285 * data/lalr1.cc (symprint_): Output the location.
9286 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9287 output the location within the %printer.
9288 Activate GLR tests, at least to make sure they compile properly.
9289 They still don't pass though.
9290 * tests/calc.at: Adjust expect verbose output, since now "Entering
9291 state..." is on a different line than the "Shifting" message.
9292
9c66f418
AD
92932004-09-08 Akim Demaille <akim@epita.fr>
9294
9295 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
9296 Bison directive from the Bison file to the invocation of this
9297 macro, so that these directives are passed to
9298 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
9299 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
9300 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
9301 the extra Bison directives instead of the whole series.
9302 Change the grammar so that there are recoverable errors, and
9303 unrecoverable errors. Now we can have the parser give up before
9304 consuming the whole input. As a result we now can observe that
9305 the lookahead is freed when needed.
9306 Change the parser source to parse argv[1] instead of a hard coded
9307 string.
9308 Simplify yylex, and give a value and location to EOF.
9309 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
9310 passed directives already coded in the file.
9311 Add some tests to check the location of "error".
9312 For some tests, the C++ parser is correct, and not yacc.c.
9313 For other tests, they provide different, but unsatisfying, values,
9314 so keep the C++ value so that at least one parser is "correct"
9315 according to the test suite.
9316 (Actions after errors): Remove, this is subsumed by the
9317 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
9318
52d5733f
AD
93192004-09-06 Akim Demaille <akim@epita.fr>
9320
9321 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 9322 (Parser::pop): New.
52d5733f
AD
9323 Use it.
9324
a0e68930
AD
93252004-09-06 Akim Demaille <akim@epita.fr>
9326
9327 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
9328 argument, an informative message.
9329 Call YY_SYMBOL_PRINT.
9330 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
9331 * data/lalr1.cc (destruct_): Likewise.
9332 In addition, no longer depend on b4_yysymprint_generate and
9333 b4_yydestruct_generate to generate these functions, do it "by
9334 hand".
9335
e757bb10
AD
93362004-09-03 Akim Demaille <akim@epita.fr>
9337
9338 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
9339 invoked, yydestruct the lookahead.
9340 * tests/calc.at (Calculator $1): Update the expected lengths of
9341 traces: there is an added line for the discarded lookahead.
9342 * doc/bison.texinfo (Destructor Decl): Some rewording.
9343 Define "discarded" symbols.
9344
0fe1f06d
AD
93452004-09-02 Akim Demaille <akim@epita.fr>
9346
9347 * data/lalr1.cc (translate_, destruct_): No reason to be static.
9348
284acc8b
AD
93492004-09-02 Akim Demaille <akim@epita.fr>
9350
9351 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
9352 (YYDSYMPRINTF): Rename as...
9353 (YY_SYMBOL_PRINT): this.
9354 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
9355 two.
9356 Use it instead of direct symprint_ calls.
9357 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
9358 one.
9359
a5eb1ed2
AD
93602004-09-02 Akim Demaille <akim@epita.fr>
9361
b7c72fe1
AD
9362 * data/lalr1.cc (b4_yysymprint_generate): New.
9363 (symprint_): New member function, defined when YYDEBUG.
9364 Use it consistently instead of token/nterm debugging output by
9365 hand.
a5eb1ed2
AD
9366 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
9367 %printer calls to use cdebug_ when using lalr1.cc.
9368
417141dd
AD
93692004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
9370
9371 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
9372 with #ifdef YYDEBUG.
9373
2fa09258
AD
93742004-08-26 Akim Demaille <akim@epita.fr>
9375
9376 * doc/bison.texinfo (Implementing Loops): Rename as...
9377 (Implementing Gotos/Loops): this.
9378
9378b508
PE
93792004-08-13 Paul Eggert <eggert@cs.ucla.edu>
9380
9381 Adjust to latest gnulib.
9382 * bootstrap (gnulib_modules): Add xalloc-die.
9383 Set LC_ALL=C so that file names sort consistently.
9384 Prefer the gnulib copies of gettext.m4, glibc21.m4,
9385 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
9386 uintmax_t.m4, ulonglong.m4.
9387 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
9388 po.m4 since we are now using _gl.m4 instead.
9389
87a8ad5c
PE
93902004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
9391
9392 * src/scan-action.l: Remove. Scanning of semantic actions is
9393 handled in scan-gram.l.
9394
dca81a78
PE
93952004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
9396
9397 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
9398
9399 * src/location.h (struct): The file member is a uniqstr.
9400 (equal_boundaries): Use UNIQSTR_EQ for comparison.
9401
c9cbf7c5
PE
94022004-07-22 Paul Eggert <eggert@cs.ucla.edu>
9403
9404 Fix bug with non-%union parsers that have printers or destructors,
9405 which led to a Bison core dump. Reported by Peter Fales in
9406 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 9407
c9cbf7c5
PE
9408 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
9409 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
9410 not to our own type.
9411 * src/output.c (symbol_destructors_output, symbol_printers_output):
9412 Don't assume %union.
9413 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
9414 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
9415 UNION-FLAG. All callers changed.
9416 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
9417 Use type char, not unsigned int, when declaring an array of char;
9418 this lets us remove a cast.
9419 (Printers and Destructors): Add non-%union test cases.
9420
fa7e68c3
PE
94212004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9422
9423 * doc/bison.texinfo: Minor editorial changes, mostly to the new
9424 GLR writeups. E.g., avoid frenchspacing and the future tense,
9425 change "lookahead" to "look-ahead", and change "wrt" to "with
9426 respect to".
2fa09258 9427
fa7e68c3
PE
94282004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9429
9430 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
9431 New sections, split off from the GLR Parsers section. Put the new
9432 Simple GLR Parser near the start of the GLR section, for clarity.
9433 Rewrite connective text.
9434
99a9344e
PE
94352004-06-21 Frank Heckenbach <frank@g-n-u.de>
9436
9437 * doc/bison.texinfo (Simple GLR Parsers): New section.
9438
8dd162d3
PE
94392004-06-21 Paul Eggert <eggert@cs.ucla.edu>
9440
9441 * NEWS, TODO, doc/bison.texinfo:
9442 Use "look-ahead" instead of "lookahead", to be consistent.
9443 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
9444 while we're fixing "look-ahead".
9445 * src/conflicts.c (shift_set): Renamed from shiftset.
9446 (look_ahead_set): Renamed from lookaheadset.
9447 * src/print.c: Likewise.
9448 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
9449 name for "lookahead".
9450 (report_types, usage): Likewise.
9451 * src/getargs.h (report_look_ahead_tokens): Renamed from
9452 report_lookaheads.
9453 * src/lalr.c (compute_look_ahead_tokens): Renamed from
9454 compute_lookaheads.
9455 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
9456 (look_ahead_tokens_print): Renamed from lookaheads_print.
9457 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
9458 state_rule_lookaheads_print.
9459 * src/state.h: Likewise.
9460 (reductions.look_ahead_tokens): Renamed from lookaheads.
9461 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
9462 AT_DATA_LOOKAHEADS_GRAMMAR.
9463
57a90331
PE
94642004-06-03 Paul Eggert <eggert@cs.ucla.edu>
9465
9466 * README: Update location of patched M4 distribution.
9467
8ed3234a
PE
94682004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
9469
9470 Don't assume the C++ compiler takes the same arguments as the C compiler
9471 (trivial change).
9472 * configure.ac (O0CXXFLAGS): New var.
9473 * tests/atlocal.in (CXXFLAGS): Use it.
9474
07971983
PE
94752004-05-29 Paul Eggert <eggert@cs.ucla.edu>
9476
9477 Fix some "make check" problems with C++ reported by
9478 Albert Chin-A-Young for Tru64 C++ in this thread:
9479 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
9480
9481 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
9482 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9483 Output to a .cc file for C++, not to a .c file.
9484 * tests/calc.at (AT_CHECK_CALC): Likewise.
9485 * tests/regression.at (AT_CHECK_DANCER): Likewise.
9486 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
9487
29058652
PE
94882004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
9489
9490 * tests/calc.at, tests/actions.at: Workaround for SGI
9491 C++ compiler. (trivial change)
9492
62cb8a99
PE
94932004-05-27 Paul Eggert <eggert@cs.ucla.edu>
9494
fd418816
PE
9495 Spent a few hours checking out which prerequisite versions the
9496 current sources actually require. I went all the way back to
9497 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
9498 a seemingly endless set of combinations of versions more recent
9499 than that. The bottom line is that the current sources require
9500 fairly recent versions of the build tools, and it'll be some work
9501 to change this.
9502 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
9503 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
9504 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
9505 Add comments explaining why those particular versions are
9506 currently needed.
2fa09258 9507
62cb8a99
PE
9508 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
9509 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 9510 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
9511
9512 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
9513 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
9514
caa52c10
PE
95152004-05-26 Paul Eggert <eggert@cs.ucla.edu>
9516
9517 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
9518 0.11.5. Suggested by Bruno Haible.
9519 * bootstrap: Remove gettext version checking.
9520
9521 * doc/bison.texinfo (Decl Summary): Also mention that %union
9522 can depend on prerequisite types. Problem reported by Tim
9523 Van Holder.
9524
4bfd5e4e
PE
95252004-05-25 Paul Eggert <eggert@cs.ucla.edu>
9526
2cef3017
PE
9527 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
9528 * README-alpha: Don't tell people not to package this.
9529
b9c85d5c
PE
9530 * bootstrap: Don't assume $(...) works; use `...` instead.
9531 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
9532 gettext better.
9533
4bfd5e4e
PE
9534 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
9535 put into the -d output file, and mention what to do if YYSTYPE is
9536 defined as a macro.
9537
6a36ff94
PE
95382004-05-24 Paul Eggert <eggert@cs.ucla.edu>
9539
6712933e
PE
9540 Undo change made earlier today: it caused autopoint to not bring
9541 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
9542 autopoint's.
9543
9544 * bootstrap: Check that gettext version matches what's in
9545 configure.ac. Warn users to ignore robots.txt ERROR 404.
9546 * bootstrap: Undo today's earlier change (logged below).
9547 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 9548
6a36ff94
PE
9549 The gettext version checking is causing more trouble than it's
9550 curing; remove it. Problem reported by Paul Hilfinger.
9551
9552 * bootstrap: Issue a warning that one can expect a message
9553 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
9554 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
9555
209ea708
PE
95562004-05-23 Paul Eggert <eggert@cs.ucla.edu>
9557
9558 Ensure that the C++ compiler used for testing actually works on a
9559 simple test program; if not, skip the C++-related tests. Problem
9560 reported by Vin Shelton in:
161a71f3 9561 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
9562
9563 * m4/cxx.m4: New file.
9564 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
9565 * tests/atlocal.in (BISON_CXX_WORKS): Add.
9566 * tests/local.at (AT_COMPILE_CXX): Use it.
9567
41ca2549
PE
95682004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9569
383e69dc
PE
9570 * data/glr.c (yylloc): Output this macro even if locations are not
9571 being generated, as the GLR parser needs it even in that case.
9572 Problem reported by Troy A. Johnson
9573 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
9574
41ca2549
PE
9575 * configure.ac (AC_INIT): Update to 1.875e.
9576
e476c87d
PE
95772004-05-21 Paul Eggert <eggert@cs.ucla.edu>
9578
9579 * NEWS: Version 1.875d.
9580 * configure.ac (AC_INIT): Likewise.
9581 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
9582
9583 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
9584 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
9585 lalr1.cc runs afoul of the first, and the last two are no longer
9586 supported by GCC 3.4.0.
9587 * README: Mention GNU m4 1.4 or later; mention m4 patches.
9588 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
9589
233a88ad
PE
95902004-05-06 Paul Eggert <eggert@cs.ucla.edu>
9591
9592 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
9593 unsigned int, for compatibility with latest gnulib hash module.
9594 * src/state.c (state_hash, state_hasher): Likewise.
9595 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
9596 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 9597
12ffdd28
PE
95982004-05-03 Paul Eggert <eggert@cs.ucla.edu>
9599
9600 * NEWS: Unescaped newlines are no longer allowed in char & strings.
9601
9602 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
9603 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
9604 character and string literals.
9605 (unexpected_end): New function.
9606 (unexpected_eof): Use it.
9607 (unexpected_newline): New function.
9608 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
9609 actions.
e476c87d 9610
12ffdd28
PE
9611 * NEWS: Document %expect-rr.
9612
9613 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
9614 Fix typo by replacing $1 with $option.
9615 Remove more 'intl'-related files.
9668e2be 9616 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
9617
9618 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
9619 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
9620 strtoul.c.
9621 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
9622 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
9623 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
9624 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
9625 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
9626 * src/.cvsignore: Add *.output.
9627
9628 * src/parse-gram.y: Put copyright notice inside %{ %} so it
9629 gets copied to the output file.
e476c87d 9630
1f65350a
PE
96312004-04-28 Paul Eggert <eggert@twinsun.com>
9632
9633 Get files from the gnulib and po repositories, instead of relying
9634 on them being in our CVS. Upgrade to latest versions of gnulib
9635 and Automake.
9636
9637 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
9638 * bootstrap: Bootstrap from gnulib and po repositories.
9639 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
9640 * README-cvs: Document these changes. Remove version numbers from
9641 mentions of build tools, since they change so often. Mention Flex.
9642
9643 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
9644 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
9645 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
9646 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 9647 does this for us.
12ffdd28
PE
9648 (AC_ISC_POSIX): Remove; we no longer support this
9649 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
9650 (AC_HEADER_STDC): Remove: we now assume C89 or better.
9651 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
9652 Do not check for C89 headers, except for locale.h which is used
9653 by the Yacc library and must port to K&R hosts.
9654 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
9655 Do not check for C89 functions, except for setlocale which is
9656 used by the Yacc library.
9657 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
9658 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
9659 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
9660 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
9661 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
9662 AM_GNU_GETTEXT): Remove; now done by:
9663 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
9664 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
9665 for us.
9666
9667 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
9668 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
9669 Define to empty, as gnulib.mk will do the rest for us.
9670 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
9671 for us.
9672 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
9673 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
9674
9675 * src/files.c: Include gnulib's xstrndup.h.
9676
9677 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
9678 (REALLOC): Use xnrealloc, for likewise.
9679 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
9680 (strnlen, memrchr): Remove decls; functions no longer used.
9681 Include <stpcpy.h>.
9682
9683 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
9684 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9685 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
9686 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
9687 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
9688 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
9689 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
9690 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
9691 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
9692 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
9693 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
9694 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9695 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
9696 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
9697 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
9698 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
9699 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
9700 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
9701 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
9702 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
9703 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
9704 Remove, as these files are now generated automatically
9705 by bootstrap or automake.
9706
9707 * po/ChangeLog: Remove: all but one entry was a duplicate
9708 of this file, and I moved that 2000-11-02 entry here.
9709
9710 * config/.cvsignore: Add Makefile, depcomp, install-sh.
9711 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
9712 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
9713 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
9714 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
9715 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
9716 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
9717 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
9718 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
9719 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
9720 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
9721 xstrndup.h.
9722 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
9723 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
9724 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
9725 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
9726 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
9727 * src/.cvsignore: Remove *_.c.
9728
9729
9730 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
9731 support it. (The latest stable gzip doesn't.)
9732
97332004-04-27 Paul Eggert <eggert@twinsun.com>
9734
9735 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
9736 case, as stos_ is now used by destructors due to the 2004-02-09
9737 change.
9738
9739 Remove more K&R C support.
9740 * lib/libiberty.y (PARAMS): Remove. All uses removed.
9741 * lib/subpipe.c (errno): Remove decl.
9742 Include <stdlib.h> unconditionally.
9743 (EXIT_FAILURE): Remove macro.
9744 * src/complain.c (vfprintf, strerror): Remove.
9745 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
9746 unconditionally.
9747 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
9748 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
9749 (strchr, strspn, memchr): Remove decls.
9750 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
9751 unconditionally. Do not declare perror.
9752 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
9753 unconditionally.
9754
9755 * src/complain.c (_): Remove useless defn, as system.h defines this.
9756
9757 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
9758 with latest obstack.h.
9759 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
9760 to procedure types, as obstack.h now does that for us.
9761 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
9762
9763 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
9764 so that this include file can stand alone.
9765 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
9766 does this now. Include subpipe.h first after config.h, to
9767 test whether it can stand alone.
9768
9769 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
9770 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
9771 unused declaration.
9772
9773 * tests/synclines.at (%union synch line): Put a dummy member in
9774 the union, because empty unions aren't allowed in C. Caught
9775 by GCC 3.4.0.
9776
4f16766c
PE
97772004-04-13 Jim Meyering <jim@meyering.net>
9778
9779 * src/conflicts.c (conflicts_print): Correct format string typo:
9780 use `%%' to produce literal `%'. (trivial change)
9781
779e7ceb
PE
97822004-03-30 Paul Eggert <eggert@twinsun.com>
9783
9784 * src/getargs.c (version): Update copyright year to 2004.
9785
9786 * data/c.m4 (b4_int_type): Use 'short int' rather than
9787 'short', and similarly for 'long', 'unsigned', etc.
9788 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
9789 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
9790 yy_yypstack, yydumpstack): Likewise.
9791 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
9792 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
9793 Likewise.
9794 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
9795 yy_stack_print, yyparse): Likewise.
9796 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
9797 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
9798 * lib/bitset.c (bitset_print): Likewise.
9799 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
9800 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9801 * lib/bitsetv.c (bitsetv_dump): Likewise.
9802 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
9803 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
9804 Likewise.
9805 * src/LR0.c (allocate_itemsets): Likewise.
9806 * src/gram.h (rule_number, rule): Likewise.
9807 * src/lalr.h (goto_number): Likewise.
9808 * src/nullable.c (nullable_compute): Likewise.
9809 * src/output.c (prepare_rules): Likewise.
9810 * src/relation.c (relation_print, relation_digraph): Likewise.
9811 * src/relation.h (relation_node): Likewise.
9812 * src/state.h (state_number, transitions, errs, reductions,
9813 struct state): Likewise.
9814 * src/symtab.h (symbol_number, struct symbol): Likewise.
9815 * src/tables.c (vector_number, tally, action_number,
9816 default_goto, goto_actions): Likewise.
9817 * tests/existing.at (GNU Cim Grammar): Likewise.
9818 * tests/regression.at (Web2c Actions): Likewise.
9819
9820 * src/output.c (muscle_insert_short_int_table): Renamed from
9821 muscle_insert_short_table. All uses changed.
9822
d6328241
PH
98232004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9824
9825 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
9826 (declaration): Replace expected_conflicts with expected_sr_conflicts.
9827 Add %expect-rr rule.
4f16766c 9828
d6328241
PH
9829 * src/scan-gram.l: Recognize %expect-rr.
9830
4f16766c 9831 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 9832 expected_conflicts.
4f16766c 9833 (expected_rr_conflicts): Declare.
d6328241
PH
9834
9835 * src/conflicts.c (expected_sr_conflicts): Rename from
9836 expected_conflicts.
9837 (expected_rr_conflicts): Define.
9838 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
9839 for GLR parsers.
9840 Use expected_sr_conflicts in place of expected_conflicts.
9841 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 9842
d6328241 9843 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 9844
1452af69
PE
98452004-03-08 Paul Eggert <eggert@gnu.org>
9846
9847 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 9848 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
9849
9850 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
9851 in lalr1.cc.
9852 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
9853 * src/scan-gram.l (scan_integer): New function.
9854 ({int}): Use it.
9855 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
9856 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
9857 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
9858 Say "long int", not "long", for uniformity with GNU style.
9859
006d217d
PE
98602004-02-25 Paul Eggert <eggert@twinsun.com>
9861
9862 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
9863 compilers. This fixes a problem with Intel's C++ compiler being
9864 chatty, reported by Guido Trentalancia in
161a71f3 9865 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 9866
c2729758
ADL
98672004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
9868
9869 Support %destructor and merge error locations in lalr1.cc.
9870
9871 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
9872 (Parser::stos_): Define unconditionally.
9873 (Parser::destruct_): New method. Generate its body with
9874 b4_yydestruct_generate.
9875 (Parser::error_start_): New attribute.
9876 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
9877 token which are discarded.
9878 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
9879 error_start_ when erroneous token are discarded.
9880 (Parser::parse) <yyerrlab1>: Compute the location of the error
9881 token so that it covers all the discarded tokens.
9882 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
9883 it can be called with `%skeleton "lalr1.cc"', and do that.
9884
dd0e0635
PE
98852004-02-02 Paul Eggert <eggert@twinsun.com>
9886
9887 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
9888 $(top_srcdir)/lib and ../lib. This fixes a bug reported
9889 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
9890 There's no need to mention top_builddir since Automake does that
9891 for us.
9892 (INCLUDES): Remove, as Automake says it's obsolescent.
9893 Contents migrated into AM_CPPFLAGS as described above.
9894 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
9895
98962004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9897
9898 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
9899 (yyreportSyntaxError): Handle case where lookahead token is
9900 YYEMPTY.
9901
be16239b
PH
99022004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9903
9904 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
9905 resulting parsers are compilable with C++.
9906
5fa90832
PE
99072003-12-23 Paul Eggert <eggert@twinsun.com>
9908
9909 * config/depcomp, config/install-sh: Sync with Automake 1.8.
9910 * src/output.c (output_skeleton): Rename local var.
9911 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
9912 Bison tokens, as this runs afoul of the 2003-10-07 change that
9913 disallowed NUL bytes in character constants or string literals.
9914
9915 * tests/local.at: Require Autoconf 2.59's Autotest.
9916 * tests/testsuite.at: Don't include local.at, since we now assume
9917 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
9918 including it.
9919 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
9920 multiple inclusion warnings.
dd0e0635 9921
b165c324
AD
99222003-12-02 Akim Demaille <akim@epita.fr>
9923
9924 * doc/bison.texinfo (How Can I Reset the Parser): More about start
9925 conditions.
9926 From Bruno Haible.
9927
26e06a21
ADL
99282003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
9929
9930 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
9931
92ac3705
PE
99322003-10-07 Paul Eggert <eggert@twinsun.com>
9933
6a5ecb38
PE
9934 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
9935 if testsuite doesn't exist.
9936
92ac3705
PE
9937 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
9938 literals, unfortunately.
9939 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
9940 Complain about NUL bytes in character constants or string literals.
9941
91d2c560
PE
99422003-10-05 Paul Eggert <eggert@twinsun.com>
9943
9944 * NEWS: Don't document %no-default-prec, as it's still
9945 too experimental.
9946 * doc/bison.texinfo: Document %no-default-prec only if
9947 the defaultprec flag is set. Normally it's not.
9948
0cc3da3a
PE
99492003-10-04 Paul Eggert <eggert@twinsun.com>
9950
9951 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
9952 non-modifiable lvalue, instead of a modifiable one.
9953 * doc/bison.texinfo (Actions): Document that $$ can
9954 be assigned to. Do not claim that $$ and $N are
9955 array element references: user code should not rely on this.
9956
22fccf95
PE
99572003-10-01 Paul Eggert <eggert@twinsun.com>
9958
9959 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
9960 (grammar_declaration): Use it.
9961 * src/scan-gram.l: New token %no-default-prec.
9962 * tests/conflicts.at: Revamp tests to use %no-default-prec.
9963 * NEWS, doc/bison.texinfo: Document the above.
9964
fc8f2965
AD
99652003-10-01 Akim Demaille <akim@epita.fr>
9966
9967 VCG no longer supports long_straight_phase.
9968
9969 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
9970 * src/print_graph.c (print_graph): Adjust.
9971
39a06c25
PE
99722003-09-30 Frank Heckenbach <frank@g-n-u.de>
9973 and Paul Eggert <eggert@twinsun.com>
9974
9975 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
9976 Table of Symbols): Document %default-prec.
9977 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
9978 (grammar_declaration): Set default_prec on %default-prec.
9979 * src/scan-gram.l (%default-prec): New token.
9980 * src/reader.h (default_prec): New flag.
9981 * src/reader.c: Likewise.
9982 (packgram): Handle it.
9983 * tests/conflicts.at (%default-prec without %prec,
9984 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 9985
39a06c25
PE
99862003-09-30 Paul Eggert <eggert@twinsun.com>
9987
9988 * tests/testsuite.at: Include local.at, not input.at, fixing
9989 a typo in the 2003-08-25 patch.
9990
62b6aef9
AD
99912003-08-27 Akim Demaille <akim@epita.fr>
9992
9993 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
9994 GCC warnings.
9995
89e1cc61
AD
99962003-08-26 Akim Demaille <akim@epita.fr>
9997
9998 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
9999 "<\#" to avoid magic from Gnus when posting parts of this script.
10000
a08460b0
AD
100012003-08-26 Akim Demaille <akim@epita.fr>
10002
10003 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10004 (Parser::parse): here.
10005 Adjust: nerrs and errstatus is now replaced by...
10006 (Parser::nerrs_, Parser::errstatus_): New.
10007
603f1cfd
AD
100082003-08-25 Akim Demaille <akim@epita.fr>
10009
10010 * config/announce-gen, Makefile.cfg: New.
10011 * Makefile.am: Adjust.
10012 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10013 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10014
cd3684cf
AD
100152003-08-25 Akim Demaille <akim@epita.fr>
10016
10017 When reducing initial empty rules, Bison parser read an initial
10018 location that is not defined. This results in garbage, and that
10019 affects Bison's own parser. Therefore we need (i) to extend Bison
10020 to support a means to initialize this location, and (ii) to use
10021 this CVS Bison to fix CVS Bison's parser.
10022
10023 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10024 with...
10025 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10026 * src/parse-gram.y: Adjust.
10027 (%initial-action): New.
10028 (%error-verbose): Since we require CVS Bison, there is no reason
10029 not to use it.
10030 * src/scan-gram.l: Adjust.
10031 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10032 * data/yacc.c (yyparse): Use b4_initial_action.
10033
4e03e201
AD
100342003-08-25 Akim Demaille <akim@epita.fr>
10035
10036 * doc/bison.texinfo: Don't promote stdout for error messages.
10037
8c182d05
AD
100382003-08-25 Akim Demaille <akim@epita.fr>
10039
10040 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10041 From Alexandre Duret-Lutz.
10042
6a60c4cf
PE
100432003-08-25 Akim Demaille <akim@epita.fr>
10044
10045 Version 1.875c.
10046
25f66e1a
AD
100472003-08-25 Akim Demaille <akim@epita.fr>
10048
10049 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10050 Use them.
10051
5348bfbe
AD
100522003-08-25 Akim Demaille <akim@epita.fr>
10053
10054 * data/lalr1.cc (Parser::reduce_print_): New.
10055 Use it.
10056
47301314
AD
100572003-08-25 Akim Demaille <akim@epita.fr>
10058
10059 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10060 error recovery loops. This patch is based on
161a71f3 10061 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
10062 Also, augment the similarity between lalr1.cc and yacc.c.
10063 Note: the locations of error recovery rules are not correct yet.
10064
10065 * data/lalr1.cc: Comment changes to augment the similarity between
10066 lalr1.cc and yacc.c.
10067 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10068 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10069 yyerrlab), when hitting EOF, pop the whole stack here instead of
10070 merely falling thru the default error handling mechanism.
10071 (yyerrorlab): New label, with the old contents of YYERROR,
10072 plus the following change: pop the stack of rhs corresponding
10073 to the production that invoked YYERROR. That is how Yacc
10074 behaves (required by POSIX).
10075 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10076 fail.
10077
1f7a61ff
AD
100782003-08-25 Akim Demaille <akim@epita.fr>
10079
10080 Tune local.at so that people can "autom4te -l autotest calc.at -o
10081 calc" for instance, to extract a sub test suite.
10082
10083 * tests/testsuite.at: Move the initialization, Autotest version
10084 requirement, and AT_TESTED invocation into...
10085 * tests/local.at: here.
10086 * tests/testsuite.at: Include it for compatibility with Autoconf
10087 2.57.
10088 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10089 be ignore.
10090
327b5b56
PE
100912003-08-04 Paul Eggert <eggert@twinsun.com>
10092
10093 Rework code slightly to avoid gcc -Wtraditional warnings.
10094 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10095 The returned value is now stored in *YY0. All callers changed.
10096 * src/output.c (merge_output): Adjust to the above change.
10097
0051e3ed
PE
100982003-07-26 Paul Eggert <eggert@twinsun.com>
10099
10100 * data/glr.c (YYASSERT): New macro.
10101 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10102 yyresolveStates, yyprocessOneStack):
10103 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10104 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 10105
137437c6
PE
101062003-07-25 Paul Eggert <eggert@twinsun.com>
10107
5b620e06
PE
10108 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10109 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 10110 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
10111 by Frank Heckenbach, though I have omitted the structure-initialization
10112 part of his glr-knr.diff patch since I recall that the Portable
10113 C Compiler didn't require that change.
10114
137437c6
PE
10115 Let the user specify how to allocate and free memory.
10116 Derived from a suggestion by Frank Heckenbach in
161a71f3 10117 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
10118 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10119 All uses of free, malloc, realloc changed to use these macros,
10120 and unnecessary casts removed.
10121 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10122
ddb85ca5
PE
101232003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10124
10125 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10126 use s.empty() rather than s == "" to test for empty string; see
161a71f3 10127 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
10128 (trivial change)
10129
39910e09
AD
101302003-06-25 Akim Demaille <akim@epita.fr>
10131
10132 * config/depcomp, config/install-sh: Update from masters.
10133
0ae99356
PE
101342003-06-20 Paul Eggert <eggert@twinsun.com>
10135
10136 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10137 and return properly parenthesized result.
10138 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10139 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10140 Remove unnecessary parentheses from uses.
10141 * doc/bison.texinfo (Location Default Action): Describe the
10142 conventions for parentheses.
10143
cd05d13c
PE
101442003-06-19 Paul Eggert <eggert@twinsun.com>
10145
81fd08ca
PE
10146 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10147 yyreportTree): Do not assume that size_t is the same width as int,
10148 when printing sizes. Print sizes using an unsigned format.
10149 Problem reported by Frank Heckenbach in
161a71f3 10150 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 10151
cd05d13c
PE
10152 Port to Forte Developer 7 C compiler.
10153 * data/glr.c (struct YYLTYPE): If locations are not being used,
10154 declare a single dummy member, as empty structs do not conform
10155 to the C standard.
10156 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10157 the Forte Developer 7 C compiler complains that end-of-loop
10158 code is not reached.
10159
4dcf140b
PE
101602003-06-17 Paul Eggert <eggert@twinsun.com>
10161
10162 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10163 avoid warnings from picky compilers about redefinition of PARAMS.
10164
8dd76bee
PE
101652003-06-17 Paul Eggert <eggert@twinsun.com>
10166
10167 Version 1.875b.
10168
10169 * NEWS: Document 1.875b.
10170
10171 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10172 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10173 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10174 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10175 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10176 per recent gettext manual's suggestion.
10177 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10178 Use prototypes, not old-style definitions.
10179 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10180 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10181 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10182 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10183 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10184 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10185 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10186 vbitset_or_and_cmp, vbitset_copy): Likewise.
10187
10188 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10189 Do not include <stdlib.h>.
10190 (PARAMS): Define unconditionally for C89.
10191 (ATTRIBUTE_NORETURN): Remove.
10192 (ATTRIBUTE_UNUSED): Define unconditionally.
10193
10194 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 10195 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
10196 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10197 * lib/vbitset.c, lib/vbitset.h: New files.
10198 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10199 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10200 from libbitset.
10201
10202 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10203 `How Can I Reset @code{yyparse}', since texinfo does not allow
10204 arbitrary @ in node names.
10205
10206 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10207 shouldn't be needed according to the gettext 0.12.1 documentation
10208 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 10209 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 10210 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 10211 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 10212
8dd76bee
PE
10213 * lib/.cvsignore: Add stdbool.h.
10214 * m4/.cvsignore: Add nls.m4, po.m4.
10215
10216 Upgrade to CVS gnulib.
10217 * stdbool_.h: File renamed from stdbool.h.in.
10218 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10219 AC_HEADER_STDBOOL.
10220 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10221 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10222 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10223 (MOSTLYCLEANFILES): New var.
10224 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10225 (stdbool.h): New rule.
10226 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10227 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10228 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10229 m4/quote.m4: Upgrade to today's gnulib.
10230
10231 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10232 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10233 the tests right now.
10234 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10235 yyerror are declared before use; C99 requires this.
10236
25005f6a
PH
102372003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10238
10239 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10240 first.
10241 (yyrecoverSyntaxError): Correct the logic for setting and testing
10242 yyerrState.
10243 Correct comment on handling EOF.
10244 Allow states with only a default reduction, rather than failing
8dd76bee 10245 (I can't quite reconstruct why these were not allowed before).
25005f6a 10246
137437c6 10247 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 10248 buffer overruns, corrupting state.
8dd76bee
PE
10249
10250 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
10251 definition.
10252 * src/reader.h (max_left_semantic_context): New variable declaration.
10253 * src/scan-gram.l (max_left_semantic_context): Define.
10254 (handle_action_dollar): Update max_left_semantic_context.
10255 * data/glr.c (YYMAXLEFT): New definition.
10256 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10257 (yyresolveAction): Ditto.
10258
10259 Fixes to problems with location handling in GLR parsers reported by
10260 Frank Heckenbach (2003/06/05).
10261
10262 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10263 (YYRHSLOC): Add parentheses, and define only if locations used.
10264 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10265 locations not used.
10266 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10267 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 10268
25005f6a
PH
10269 * tests/cxx-type.at: Exercise location information; update tests
10270 to differentiate output with and without locations.
8dd76bee 10271 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
10272 because default YYLTYPE not yet defined.
10273 Change semantic actions to compute strings, rather than printing
10274 them directly (to test proper passing of semantics values). Change
10275 output to prefix notation and update test data and expected results.
10276 (yylex): Track locations.
10277 (stmtMerge): Return value rather than printing, and include arguments
10278 in value.
8dd76bee 10279
711f40b7
PE
102802003-06-03 Paul Eggert <eggert@twinsun.com>
10281
10282 Avoid warnings generated by GCC 2.95.4 when Bison is
10283 configured with --enable-gcc-warnings.
10284 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10285 yy::]b4_parser_class_name[::translate_,
10286 yy::Stack::operator[] (unsigned),
10287 yy::Stack::operator[] (unsigned) const,
10288 yy::Slice::operator[] (unsigned),
10289 yy::Slice::operator[] (unsigned) const):
10290 Rename local vars to avoid warnings.
10291 * tests/glr-regression.at (Improper handling of embedded actions
10292 and $-N in GLR parsers): Remove unused local variable from yylex.
10293 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
10294 (void) as arg when not pure, since we now assume C89 when building
10295 Bison. Pacify GCC by using parameter.
10296
ac695f7d
PE
102972003-06-02 Paul Eggert <eggert@twinsun.com>
10298
10299 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
10300 yy::Location::lines, yy::Location::columns): Rename arguments
10301 to avoid shadowing; this removes a warning generated by GCC 3.3.
10302
26ec81e0
PE
103032003-06-01 Paul Eggert <eggert@twinsun.com>
10304
10305 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
10306 to g++, as GCC 3.3 complains if you do it.
10307 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
10308 everything that WARNING_CFLAGS has, except omit warnings
10309 not suitable for C++.
10310 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
10311 * tests/atlocal.in (CXXFLAGS): New var.
10312 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
10313
10314 Fix a GLR parser bug I reported in February; see
161a71f3 10315 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
10316 The problem was that GLR parsers did not conform to the C standard,
10317 because actions like { $1 = $2 + $3; } expanded to expressions
10318 that invoked YYFILL in separate subexpressions, and YYFILL assigned
10319 to a local variable. The C standard says that expressions
10320 like (var = f ()) + (var = f ()) have undefined behavior.
10321 Another problem was that GCC sometimes issues warnings that
10322 yyfill and its parameters are unused.
10323
10324 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
10325 as possibly unused.
10326 (yyfill): New function.
10327 (YYFILL): Use it.
10328 (yyuserAction): Change type of yynormal to bool, so that it matches
10329 the new yyfill signature. Mark it as possibly unused.
10330
10331
10332 Follow up on a bug I reported in February, where a Bison-generated
10333 parser can loop. Provide a test case and a fix for yacc.c. I
10334 don't have a fix for lalr1.cc or for glr.c, unfortunately.
10335 The original bug report is in:
161a71f3 10336 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
10337
10338 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
10339 macro's size was becoming unwieldy.
10340 (yyerrlab): Do not discard an empty lookahead symbol, as this
10341 might destroy garbage.
10342 (yyerrorlab): New label, with the old contents of YYERROR,
10343 plus the following change: pop the stack of rhs corresponding
10344 to the production that invoked YYERROR. That is how Yacc
10345 behaves, and POSIX requires this behavior.
10346 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
10347 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
10348 Define 'alarm' to do nothing if unistd.h is not available.
10349 Add a new rule "exp: '-' error;" to test the above change to
10350 data/yacc.c. Use 'alarm' to abort any test taking longer than
10351 10 seconds, as it's probably looping.
10352 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
10353 Also, the new yacc.c generates two fewer diagnostics for an
10354 existing test.
10355
d0829076
PE
103562003-05-24 Paul Eggert <eggert@twinsun.com>
10357
c6ae27df
PE
10358 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
10359 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
10360 This fixes a problem reported by John Bowman when the Compaq/HP
10361 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
10362 -ansi -Wall -gall).
10363 * data/yacc.c (union yyalloc): Likewise.
10364 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 10365
d0829076
PE
10366 Switch from 'int' to 'bool' where that makes sense.
10367
10368 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
10369 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
10370 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
10371 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
10372 Return or accept bool, not int. All callers changed.
10373 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
10374 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
10375 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
10376 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
10377 bitset_or_and_cmp_): Likewise.
10378 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
10379 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
10380 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
10381 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
10382 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
10383 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
10384 bitset_stats_or_and_cmp): Likewise.
10385 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
10386 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
10387 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
10388 ebitset_xor_cmp): Likewise.
10389 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
10390 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
10391 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
10392 lbitset_xor_cmp): Likewise.
10393 * lib/bbitset.h: Include <stdbool.h>.
10394 (struct bitset_vtable): The following members now return bool, not
10395 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
10396 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
10397 or_and_cmp).
10398 * src/conflicts.c (count_rr_conflicts): Likewise.
10399 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
10400 All uses changed.
10401 * lib/ebitset.c (ebitset_obstack_init): Likewise.
10402 * lib/lbitset.c (lbitset_obstack_init): Likewise.
10403 * src/getargs.c (debug_flag, defines_flag, locations_flag,
10404 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10405 graph_flag): Likewise.
10406 * src/getargs.h (debug_flag, defines_flag, locations_flag,
10407 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
10408 graph_flag): Likewise.
10409 * src/output.c (error_verbose): Likewise.
10410 * src/output.h (error_verbose): Likewise.
10411 * src/reader.c (start_flag, typed): Likewise.
10412 * src/reader.h (typed): Likewise.
10413 * src/getargs.c (LOCATIONS_OPTION): New constant.
10414 (long_options, getargs): Use it.
10415 * src/lalr.c (build_relations): Use bool, not int.
10416 * src/nullable.c (nullable_compute): Likewise.
10417 * src/print.c (print_reductions): Likewise.
10418 * src/tables.c (action_row, pack_vector): Likewise.
10419 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
10420 * src/output.c (prepare): Use it.
10421 * src/output.c (token_definitions_output,
10422 symbol_destructors_output, symbol_destructors_output): Use string,
10423 not boolean integer, to keep track of whether to output separator.
10424 * src/print_graph.c (print_core): Likewise.
10425 * src/state.c (state_rule_lookaheads_print): Likewise.
10426
10427 * config/install-sh: Sync from automake 1.7.5.
10428
6b2584b7
PE
104292003-05-14 Paul Eggert <eggert@twinsun.com>
10430
10431 * src/parse-gram.y (rules_or_grammar_declaration): Require a
10432 semicolon after a grammar declaration, in the interest of possible
10433 future changes to the Bison input language.
10434 Do not allow a stray semicolon at the start of the grammar.
10435 (rhses.1): Allow one or more semicolons after any rule, including
10436 just before "|" as required by POSIX.
10437 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
10438 grammar.
10439
caf37a36
ADL
104402003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
10441
10442 %parse-param support for lalr1.cc.
10443
10444 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
10445 b4_cc_constructor_calls, b4_cc_constructor_call,
10446 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
10447 definitions.
10448 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
10449 parse-param arguments.
10450 (yy::b4_parser_class_name): Declare instance variables to
10451 hold parse-param arguments.
10452 * tests/calc.at: s/value/semantic_value/ because value clashes
10453 with a member of yy::b4_parser_class_name. Adjust C++ code
10454 to handle %parse-param. Enable %parse-param test in C++.
10455
3ab37077
PE
104562003-05-12 Paul Eggert <eggert@twinsun.com>
10457
10458 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
10459 English a bit. Fix fclose typo. Change "const char" to "char
10460 const", and use ANSI C rather than K&R for "main". Suggest
10461 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
10462 and suggest yy_switch_to_buffer.
10463
104642003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
10465
10466 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
10467 C89. This avoids a diagnostic on compilers that define __STDC__
10468 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 10469 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 10470
e743727f
PE
104712003-05-03 Paul Eggert <eggert@twinsun.com>
10472
10473 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
10474 Do not overrun array bounds.
10475 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 10476 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 10477
916708d5
AD
104782003-04-29 Akim Demaille <akim@epita.fr>
10479
10480 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
10481 * src/getargs.c, src/getargs.h: here, as bool, not int.
10482 (nondeterministic_parser): New.
10483 * src/parse-gram.y, src/scan-gram.l: Support
10484 %nondeterministic-parser.
10485 * src/output.c (prepare): Use nondeterministic_parser instead
10486 of glr_parser where appropriate.
10487 * src/tables.c (conflict_row, action_row, save_row)
10488 (token_actions, token_actions, pack_vector): Ditto.
10489
a06ea4aa
AD
104902003-04-29 Akim Demaille <akim@epita.fr>
10491
10492 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
10493
211074ca
AD
104942003-04-29 Akim Demaille <akim@epita.fr>
10495
10496 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
10497 with %pure-parser and %locations to exercise the patch from Yakov
10498 Markovitch below.
10499
6175ffe3
PE
105002003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
10501
10502 * data/yacc.c: (b4_lex_param): Corrected for the case where
10503 %lex-param is provided and %pure-parser isn't.
10504
b1e95857
PE
105052003-04-27 Paul Eggert <eggert@twinsun.com>
10506
10507 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 10508 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
10509 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
10510 if it is not defined.
10511 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
10512
acda9df6
PE
105132003-04-26 Paul Eggert <eggert@twinsun.com>
10514
3470c57b
PE
10515 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
10516 Declare to be of type suitable for the ninf value itself, not of
10517 type suitable for the corresponding table, since the latter might
10518 be unsigned but the ninf value might be negative. This fixes a
10519 bug reported by Alexandre Duret-Lutz in
161a71f3 10520 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 10521
acda9df6
PE
10522 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
10523 invokes it. We shouldn't invoke it twice because it will attempt
10524 to put error.o in the archive twice. This fixes a glitch reported
10525 by Martin Mokrejs in
161a71f3 10526 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 10527
b5250f26
PE
105282003-04-21 Paul Eggert <eggert@twinsun.com>
10529
10530 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
10531 to gnulib.
10532
089ac0f1
PE
105332003-04-21 Yakov Markovitch <Markovitch@iso.ru>
10534
10535 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
10536 Fix obvious typo that results in uncompilable GLR parsers
10537 when both %pure-parser and %locations are used. (trivial change)
10538
5ededac6
PE
105392003-04-17 Paul Eggert <eggert@twinsun.com>
10540
1b8f2fff
PE
10541 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
10542 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
10543 Do not insert the expected token via unput, as this runs afoul
10544 of a POSIX-compatibility bug in flex 2.5.31.
10545 All uses changed to BEGIN the parent state,
10546 since we no longer insert the expected token via unput.
10547 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
10548 that is no longer emitted after the above change.
10549
5ededac6
PE
10550 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
10551 the first one. This change is from Paul Hilfinger, and it fixes
10552 regression reported by Werner Lemberg in
161a71f3 10553 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
10554
10555 (resolve_sr_conflict): Don't invoke state_errs_set
10556 unless one or more tokens have been explicitly made errors.
10557 Otherwise, the above change causes Bison to abort.
10558
10559 * tests/existing.at (GNU pic Grammar): New test case, taken from
10560 Lemberg's email.
10561
b8be9132
AD
105622003-03-31 Akim Demaille <akim@epita.fr>
10563
10564 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
10565
d423d460
AD
105662003-03-31 Akim Demaille <akim@epita.fr>
10567
10568 * src/output.c (prepare_symbols): Avoid trailing spaces in the
10569 output.
10570
c7e441b4
AD
105712003-03-31 Akim Demaille <akim@epita.fr>
10572
10573 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
10574 From Paul Hilfinger.
10575
231897ad
AD
105762003-03-29 Akim Demaille <akim@epita.fr>
10577
10578 * m4/error.m4: Do not put under dynamic conditions some code which
10579 expansion is under static control.
10580
5b066063
AD
105812003-03-29 Akim Demaille <akim@epita.fr>
10582
10583 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
10584
22a74fec
AD
105852003-03-29 Akim Demaille <akim@epita.fr>
10586
10587 * doc/bison.texinfo (Strings are Destroyed): New.
10588
0eee27e7
PE
105892003-03-13 Paul Eggert <eggert@twinsun.com>
10590
10591 * .cvsignore: Add configure.lineno.
10592 * src/.cvsignore: Add yacc.
10593 * tests/.cvsignore: Add testsuite.log.
10594 * doc/fdl.texi: Sync with latest FSF version.
10595
f61aad93
PE
105962003-03-12 Paul Eggert <eggert@twinsun.com>
10597
537636c7
PE
10598 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
10599 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
10600 cursor, instead of leaving it undefined. This fixes a bug
10601 reported by Tim Van Holder in
161a71f3 10602 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
10603 * tests/input.at (Torturing the Scanner): Test the scanner on
10604 an empty input file, which was Tim Van Holder's test case.
10605
10606 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
10607 <sys/resource.h> can be included, include sys/time.h and
10608 sys/times.h first, if available. This works around the SunOS
10609 4.1.4 porting bug reported by Bruce Becker in
161a71f3 10610 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
10611
10612 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
10613 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
10614 AC_HEADER_SYS_WAIT.
10615
f61aad93
PE
10616 Merge changes from gnulib. This was prompted because the CVS
10617 snapshot didn't build on Solaris 7 due to strnlen problems.
10618
10619 These changes need to be merged back into gnulib:
10620 * lib/hash.c: Include <stdbool.h> unconditionally.
10621 * m4/onceonly.m4 (m4_quote): New macro.
10622 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
10623 Quote AC_FOREACH variable-expansions properly.
10624 The 2003-01-03 obstack.h change also needs merging.
10625 {end of changes requiring merging}
5b066063 10626
f61aad93
PE
10627 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10628 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
10629 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
10630 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
10631 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
10632 New files, imported from gnulib.
10633 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
10634 above.
10635
10636 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
10637 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
10638 gnulib sources.
10639
10640 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
10641 Add.
10642 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
10643 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
10644 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
10645 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
10646 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
10647 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
10648 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
10649 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
10650 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
10651 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
10652 (jm_PREREQ_ARGMATCH): Remove.
10653 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
10654 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
10655
10656 * src/system.h: Include <stdbool.h> unconditionally.
10657
10658 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
10659 assuming at least C89 in the bitset code for some time now.
10660
d2ffe116
AD
106612003-03-03 Akim Demaille <akim@epita.fr>
10662
10663 * ro.po: New.
10664
052826fd
AD
106652003-03-02 Akim Demaille <akim@epita.fr>
10666
10667 * doc/bison.texinfo (Table of Symbols): Reactivate the
10668 documentation for %lex-param, and %parse-param.
10669
c4749565
AD
106702003-03-02 Akim Demaille <akim@epita.fr>
10671
10672 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
10673 generate verbose error messages.
10674 Use the number of tokens as an upper bound in yytname, as it
10675 cannot be a non terminal.
10676
d5286af1
AD
106772003-03-02 Akim Demaille <akim@epita.fr>
10678
10679 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
10680 message.
10681
22e304a6
AD
106822003-03-02 Akim Demaille <akim@epita.fr>
10683
22e304a6
AD
10684 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
10685 Use them to exercise yycheck overrun.
10686 Based on Andrew Suffield's grammar.
10687
67a25fed
AD
106882003-03-02 Akim Demaille <akim@epita.fr>
10689
10690 Create tests/local.at for Bison generic testing macros.
10691
10692 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
10693 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
10694 This new file.
10695 * tests/calc.at (AT_CHECK_CALC): Adjust.
10696 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
10697 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
10698 * tests/local.at: here.
10699 (AT_COMPILE_CXX): Tags the tests using it as c++.
10700 Ignore the test if CXX is not functional.
10701
9c2b381f
PE
107022003-03-01 Paul Eggert <eggert@twinsun.com>
10703
10704 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
10705 not loc->end, since loc->end might contain garbage and this leads
10706 to undefined behavior on some platforms.
10707 (id_loc, token_start): Use (IF_LINTed) initial values that do not
10708 depend on *loc, so that the reader doesn't give the the false
10709 impression that *loc is initialized.
10710 (<INITIAL>"%%"): Do not bother setting code_start, since its value
10711 does not survive the return.
10712
0433ba88
AD
107132003-03-01 Akim Demaille <akim@epita.fr>
10714
10715 * src/scan-gram.l (code_start): Always initialize it when entering
10716 into yylex, as SC_EPILOGUE is activated *before* the corresponding
10717 yylex invocation. An alternative would be making it static, but
10718 then it starts with the second %%'s beginning, instead of its end.
10719
b305ea69
PE
107202003-02-28 Paul Eggert <eggert@twinsun.com>
10721
10722 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
10723 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 10724 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 10725
c3d25e01
PE
107262003-02-26 Paul Eggert <eggert@twinsun.com>
10727
10728 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
10729 Remove Sequent/Pyramid discussion (nobody uses them any more).
10730 Merge VMS and MS-DOS discussion; these ports may well be dead
10731 but let's keep mentioning them for now. Put <> around email
10732 addresses. Add copyright notice.
10733
c267ffbc
PE
107342003-02-24 Paul Eggert <eggert@twinsun.com>
10735
10736 * data/glr.c (yy_reduce_print): yylineno -> yylno,
10737 to avoid collision with flex use of yylineno.
10738 Problem reported by Bruce Lilly in
161a71f3 10739 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
10740 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
10741 * data/yacc.c (yy_reduce_print): Likewise.
10742
10743 * config/depcomp: Sync with Automake 1.7.3.
10744
f939fc12
AD
107452003-02-21 Akim Demaille <akim@epita.fr>
10746
10747 * data/lalr1.cc: Use temporary variables instead of casts to
10748 change integer types.
10749 Suggested by Paul Eggert.
10750
95923bd6
AD
107512003-02-21 Akim Demaille <akim@epita.fr>
10752
10753 * doc/bison.texinfo: Use "location" consistently to refer to @n,
10754 to avoid confusions with lalr1.cc's notion of Position.
10755 Suggested by Paul Eggert.
10756
2cdc240e
AD
107572003-02-20 Akim Demaille <akim@epita.fr>
10758
10759 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
10760 before initial_columns.
10761 (location.hh): Use consistent variable names when defining the
10762 operator<<.
10763 Use "last" so that we subtract from Positions, not from unsigned.
10764
5d003116
AD
107652003-02-20 Akim Demaille <akim@epita.fr>
10766
10767 * data/lalr1.cc (position.hh): New subfile, including the extended
10768 and Doxygen'ed documentation of class Position.
10769 (location.hh): Use it.
10770 Document a` la Doxygen.
ba1ecc07 10771 With the help of Benoit Perrot.
5d003116 10772
d02b25f9
AD
107732003-02-20 Akim Demaille <akim@epita.fr>
10774
10775 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
10776 AT_YACC_IF.
10777 Redefine AT_YYERROR_SEES_LOC_IF using it.
10778 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
10779 not defined.
10780 Don't use the location in yy::Parser::error_ and
10781 yy::Parser::print_ when not %locations.
10782 Activate more lalr1.cc tests.
10783
0d1c3a04
AD
107842003-02-19 Akim Demaille <akim@epita.fr>
10785
10786 * data/lalr1.cc: When displaying a line number, be sure to make it
10787 an int.
10788
60a777aa
AD
107892003-02-19 Akim Demaille <akim@epita.fr>
10790
10791 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
10792 Remove, useless.
10793 (YYABORT, YYACCEPT, YYERROR): New.
10794 * tests/calc.at: Renable the lalr1.cc test.
10795
0b86fc41
AD
107962003-02-19 Akim Demaille <akim@epita.fr>
10797
10798 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
10799 error recovery, mixing with/without pops and discarding of the
10800 lookahead.
10801 Exercise YYERROR.
10802 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
10803
da99a5dc
PE
108042003-02-17 Paul Eggert <eggert@twinsun.com>
10805
10806 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
10807 * tests/testsuite.at (AT_COMPILE): Use them.
10808 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 10809 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 10810
93b8c255
PE
108112003-02-12 Paul Eggert <eggert@twinsun.com>
10812
10813 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
10814 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 10815 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
10816 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
10817 Check for malloc failure, for consistency with yacc.c.
10818 (yytname_size): Remove, for consistency with yacc.c.
10819
10820 The bug still remains in data/lalr1.cc, as I didn't have time
10821 to fix it there.
10822
7548fed2
AD
108232003-02-06 Akim Demaille <akim@epita.fr>
10824
10825 * configure.ac (GXX): Rename as...
10826 (CXX): this, to keep the original Autoconf semantics.
10827 Require 2.57.
10828 * data/lalr1.cc: Fix b4_copyright invocations.
10829 If YYDEBUG is not defined, don't depend upon name_ being defined.
10830 (location.hh): Include string and iostream.
10831 (Position::filename): New member.
10832 (Position::Position ()): New.
10833 (operator<< (Position)): New.
10834 (operator- (Position, int)): New.
10835 (Location::first, Location::last): Rename as...
10836 (Location::begin, Location::end): these, to mock the conventional
10837 iterator names.
10838 (operator<< (Location)): New.
10839 * tests/atlocal.in (CXX): New.
10840 * tests/testsuite.at (AT_COMPILE_CXX): New.
10841 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
10842 locations in a more synthetic way.
10843 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
10844 lalr1.cc is used.
10845 Adjust the C locations to match those from Emacs: first column is
10846 column 0.
10847 Change all the expected results.
10848 Conform to the GCS: simplify the locations when applicable.
10849 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
10850 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
10851 these CPP macros with the m4 macros new defined by...
10852 (AT_CHECK_PUSHDEFS): this, i.e.:
10853 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 10854 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
10855 New macros.
10856 (AT_CHECK_POPDEFS): Undefine them.
10857 (AT_CHECK_CALC_LALR1_CC): New.
10858 Use it for the first lalr1.cc test.
10859
43a176ef
AD
108602003-02-04 Akim Demaille <akim@epita.fr>
10861
10862 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
10863 Location as is defined.
10864
fc049e9c
AD
108652003-02-04 Akim Demaille <akim@epita.fr>
10866
10867 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
10868 name_ being defined.
10869
a737b216
PE
108702003-02-03 Paul Eggert <eggert@twinsun.com>
10871
10872 * src/gram.h (start_symbol): Remove unused decl.
10873
10874 Use more-consistent naming conventions for local vars.
10875
10876 * src/derives.c (derives_compute): Change type of local var from
10877 int to rule_number.
10878 * src/gram.c (grammar_rules_partial_print): Likewise.
10879 * src/print.c (print_core): Likewise.
10880 * src/reduce.c (reduce_grammar_tables): Likewise.
10881
10882 * src/gram.c (grammar_dump): Change name of item_number *
10883 local var from r to rp.
10884 * src/nullable.c (nullable_compute): Likewise.
10885
10886 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
10887
10888 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
10889 for symbol or symbol_number var.
10890 * src/reader.c (grammar_start_symbol_set): Likewise.
10891 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
10892 Likewise.
10893 * src/state.c (transitions_to): Likewise.
10894 * src/state.h: Likewise.
10895 * src/tables.c (symbol_number_to_vector_number): Likewise.
10896
10897 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
10898 char * var.
10899
10900 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
10901 var.
10902
10903 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
10904 var.
10905
10906 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
10907 Use str, not s, for char * var. Use ch, not c, for character var.
10908 Use size for size var.
10909
10910 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
10911 char * var.
10912 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
10913 uniqstr var.
10914 * src/uniqstr.h: Likewise.
10915
10916 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10917 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10918 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
10919 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
10920 param to have same name as that of enum, so that we don't use
10921 "s" to stand for a non-state.
10922
68e93ad5
AD
109232003-02-02 Akim Demaille <akim@epita.fr>
10924
10925 * src/scan-skel.l: Scan more than one inert character per yylex
10926 invocation.
10927
92898986
PE
109282003-02-01 Paul Eggert <eggert@twinsun.com>
10929
10930 Version 1.875a.
10931
1d9d5d71
PE
10932 * po/LINGUAS: Add ms.
10933
0435d061
AD
109342003-01-30 Akim Demaille <akim@epita.fr>
10935
10936 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
10937
6029a57f
PH
109382003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10939
10940 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
10941 of $1.
0435d061
AD
10942
10943 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 10944 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 10945 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 10946
6029a57f
PH
10947 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
10948 (b4_rhs_location): Ditto.
0435d061 10949 (yyfill): New function to copy from stack tree into array
6029a57f 10950 incrementally.
0435d061
AD
10951 (yyuserAction): Modify to allow incremental move of semantic values
10952 to rhs array when in GLR mode.
10953 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
10954 as needed.
10955 Remove dummy use of yystack, as there is now a guaranteed use.
10956 (yydoAction): Modify to allow incremental move of semantic values
10957 to rhs array when in GLR mode.
10958 (yyresolveAction): Ditto.
10959 (yyglrShiftDefer): Update comment.
0435d061 10960 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
10961 (yyglrReduce): Ditto.
10962 (yydoAction): Ditto
0435d061 10963
6029a57f
PH
10964 * tests/glr-regr1.at: Rename to ...
10965 * tests/glr-regression.at: Add new regression test for the problems
10966 described above (adapted from S. Eken).
10967 Update copyright notice.
10968 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
10969 * tests/Makefile.am: Ditto.
10970
6cee6297
PE
109712003-01-28 Paul Eggert <eggert@twinsun.com>
10972
10973 * data/lalr1.cc: Do not use @output_header_name@ unless
10974 b4_defines_flag is set. This fixes two bugs reported by
10975 Tim Van Holder in
161a71f3
PE
10976 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
10977 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 10978
b2a836b5
PE
109792003-01-21 Paul Eggert <eggert@twinsun.com>
10980
10981 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
10982 we don't need to worry about yyerrlab1 being reported as an
10983 "unused label" by non-GCC C compilers. The downside is that if
10984 locations are used then a couple of statements are duplicated each
10985 time YYERROR is invoked, but the upside is that the warnings
10986 should vanish.
10987 (yyerrlab1): Move code to YERROR.
10988 (yyerrlab2): Remove. Change uses back to yyerrlab1.
10989 This reverts some of the 2002-12-27 change.
10990
4196b931
PE
109912003-01-17 Paul Eggert <eggert@twinsun.com>
10992
10993 * src/output.c (symbol_printers_output): Fix typo that led
10994 to core dump. Problem reported by Antonio Rus in
161a71f3 10995 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 10996
3ae831b4
AD
109972003-01-13 Akim Demaille <akim@epita.fr>,
10998 Quoc Peyrot <chojin@lrde.epita.fr>,
10999 Robert Anisko <anisko_r@lrde.epita.fr>
11000
11001 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11002 when the stacks contain one element, as the loop would otherwise
11003 free the last state, and then use the top state (the one we just
11004 popped). This means that the initial elements will not be freed
11005 explicitly, as is the case in yacc.c; it is not a problem, as
11006 these elements have fake values.
11007
e3aa65c5
PE
110082003-01-11 Paul Eggert <eggert@twinsun.com>
11009
11010 * NEWS: %expect-violations are now just warnings, reverting
11011 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11012 bootstrapping problem reported by Matthias Klose; see
161a71f3 11013 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
11014 * src/conflicts.c (conflicts_print): Likewise.
11015 * tests/conflicts.at (%expect not enough, %expect too much,
11016 %expect with reduce conflicts): Likewise.
11017 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11018 that the warning is enabled if the number of conflicts changes
11019 (not necessarily increases).
11020
11021 * src/getargs.c (version): Update copyright year.
11022
f0057011
AD
110232003-01-09 Akim Demaille <akim@epita.fr>
11024
11025 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11026
1ee6d2a0
PE
110272003-01-08 Paul Eggert <eggert@twinsun.com>
11028
11029 * Makefile.maint (WGETFLAGS):
11030 New macro, containing "-C off" to disable proxy caches.
11031 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11032 (rel-check): Use $(WGET) instead of wget.
11033
d4fd77c4
PE
110342003-01-06 Paul Eggert <eggert@twinsun.com>
11035
11036 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11037 the GLR paper of Scott, Johnstone and Hussain.
11038
464c6927
PE
110392003-01-04 Paul Eggert <eggert@twinsun.com>
11040
d600ee67
PE
11041 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11042 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11043 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11044 (EXTRA_LIBRARIES): New var, for liby.a.
11045 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11046 (EXTRA_SCRIPTS): New var, for yacc.
11047
464c6927
PE
11048 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11049 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11050 Problem reported by Nelson H. F. Beebe.
11051
110522003-01-03 Paul Eggert <eggert@twinsun.com>
11053
11054 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11055 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11056 when compiling Bison 1.875's `bitset bset = obstack_alloc
11057 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11058
11059 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11060 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11061 grow to a huge size with typical invocation.
d600ee67 11062
464c6927
PE
11063 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11064 Use the pattern recommended by Autoconf 2.57, except also protect
11065 against double-definition.
11066 * src/system.h: Likewise.
11067 Portability issues reported by Nelson H. F. Beebe.
d600ee67 11068
464c6927
PE
11069 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11070 All uses changed. Provide a definition in both C and C++.
11071 (yytrue, yyfalse): Define even if defined (__cplusplus).
11072
11073 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11074 Reported by Nelson H. F. Beebe.
d600ee67 11075
464c6927
PE
11076 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11077
0f42c7d5
PE
110782003-01-02 Paul Eggert <eggert@twinsun.com>
11079
11080 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11081 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11082 Bug reported by Nelson H. F. Beebe.
11083
dc546b0f
PE
110842003-01-01 Paul Eggert <eggert@twinsun.com>
11085
11086 * Version 1.875.
11087
2c09b6a7
PE
110882002-12-30 Paul Eggert <eggert@twinsun.com>
11089
11090 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11091 Moved here from...
11092 (<INITIAL>","): Here. This causes stray "," to be treated
11093 more uniformly.
11094
dc546b0f 11095 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
11096 last brace in braced code when not in Yacc mode, for compatibility
11097 with Bison 1.35. This resurrects the 2001-12-15 patch to
11098 src/reader.c.
11099
11100 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11101 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11102
535c0f63
PE
111032002-12-28 Paul Eggert <eggert@twinsun.com>
11104
11105 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11106 that of SYM's type. This fixes Debian bug 168069, reported by
11107 Thomas Olsson.
d600ee67 11108
963fcc17
PE
111092002-12-28 Paul Eggert <eggert@twinsun.com>
11110
11111 Version 1.75f.
11112
11113 Switch back to the Yacc style of conflict reports, undoing some
11114 of the 2002-07-30 change.
11115 * doc/bison.texinfo (Understanding): Use Yacc style for
11116 conflict reports. Also, use new way of locating rules.
11117 * src/conflicts.c (conflict_report):
11118 Renamed from conflict_report_yacc, removing the old
11119 'conflict_report'. Translate the entire conflict report at once,
11120 so that we don't assume that "," has the same interpretation in
11121 all languages.
11122 (conflicts_output): Use Yacc-style conflict report for each state,
11123 instead of our more-complicated style.
11124 (conflicts_print): Use Yacc-style conflict report, except print
11125 the input file name when not emulating Yacc.
11126 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11127 Conflicted Reduction, %expect not enough, %expect too much,
11128 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11129 * tests/existing.at (GNU Cim Grammar): Likewise.
11130 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11131
11132 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11133 fatal): Don't invoke fflush; it's not needed and it might even be
11134 harmful for stdout, as stdout might not be open.
11135 * src/reduce.c (reduce_print): Likewise.
11136
b1efe548
PE
111372002-12-27 Paul Eggert <eggert@twinsun.com>
11138
11139 Fix a bug where error locations were not being recorded correctly.
11140 This problem was originally reported by Paul Hilfinger in
161a71f3 11141 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
11142
11143 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11144 top of the location stack's error locations.
11145 (yyerrlab): Set it. When discarding a token, push its location
11146 onto yylerrsp so that we don't lose track of the error's end.
11147 (yyerrlab1): Now is only the target of YYERROR, so that we can
11148 properly record the location of the action that failed. For GCC
11149 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11150 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11151 (yyerrlab2): New label, which yyerrlab now falls through to.
11152 Compute the error's location by applying YYLLOC_DEFAULT to
11153 the locations of all the symbols that went into the error.
11154 * doc/bison.texinfo (Location Default Action): Mention that
11155 YYLLOC_DEFAULT is also invoked for syntax errors.
11156 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11157 Error locations include the locations of all the tokens that were
11158 discarded, not just the last token.
d600ee67 11159
983c5c2c
PE
111602002-12-26 Paul Eggert <eggert@twinsun.com>
11161
b1efe548
PE
11162 * src/files.c: Include quote.h.
11163 (compute_output_file_names): Warn if we detect conflicting
11164 outputs to the same file. This should catch the misunderstanding
11165 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11166
11167 * src/conflicts.c (conflicts_print): If the user specifies
11168 "%expect N", report an error if there are any reduce/reduce
11169 conflicts. This is what the manual says should happen.
11170 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11171 * tests/conflicts.at (%expect with reduce conflicts): New test.
11172
983c5c2c
PE
11173 Don't use m4_include on relative file names, as it doesn't work as
11174 desired if there happens to be a file with that name under ".".
d600ee67 11175
983c5c2c
PE
11176 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11177 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11178 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11179 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11180 * src/output.c (output_skeleton): Use full path names when
11181 specifying a file to include; don't rely on include path, as
11182 it's unreliable when the working file contains a file with
11183 that name.
d600ee67 11184
983c5c2c
PE
111852002-12-25 Paul Eggert <eggert@twinsun.com>
11186
11187 Remove obsolete references to bison.simple and bison.hairy.
11188 Problem mentioned by Aubin Mahe in
161a71f3 11189 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
11190 * data/glr.c: Comment fix.
11191 * doc/bison.1: Remove references. Also, mention "yacc".
11192
11193 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11194 with -g option.
11195
11196 * src/parse-gram.y (declaration): Use enum "report_states" rather
11197 than its numeric value 1.
11198
11199 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11200 opening a new one. This fixes Debian bug 165349, reported by
11201 Bruce Stephens.
11202
23f2d9dc
PE
112032002-12-24 Paul Eggert <eggert@twinsun.com>
11204
11205 Version 1.75e.
11206
11207 * Makefile.maint (cvs-update): Don't assume that the shell
11208 supports $(...), as Solaris sh doesn't.
11209
11210 * src/parse-gram.y (lloc_default): Remove test for empty
11211 nonterminals at the end, since it didn't change the result.
11212
112132002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
11214
11215 If the user does not define YYSTYPE as a macro, Bison now declares it
11216 using typedef instead of defining it as a macro. POSIX requires this.
11217 For consistency, YYLTYPE is also declared instead of defined.
11218
11219 %union directives can now have a tag before the `{', e.g., the
11220 directive `%union foo {...}' now generates the C code
11221 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11222 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11223 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11224 instead of `yyltype'.
11225
11226 `yystype' and `yyltype' are now obsolescent macros instead of being
11227 typedefs or tags; they are no longer documented and will be
11228 withdrawn in a future release.
11229
11230 * data/glr.c (b4_location_type): Remove.
11231 (YYSTYPE): Renamed from yystype.
11232 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11233 (struct YYLTYPE): Renamed from struct yyltype.
11234 (YYLTYPE): Renamed from yyltype.
11235 (yyltype, yystype): New (and obsolescent) macros,
11236 for backward compatibility.
11237 * data/yacc.c: Likewise.
11238
11239 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11240 does not specify a union tag. This is for compatibility with
11241 Solaris 9 yacc.
11242
11243 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11244 const *, since it is now modified by stripping surrounding { }.
11245 (current_braced_code): Remove.
11246 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11247 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11248 trailing " {...}". Now of type <chars>.
11249 (grammar_declaration): Adjust to bundled tokens.
11250 (code_content): Remove; stripping is now done by add_param.
11251 (print_token_value): Print contents of bundled tokens.
11252 (token_name): New function.
11253
11254 * src/reader.h (braced_code, current_braced_code): Remove.
11255 (token_name): New decl.
11256
11257 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11258 token_type, not braced_code code_kind. All uses changed.
11259 (SC_PRE_CODE): New state, for scanning after a keyword that
11260 has (or usually has) an immediately-following braced code.
11261 (token_type): New local var, to keep track of which token type
11262 to return when scanning braced code.
11263 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 11264 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
11265 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11266 instead of returning a token type immediately.
11267 (<INITIAL>"{"): Set token type.
11268 (<SC_BRACED_CODE>"}"): Use it.
11269 (handle_action_dollar, handle_action_at): Now returns bool
11270 indicating success. Fail if ! current_rule; this prevents a core dump.
11271 (handle_symbol_code_dollar, handle_symbol_code_at):
11272 Remove; merge body into caller.
11273 (handle_dollar, handle_at): Complain in invalid contexts.
11274
11275 * NEWS, doc/bison.texinfo: Document the above.
11276 * NEWS: Fix years and program names in copyright notice.
11277
879ca4f8
PE
112782002-12-17 Paul Eggert <eggert@twinsun.com>
11279
11280 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11281 Reporting, Table of Symbols): Omit mentions of %lex-param and
11282 %parse-param from the documentation for now.
11283
1c5fe69d
PE
112842002-12-15 Paul Eggert <eggert@twinsun.com>
11285
11286 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11287 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11288 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
11289 disagreed with the Bison documentation. Bug
11290 reported by Andrew Walrond.
d600ee67 11291
1c5fe69d
PE
11292 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
11293 as the caller now does that.
11294 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
11295 (YYEMPTY): Parenthesize right hand side, since others use it.
11296 (yyparse): Don't assume that our generated code is the only code
11297 that sets yychar.
11298
d1de5372
PE
112992002-12-13 Paul Eggert <eggert@twinsun.com>
11300
11301 Version 1.75d.
11302
11303 POSIX requires a "yacc" command.
11304 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
11305 (MOSTLYCLEANFILES): Add yacc.
11306 (yacc): New rule.
1c5fe69d 11307 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
11308 as an alias for bison y.
11309
11310 * po/LINGUAS: Add da.
d600ee67 11311
d1de5372
PE
11312 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
11313 problem with latest <getopt.h>.
11314 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
11315
11316 * doc/fdl.texi: Upgrade to 1.2.
11317 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
11318 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
11319 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
11320 gnulib.
11321 * config/install-sh: Sync with autotools.
11322
11323 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 11324 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
11325 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
11326 locations are requested.
11327 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
11328 locations are requested.
11329
d0f3fe23
PE
113302002-12-12 Paul Eggert <eggert@twinsun.com>
11331
11332 Remove unportable casts and storage allocation tricks.
11333 While we're at it, remove almost all casts, since they
11334 usually aren't needed and are a sign of trouble.
11335
11336 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
11337
11338 * src/derives.c (derives_compute): Do not subtract NTOKENS from
11339 the pointer DSET returned by malloc; this isn't portable.
11340 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
11341 Similarly for DERIVES.
11342 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
11343 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
11344 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
11345
11346 * src/derives.c (derives_compute): Do not bother invoking
11347 int_of_rule_number, since rule numbers are integers.
11348
11349 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
11350 rather than XMALLOC (char, N).
11351
11352 * src/files.c (filename_split): Rewrite to avoid cast.
11353
11354 * src/gram.h (symbol_number_as_item_number,
11355 item_number_as_symbol_number, rule_number_as_item_number,
11356 item_number_as_rule_number):
11357 Now inline functions rather than macros, to avoid casts.
11358 * src/state.h (state_number_as_int): Likewise.
11359 * src/tables.c (state_number_to_vector_number,
11360 symbol_number_to_vector_number): Likewise.
11361
11362 * src/gram.h (int_of_rule_number): Remove; no longer used.
11363
11364 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
11365 since the resulting storage is always stored into.
11366
11367 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
11368 where it's needed.
11369
11370 * src/muscle_tab.c (muscle_m4_output):
11371 Now inline. Return bool, not int.
11372 * src/state.c (state_compare): Likewise.
11373 * src/symtab.c (symbol_check_defined,
11374 symbol_check_alias_consistency, symbol_pack, symbol_translation,
11375 hash_compare_symbol, hash_symbol):
11376 Likewise.
11377 * src/uniqstr.c (uniqstr_print): Likewise.
11378 * src/muscle_tab.c (muscle_m4_output_processor):
11379 New function, to avoid casts.
11380 * src/state.c (state_comparator, stage_hasher): Likewise.
11381 * src/symtab.c (symbol_check_defined_processor,
11382 symbol_check_alias_consistency_processor, symbol_pack_processor,
11383 symbol_translation_processor, hash_symbol_comparator,
11384 hash_symbol_hasher): Likewise.
11385 * src/uniqstr.c (uniqstr_print_processor): Likewise.
11386 * src/muscle_tab.c (muscles_m4_output):
11387 Use new functions instead of casting old functions unportably.
11388 * src/state.c (state_hash_new): Likewise.
11389 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
11390 symbols_token_translations_init):
11391 Likewise.
11392 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
11393
11394 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
11395 var instead of casting to long, to avoid casts.
11396 (prepare_states): Use MALLOC rather than alloca, so that we don't
11397 have to worry about alloca.
11398 * src/state.c (state_hash_lookup): Likewise.
11399
11400 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
11401 local var instead of casting to unsigned char, to avoid casts.
11402
11403 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
11404 STATE_ALLOC): Remove.
11405 (transitions_new, errs_new, reductions_new, state_new): Use malloc
11406 rather than calloc, and use offsetof to avoid allocating slightly
11407 too much storage.
11408 (state_new): Initialize all members.
11409
11410 * src/state.c (state_hash): Use unsigned accumulator, not signed.
11411
11412 * src/symtab.c (symbol_free): Remove; unused.
11413 (symbol_get): Remove cast in lhs of assignment.
11414 (symbols_do): Now static. Accept generic arguments, not
11415 hashing-related ones.
11416
11417 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
11418 (symbol_processor): Remove.
11419 (symbols_do): Remove decl; now static.
11420
11421 * src/system.h (alloca): Remove; decl no longer needed.
11422 (<stddef.h>): Include, for offsetof.
11423 (<inttypes.>, <stdint.h>): Include if available.
11424 (uintptr_t): New type, if system lacks it.
11425 (CALLOC, MALLOC, REALLOC): New macros.
11426 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
11427 new macros.
11428
11429 * src/tables.c (table_size): Now int, to pacify GCC.
11430 (table_grow, table_ninf_remap): Use signed table size.
11431 (save_row): Don't bother initializing locals when not needed.
11432 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
11433 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
11434
11435 * src/vcg.h: Correct misspellings.
11436
11437 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
11438
11439
11440 * src/getargs.c (getargs): Don't assume EOF == -1.
11441
26b4a969
PE
114422002-12-09 Paul Eggert <eggert@twinsun.com>
11443
11444 Change identifier spellings to avoid collisions with names
11445 that are reserved by POSIX.
11446
11447 Don't use names ending in _t, since POSIX reserves them.
11448 For consistency, remove _e and _s endings -- they're weren't
11449 needed to remove ambiguity. All uses changed.
11450 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
11451 turn was just renamed from struniq_t.
11452 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
11453 which in turn was just renamed from struniq_processor_t.
11454 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
11455 in turn was renamed from hash_compare_struniq_t.
11456 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
11457 (state_list): Renamed from state_list_t.
11458 * src/assoc.h (assoc): Renamed from assoc_t.
11459 * src/conflicts.c (enum conflict_resolution): Renamed from
11460 enum conflict_resolution_e.
11461 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
11462 (rule_list): Renamed from rule_list_t.
11463 * src/getargs.h (enum trace): Renamed from enum trace_e.
11464 (enum report): Renamed from enum report_e.
11465 * src/gram.h (item_number): Renamed from item_number_t.
11466 (rule_number): Renamed from rule_number_t.
11467 (struct rule_s): Remove the "rule_s" part; not used.
11468 (rule): Renamed from rule_t.
11469 (rule_filter): Renamed from rule_filter_t.
11470 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
11471 (goto_list): Renamed from goto_list_t.
11472 * src/lalr.h (goto_number): Renamed from goto_number_t.
11473 * src/location.h (location): Renamed from location_t.
11474 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
11475 and moved here from:
11476 * src/muscle_tab.h (muscle_entry_t): here.
11477 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
11478 (rule_list): Renamed from rule_list_t.
11479 * src/print_graph.c (static_graph): Renamed from graph.
11480 * src/reader.h (braced_code): Renamed from braced_code_t.
11481 Remove brace_code_e tag.
11482 * src/relation.h (relation_node): Renamed from relation_node_t.
11483 (relation_nodes): Renamed from relation_nodes_t.
11484 (relation): Renamed from relation_t.
11485 * src/state.h (state_number): Renamed from state_number_t.
11486 (struct state): Renamed from struct state_s.
11487 (state): Renamed from state_t.
11488 (transitions): Renamed from transitions_t. Unused (and
11489 misspelled) transtion_s tag removed.
11490 (errs): Renamed from errs_t. Unused errs_s tag removed.
11491 (reductions): Renamed from reductions_t. Unused tag
11492 reductions_s removed.
11493 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
11494 (struct symbol_list): Renamed from struct symbol_list_s.
11495 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
11496 (struct symbol): Renamed from struct symbol_s.
11497 (symbol): Renamed from symbol_t.
11498 * src/tables.c (vector_number): Renamed from vector_number_t.
11499 (action_number): Renamed from action_t.
11500 * src/tables.h (base_number): Renamed from base_t.
11501 * src/vcg.h (enum color): Renamed from enum color_e.
11502 (enum textmode): Renamed from enum textmode_e.
11503 (enum shape): Renamed from enum shape_e.
11504 (struct colorentry): Renamed from struct colorentry_s.
11505 (struct classname): Renamed from struct classname_s.
11506 (struct infoname): Renamed from struct infoname_s.
11507 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
11508 (enum decision): Renamed from enum decision_e.
11509 (enum orientation): Renamed from enum orientation_e.
11510 (enum alignment): Renamed from enum alignment_e.
11511 (enum arrow_mode): Renamed from enum arrow_mode_e.
11512 (enum crossing_type): Renamed from enum crossing_type_e.
11513 (enum view): Renamed from enum view_e.
11514 (struct node): Renamed from struct node_s.
11515 (node): Renamed from node_t.
11516 (enum linestyle): Renamed from enum linestyle_e.
11517 (enum arrowstyle): Renamed from enum arrowstyle_e.
11518 (struct edge): Renamed from struct edge.
11519 (edge): Renamed from edge_t.
11520 (struct graph): Renamed from struct graph_s.
11521 (graph): Renamed from graph_t.
11522 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
11523 Rename value_t -> value.
11524 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
11525 value_t_as_yystype -> value_as_yystype.
11526
11527 Don't include <errno.h> in the mainstream code, since it
11528 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
11529 * lib/get-errno.c, lib/get-errno.h: New files.
11530 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
11531 get-errno.c.
11532 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
11533 * src/output.c (output_skeleton): Likewise.
11534 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
11535 instead of errno.
11536 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
11537 Likewise.
11538 (handle_action_dollar, handle_action_at): Likewise.
11539 * src/system.h: Do not include <errno.h>.
11540 (TAB_EXT): Renamed from EXT_TAB.
11541 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
11542
11543 Avoid str[a-z]*, since <string.h> reserves that name space.
11544 Change all instances of "struniq" in names to "uniqstr", and
11545 likewise for "STRUNIQ" and "UNIQSTR".
11546 * src/uniqstr.c: Renamed from src/struniq.c.
11547 * src/uniqstr.h: Renamed from src/struniq.h.
11548 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
11549 * src/files.c (strsuffix): Remove; unused.
11550 (concat2): Renamed from stringappend. Now static.
11551 * src/files.h (strsuffix, stringappend): Remove; unused.
11552 * src/parse-gram.y (<chars>): Renamed from <string>.
11553 (<uniqstr>): Renamed from <struniq>.
11554 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
11555 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
11556 (struct graph_s.expand): Renamed from struct graph_s.stretch.
11557 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
11558 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
11559 (N_EXPAND): Renamed from N_STRETCH.
11560
11561 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
11562 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
11563 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
11564 Remove; unused.
11565 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
11566 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
11567 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
11568 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
11569 (BASE_MAXIMUM): Renamed from BASE_MAX.
11570 (BASE_MINIMUM): Renamed from BASE_MIN.
11571 (ACTION_MAX): Remove; unused.
11572 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
11573 Unnecessary casts removed from above defines.
11574
11575
11576 Fix misspelling in names.
11577 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
11578 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
11579 G_NODE_ALIGNEMENT.
11580
11581
11582 * lib/timevar.c (timevar_report): Renamed from time_report,
11583 for consistency with other names.
11584 * lib/timevar.h (timevar_report): New decl.
11585 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
11586
11587
11588 Sort include-file uses.
11589
11590 Reorder all include files under src to be in the order "system.h".
11591 then the ../lib include files in angle brackets (alphabetized),
11592 then the . include files in double-quotes (alphabetized). Fix
11593 dependency breakages encountered in this process, as follows:
11594 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
11595 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
11596 * src/state.h: Include "symtab.h".
11597
996b1c7e
PE
115982002-12-08 Paul Eggert <eggert@twinsun.com>
11599
11600 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
11601 since this causes problems when __file__ contains character
11602 sequences like "@" that are treated specially by src/scan-skel.l.
11603 Instead, just use the file's basename. This fixes the bug
11604 reported by Martin Mokrejs in
161a71f3 11605 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 11606
e19c4e5d
PE
116072002-12-06 Paul Eggert <eggert@twinsun.com>
11608
11609 Add support for rules that do not have trailing semicolons, as
11610 POSIX requires. Improve the quality of locations in Bison
11611 diagnostics.
26b4a969 11612
e19c4e5d
PE
11613 * src/location.c: Include <quotearg.h>.
11614 (empty_location): Now const.
11615 (location_print): New function. Follow the recommendation of the
11616 GNU Coding Standards for locations that span file boundaries.
11617 * src/location.h: Do not include <quotearg.h>; no longer needed.
11618 (boundary): New type.
11619 (location_t): Use it. This allows locations to span file boundaries.
11620 All member uses changed: file -> start.file or end.file (as needed),
11621 first_line -> start.line, first_column -> start.column,
11622 last_line -> end.line, last_column -> end.column.
11623 (equal_boundaries): New function.
11624 (LOCATION_RESET, LOCATION_STEP): Remove.
11625 (LOCATION_PRINT): Remove. All callers changed to use location_print.
11626 (empty_location): Now const.
11627 (location_print): New decl.
11628 * src/parse-gram.y (lloc_default): New function, which handles
11629 empty locations more accurately.
11630 (YYLLOC_DEFAULT): Use it.
11631 (%token COLON): Remove.
11632 (%token ID_COLON): New token.
26b4a969 11633 (rules): Use it.
e19c4e5d
PE
11634 (declarations, rules): Remove trailing semicolon.
11635 (declaration, rules_or_grammar_declaration):
11636 Allow empty (";") declaration.
11637 (symbol_def): Remove empty actions; no longer needed.
11638 (rules_or_grammar_declaration): Remove trailing semicolon.
11639 (semi_colon.opt): Remove.
11640 * src/reader.h: Include location.h.
11641 (scanner_cursor): New decl.
11642 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
11643 rolling our own.
11644 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
11645 of *loc.
11646 (STEP): Remove. No longer needed, now that adjust_location does
11647 the work. All uses removed.
11648 (scanner_cursor): New var.
11649 (adjust_location): Renamed from extend_location. It now sets
11650 *loc and adjusts the scanner cursor. All uses changed.
11651 Don't bother testing for CR.
11652 (handle_syncline): Remove location arg; now updates scanner cursor.
11653 All callers changed.
11654 (unexpected_end_of_file): Now accepts start boundary of token or
11655 comment, not location. All callers changed. Update scanner cursor,
11656 not the location.
11657 (SC_AFTER_IDENTIFIER): New state.
11658 (context_state): Renamed from c_context. All uses changed.
11659 (id_loc, code_start, token_start): New local vars.
11660 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
11661 processing of Yacc white space and equivalents here.
11662 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
11663 instead of returning ID immediately, since we need to search for
11664 a subsequent colon.
11665 (<INITIAL>"'", "\""): Save token_start.
11666 (<INITIAL>"%{", "{", "%%"): Save code_start.
11667 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
11668 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
11669 BEGIN context_state at end, not INITIAL.
11670 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
11671 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
11672 Return correct token start.
11673 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
11674 the start of a character, string or multiline comment is found.
11675 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
11676 Reduction): Adjust reported locations to match the more-precise
11677 results now expected.
11678 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
11679 * tests/reduce.at (Useless Rules, Reduced Automaton,
11680 Underivable Rules): Likewise.
11681 * tests/regression.at (Invalid inputs): No longer `expecting ";"
11682 or "|"' now that so many other tokens are allowed by the new grammar.
11683
11684 * src/complain.h (current_file): Remove duplicate decl;
11685 current_file is now owned by files.h.
11686 * src/complain.c, src/scan-gram.l: Include files.h.
11687
116882002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 11689
e19c4e5d
PE
11690 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
11691 promotes to int; it might be unsigned int.
11692 * data/yacc.c (yy_reduce_print): Likewise.
11693
11694 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
11695 be #defined in the prologue, not in the Bison declarations.
11696 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 11697
b64755e3
PE
116982002-12-02 Paul Eggert <eggert@twinsun.com>
11699
11700 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
11701 * lib/strtoul.c: New file, from gnulib.
11702 This fixes a porting bug reported by Peter Klein in
161a71f3 11703 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 11704
6e746484
PE
117052002-11-30 Paul Eggert <eggert@twinsun.com>
11706
b64755e3
PE
11707 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
11708 and put only a forward declaration in the prologue. This is for
11709 consistency with the other scanner helper functions.
11710
6ba55592
PE
11711 Type clashes now generate warnings, not errors, since it
11712 appears that POSIX may allow some grammars with type clashes.
11713 * src/reader.c (grammar_current_rule_check): Warn about
11714 type clashes instead of complaining.
11715 * tests/input.at (Type Clashes): Expect warnings, not complaints.
11716
6e746484
PE
11717 Add Yacc library, since POSIX requires it.
11718 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
11719 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
11720 * lib/main.c, lib/yyerror.c: New files.
11721
11722 gram_error can be static; it need not be extern.
11723 * src/reader.h (gram_error): Remove decl.
11724 * src/parse-gram.y (gram_error): Now static. Add static decl.
11725 (print_token_value): Omit parameter names from forward decl,
11726 for consistency.
11727
88510f9c
PE
117282002-11-29 Paul Eggert <eggert@twinsun.com>
11729
6e746484
PE
11730 * doc/bison.texinfo: Emphasize that yylex and yyerror must
11731 be declared before being used. E.g., one should typically
11732 declare them in the prologue. Use GNU coding style in examples.
11733 Put "const" consistently after the type it modifies. Mention
11734 that C99 supports "inline". Mention that yyerror traditionally
11735 returns "int".
11736
88510f9c
PE
11737 %parse-param and %lex-param now take just one argument, the
11738 declaration; the argument name is deduced from the declaration.
11739
11740 * doc/bison.texinfo (Parser Function, Pure Calling, Error
11741 Reporting, Table of Symbols): Document this.
11742 * src/parse-gram.y (add_param): New function.
11743 (COMMA): Remove.
11744 (declaration): Implement new rule for %parse-param and %lex-param.
11745 * src/scan-gram.l: "," now elicits a warning, rather than being
11746 a token; this is more compatible with byacc.
11747 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
11748
bb92250c
PE
117492002-11-27 Paul Eggert <eggert@twinsun.com>
11750
11751 Rename identifiers to avoid real and potential collisions.
11752
11753 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
11754 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 11755 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
11756 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11757 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
11758 * src/parse-gram.y (print_token_value): Renamed from yyprint.
11759 All uses changed.
11760 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
11761 The name "yycontrol" violates the name space rules, and this stuff
11762 wasn't being used anyway.
11763 (input): Remove action; this stuff wasn't being used.
11764 (gram_error): Rename local variable yylloc -> loc.
11765 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
11766 (YY_DECL): Don't use "yy" at start of local variables.
11767 All uses changed, e.g., yylloc -> loc.
11768 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
11769 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
11770 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
11771 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
11772
11773 * src/parse-gram.y (gram_error): loc is now const *.
11774 * src/reader.h (gram_error): Likewise.
11775
3af4feb2
PE
117762002-11-24 Paul Eggert <eggert@twinsun.com>
11777
11778 Version 1.75c.
11779
11780 * tests/actions.at (Actions after errors): Use an output format
11781 more similar to that of the Printers and Destructors test.
11782 Test the position of the ';' token too.
11783 (Printers and Destructors): Likewise.
11784 (Printers and Destructors: %glr-parser): Remove for now, to avoid
11785 unnecessarily alarming people when the test fails.
11786
11787 * data/yacc.c (yyerrlab1): Move this label down, so that the
11788 parser does not discard the lookahead token if the user code
11789 invokes YYERROR. This change is required for POSIX conformance.
11790
11791 * lib/error.c: Sync with gnulib.
11792
117932002-11-22 Paul Eggert <eggert@twinsun.com>
11794
11795 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
11796 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
11797 * lib/xmalloc.c: Likewise.
26b4a969 11798
58004308
PE
117992002-11-20 Paul Eggert <eggert@twinsun.com>
11800
11801 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
11802
118032002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 11804
58004308
PE
11805 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
11806 should use `if (! x) abort ();' rather than `assert (x);', and
11807 anyway it's one less thing to worry about configuring.
11808
11809 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
11810 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
11811 and replace all instances of assert with abort.
11812 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11813 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
11814
11815 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
11816 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
11817 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
11818 hash_find_entry, hash_rehash, hash_insert): Likewise.
11819 * src/conflicts.c (resolve_sr_conflict): Likewise.
11820 * src/lalr.c (set_goto_map, map_goto): Likewise.
11821 * src/nullable.c (nullable_compute): Likewise.
11822 * src/output.c (prepare_rules, token_definitions_output): Likewise.
11823 * src/reader.c (packgram, reader): Likewise.
11824 * src/state.c (state_new, state_free, state_transitions_set,
11825 state_reduction_find): Likewise.
11826 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
11827 symbol_pack): Likewise.
11828 * src/tables.c (conflict_row, pack_vector): Likewise.
11829 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11830 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11831 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
11832 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
11833
11834 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
11835 (ARGMATCH_CONSTRAINT): New macro.
11836 (ARGMATCH_ASSERT): Use it.
11837
11838 * src/system.h (verify): New macro.
11839 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
11840 rather than assert.
11841 * src/tables.c (tables_generate): Likewise.
11842
11843 * src/struniq.c (struniq_assert): Now returns void, and aborts
11844 if the assertion is false.
11845 (struniq_assert_p): Remove.
11846 * src/struniq.h: Likewise.
11847
76ae8198
PE
118482002-11-18 Paul Eggert <eggert@twinsun.com>
11849
11850 * data/glr.c (yygetLRActions): Replace `yyindex' with
11851 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
11852 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 11853 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 11854
d3c4e709
AD
118552002-11-18 Akim Demaille <akim@epita.fr>
11856
11857 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
11858 space.
11859 From Tim Van Holder.
11860
8d8a7238
PE
118612002-11-17 Paul Eggert <eggert@twinsun.com>
11862
11863 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
11864 to "SyntaxError" for consistency with my 2002-11-15 change.
11865
11866 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
11867 not define to {}, since this breaks the common use of `YYDPRINTF
11868 ((...));' if a single statement is desired (e.g. before `else').
11869 Work around GCC warnings by surrounding corresponding calls with
11870 {} if needed.
11871 (yyhasResolvedValue): Remove unused function.
11872 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
11873 loop body.
11874 (yyreportSyntaxError): Renamed from yyreportParseError.
11875 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
11876 All uses changed.
11877 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
11878 extern when possible. Remove unused initializations.
11879
b0937b22
AD
118802002-11-16 Akim Demaille <akim@epita.fr>
11881
11882 Augment the similarity between GLR and LALR traces.
11883
11884 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
11885 (YY_REDUCE_PRINT): New.
11886 (yyparse): Use them.
11887 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
11888 YYDPRINT here.
11889 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
11890 state reached after the reduction/recovery, since...
11891 (yyparse, yyprocessOneStack): Report the state we are entering in.
11892
c5e3e510
AD
118932002-11-16 Akim Demaille <akim@epita.fr>
11894
11895 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
11896 Add support for --trace=skeleton.
11897 * src/scan-skel.l: %option debug.
11898 Scan strings of non-@ or \n instead of character by character.
11899 (scan_skel): Handle trace_skeleton.
11900 (QPUTS): New.
11901 (@output_parser_name@, @output_header_name@): ``Restore'' their
11902 support (used to be M4 macros).
11903 * data/yacc.c: Quote larger chunks, a la glr.c.
11904 * data/lalr1.cc: Likewise.
11905 The header guards are no longer available, so use some other
11906 string than `YYLSP_NEEDED'.
11907
4c6cc1db
AD
119082002-11-16 Akim Demaille <akim@epita.fr>
11909
11910 Make the ``Printers and Destructors'' test more verbose, taking
11911 `yacc.c''s behavior as (possibly wrong) reference.
11912
11913 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
11914 instead of fprint on stdout.
11915 Set and report the last_line of the symbols.
11916 Consistently display values and locations.
11917
6d9e8019
PE
119182002-11-16 Paul Eggert <eggert@twinsun.com>
11919
11920 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
11921
6e649e65
PE
119222002-11-15 Paul Eggert <eggert@twinsun.com>
11923
b25d88f6
PE
11924 * tests/actions.at (Actions after errors): New test case.
11925
6e649e65
PE
11926 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
11927 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
11928 tests/action.at, tests/calc.at, tests/conflicts.at,
11929 tests/cxx-type.at, tests/regression.at:
11930 "parse error" -> "syntax error" for POSIX compatibility.
11931 "parsing stack overflow..." -> "parser stack overflow" so
11932 that code matches Bison documentation.
11933
0f39aab9
AD
119342002-11-15 Akim Demaille <akim@epita.fr>
11935
11936 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
11937 take two BRACED_CODE, not two string_content.
11938 Free the scanner's obstack when we are done.
11939 (code_content): New.
11940 * tests/calc.at: Adjust.
11941 * doc/bison.texinfo: Adjust.
11942 Also, make sure to include the `,' for these declarations.
11943
761c1926
AD
119442002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
11945
11946 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
11947 definition; avoids potential autoreconf problems.
11948
b0f98b10
AD
119492002-11-15 Akim Demaille <akim@epita.fr>
11950
11951 Always check the value returned by yyparse.
11952
11953 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
11954 returned by yyparse.
11955 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
11956 Adjust calls.
11957 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
11958 returned by yyparse.
11959
970785f1
PH
119602002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11961
11962 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
11963 on input.at test.
11964
8fcc7db1
PE
119652002-11-14 Paul Eggert <eggert@twinsun.com>
11966
7ec1b48e
PE
11967 * src/output.c (output_skeleton): Call xfopen instead of
11968 duplicating xfopen's body.
11969
cfff7583 11970 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 11971 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 11972
8fcc7db1
PE
11973 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
11974 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
11975 Group compiler. Instead, use "$CC -E bar.c". Include the .h
11976 file twice in the grammar, as an extra check.
11977
11978 * tests/input.at (Torturing the Scanner): Surround the
11979 backslash-newline tests with "#if 0", to make it less likely that
11980 we'll run into compiler bugs. Bring back solitary \ inside
11981 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 11982 test backslash-newline in C character constant.
8fcc7db1 11983
4e8d992c
AD
119842002-11-14 Akim Demaille <akim@epita.fr>
11985
11986 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
11987 status of the compiler.
f32b346d 11988 Calling `exit 1' is no longer needed.
4e8d992c
AD
11989 Reported by Nelson H. F. Beebe.
11990
9501dc6e
AD
119912002-11-14 Akim Demaille <akim@epita.fr>
11992
11993 * tests/atlocal.in (CPPFLAGS): We have config.h.
11994 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
11995 New.
11996 * tests/actions.at, tests/calc.at, tests/conflicts.at,
11997 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
11998 * tests/regression.at, tests/torture.at: Use them for all the
11999 grammars that are to be compiled.
12000 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12001 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12002 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12003
18b519c0
AD
120042002-11-14 Akim Demaille <akim@epita.fr>
12005
12006 * doc/bison.texinfo: Various formatting changes (alignments in
12007 samples, additional @group/@end group, GCS in samples.
12008 Use @deffn instead of simple @table to define the directives,
12009 macros, variables etc.
12010
9a86cdb9
PE
120112002-11-13 Paul Eggert <eggert@twinsun.com>
12012
daa33def 12013 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 12014 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 12015
daa33def 12016 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 12017 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
12018 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12019 * tests/headers.at (export YYLTYPE): Likewise.
12020
12021 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 12022 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 12023
9a86cdb9
PE
12024 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12025 comments, since they're not portable. Use GNU coding style.
12026
9c1e26bd
AD
120272002-11-13 Akim Demaille <akim@epita.fr>
12028
12029 * data/yacc.c: Leave bigger chunks of quoted text.
12030 (YYDSYMPRINTF): New.
12031 Use it to report symbol activities.
12032 * data/glr.c (YYDSYMPRINTF): New.
12033 Use it.
12034
87f721cc
PE
120352002-11-12 Paul Eggert <eggert@twinsun.com>
12036
12037 Version 1.75b.
12038
12039 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12040 (yyglrReduce): Return yyok, not 0.
12041 This should avoid the enumerated-type warnings reported
464c6927 12042 by Nelson H. F. Beebe in
161a71f3 12043 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
12044
12045 * lib/bbitset.h (BITSET_INLINE): Remove.
12046 * lib/bitset.h [! BITSET_INLINE]: Remove.
12047 (bitset_set, bitset_reset, bitset_test): Rename local vars
12048 to avoid shadowing warnings by GCC.
12049
12050 * data/glr.c (inline): Remove #define. It's the user's
12051 responsibility to #define it away, just like 'const'.
464c6927 12052 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 12053 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 12054
87f721cc
PE
12055 * Makefile.maint (po-check): Scan .l and .y files instead of the
12056 .c and the .h files that they generate. This fixes the bug
12057 reported by Tim Van Holder in:
161a71f3 12058 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
12059 Look for N_ as well as for _. Try to avoid matching #define for
12060 N_ and _.
12061 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12062 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12063 * src/scan-gram.l: Revamp regular expressions so that " and '
12064 do not confuse xgettext.
12065
12066 * src/struniq.h (struniq_new): Do not declare the return type
12067 to be 'const'; this violates the C standard.
12068 * src/struniq.c (struniq_new): Likewise.
12069
be14ade5
AD
120702002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12071
12072 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12073 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12074 linker.
12075
05291fbc
AD
120762002-11-12 Akim Demaille <akim@epita.fr>
12077
12078 * Makefile.maint: Sync with Autoconf:
12079 (local_updates): New.
12080
1f5fd52e
AD
120812002-11-12 Akim Demaille <akim@epita.fr>
12082
12083 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12084
283f1e64
AD
120852002-11-12 Akim Demaille <akim@epita.fr>
12086
12087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12088 locations.
12089
886b69d1
AD
120902002-11-12 Akim Demaille <akim@epita.fr>
12091
12092 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12093 not yyvalue.
12094
3df37415
AD
120952002-11-12 Akim Demaille <akim@epita.fr>
12096
12097 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12098 Use it to test the GLR parser.
12099
7bd6c77e
AD
121002002-11-12 Akim Demaille <akim@epita.fr>
12101
12102 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12103 defines it.
12104 * data/glr.c (yystos): New.
12105 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12106 (YYDSYMPRINT): New.
12107 (yyval): Don't define it, it is handled via M4.
12108 (yyrecoverParseError): Free verbosely the discarded symbols.
12109 * data/yacc.c (yysymprint): Remove, rather...
12110 (b4_yysymprint_generate): invoke.
12111 * data/c.m4 (b4_yysymprint_generate): New.
12112 Accept pointers as arguments, as opposed to the version from
12113 yacc.c.
12114 (b4_yydestruct_generate): Likewise.
12115 * tests/cations.at (Printers and Destructors): Use Bison directives
12116 instead of CPP macros.
12117 Don't rely on internal details.
12118
b0400cc6
AD
121192002-11-12 Akim Demaille <akim@epita.fr>
12120
12121 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12122 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12123 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12124 it against YYEMPTY and so forth), work on yytoken (i.e., set
12125 it to YYEMPTY etc.).
12126 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12127 (b4_symbol_actions): Remove.
12128 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12129 for 0, end-of-input.
12130
72f889cc
AD
121312002-11-12 Akim Demaille <akim@epita.fr>
12132
12133 * doc/bison.texinfo (Destructor Decl): New.
12134
b1ae9233
AD
121352002-11-12 Akim Demaille <akim@epita.fr>
12136
12137 * src/tables.c (tables_generate): Use free for pointers that
12138 cannot be NULL, not XFREE.
12139 (pack_vector): Use assert, not fatal, for bound violations.
12140 * src/state.c (state_new): Likewise.
12141 * src/reader.c (reader): Likewise.
12142 * src/lalr.c (set_goto_map): Likewise.
72f889cc 12143 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
12144 the file name.
12145
7ec2d4cd
AD
121462002-11-12 Akim Demaille <akim@epita.fr>
12147
12148 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12149 Restore.
12150 * src/scan-gram.l (last_string): Is global to the file, not to
12151 yylex.
12152 * src/parse-gram.y (input): Don't append the epilogue here,
12153 (epilogue.opt): do it here, and free the scanner's obstack.
12154 * src/reader.c (epilogue_set): Rename as...
12155 (epilogue_augment): this.
12156 * data/c.m4 (b4_epilogue): Defaults to empty.
12157
573a6cd3
AD
121582002-11-12 Akim Demaille <akim@epita.fr>
12159
12160 * src/getargs.c (long_options): Remove duplicates.
12161 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12162 Remove.
12163 * doc/bison.rnh: Remove.
12164 * doc/bison.texinfo (VMS Invocation): Remove.
12165
95612cfa
AD
121662002-11-12 Akim Demaille <akim@epita.fr>
12167
12168 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12169 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12170
12171 Use struniq for symbols.
12172
12173 * src/symtab.h (symbol_t): The tag member is a struniq.
12174 (symbol_type_set): Adjust.
12175 * src/symtab.c (symbol_new): Takes a struniq.
12176 (symbol_free): Don't free the tag member.
12177 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12178 (hash_compare_symbol, hash_symbol): these.
12179 Use the fact that tags as struniqs.
12180 (symbol_get): Use struniq_new.
12181 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12182 Returns a strniq.
12183 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12184 and type members are struniqs.
12185 * src/reader.c (get_merge_function)
12186 (grammar_current_rule_merge_set): Adjust.
12187 (TYPE, current_type): Are struniq.
12188
12189 Use struniq for file names.
12190
12191 * src/files.h, src/files.c (infile): Split into...
12192 (grammar_file, current_file): these.
12193 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12194 * src/reduce.c (reduce_print): Likewise.
12195 * src/getargs.c (getargs): Likewise.
12196 * src/complain.h, src/complain.c: Likewise.
12197 * src/main.c (main): Call struniqs_new early enough to use it for
12198 file names.
12199 Don't free the input file name.
12200
3e6656f9
AD
122012002-11-12 Akim Demaille <akim@epita.fr>
12202
12203 * src/symtab.c (symbol_free): Remove dead deactivated code:
12204 type_name are properly removed.
12205 Don't use XFREE to free items that cannot be NULL.
12206 * src/struniq.h, src/struniq.c: New.
12207 * src/main.c (main): Initialize/free struniqs.
12208 * src/parse-gram.y (%union): Add astruniq member.
12209 (yyprint): Adjust.
12210 * src/scan-gram.l (<{tag}>): Return a struniq.
12211 Free the obstack bit that used to store it.
12212 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12213
7672019c
PE
122142002-11-11 Paul Eggert <eggert@twinsun.com>
12215
12216 Revamp to fix many (but not all) of the C- and M4-related quoting
12217 problems. Among other things, this fixes the Bison bug reported
12218 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 12219 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
12220
12221 Use new @ escapes consistently. Represent brackets with @{ and @}
12222 rather than @<:@ and @:>@, since this works a bit better with dumb
12223 editors like vi. Represent @ with @@, since @ is now consistently
12224 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12225 __ofile__, to avoid unexpected expansions. Similarly, use @output
12226 rather than #output.
12227
12228 * data/c.m4 (b4_copyright): Omit file name from comment, since
12229 the file name could contain "*/".
12230 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12231 be quoted. All uses changed.
12232
12233 * data/glr.c: Use new @ escapes consistently.
12234 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12235 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12236 Remove, since they couldn't handle arbitrary characters in file
12237 names.
12238 * data/lalr1.cc: Likewise.
12239 * data/yacc.c: Likewise.
12240
12241 * src/files.c (output_infix): Remove; all uses removed.
12242 * src/files.h: Likewise.
12243
12244 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12245 mishandled funny characters in file names, and anyway it isn't
12246 needed any more.
12247 * data/yacc.c: Likewise.
12248 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12249
12250 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12251 * data/yacc.c: Likewise.
12252
12253 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12254 strings now.
12255 (muscle_init): Quote filename as a C string.
12256 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12257 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12258 * src/output.c (escaped_file_name_output): New function.
12259 (prepare_symbols): Quote tokens for M4.
12260 (prepare): Don't insert output_infix, output_prefix,
12261 output_parser_name, output_header_name; this is now down by scan-skel.
12262 Insert skeleton as a C string.
12263
12264 * src/output.c (user_actions_output, symbol_destructors_output,
12265 symbol_printers_output): Quote filenames for C and M4.
12266 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12267
12268 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12269 escapes other than \\ and \'; this simplifies the code.
12270 (<SC_STRING>): Likewise, for \\ and \".
12271 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12272 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12273 Use new escapes @{ and @} for [ and ].
12274
12275 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12276 them with auto vars.
12277 Switch to new escape scheme, where @ is the escape character uniformly.
12278 Abort if a stray escape character is found. Avoid unbounded input
12279 buffer when parsing non-escaped text.
12280
12281 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12282 __oline__, #output, $@, and @{ do not have unintended meanings.
12283
acea4f3b
PE
122842002-11-09 Paul Eggert <eggert@twinsun.com>
12285
12286 Fix the test failure due to GCC warnings described in
161a71f3 12287 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
12288 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12289 evaluate to 0 if it's impossible for NINF to be in the respective
12290 table.
12291 (yygetLRActions, yyrecoverParseError): Use them.
12292
12293 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
12294 counted in the token inserted at end of file. Now takes
12295 location_t *, not location_t, so that the location can be
12296 adjusted. All uses changed.
12297
12298 * tests/regression.at (Invalid inputs): Adjust wording in
12299 diagnostic to match the new behavior.
12300
12301 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
12302 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
12303 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
12304 abort ();'. This reduces the runtime of the "Many lookaheads"
12305 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
12306 GCC 3.2.
12307
20ef1ad5
PE
123082002-11-07 Paul Eggert <eggert@twinsun.com>
12309
12310 * src/parse-gram.y (CHARACTER): Remove unused token.
12311 All uses removed.
12312
12313 * src/scan-gram.l: Remove stack option. We no longer use the
12314 stack, since the stack was never deeper than 1; instead, use the
12315 new auto var c_context to record the stacked value.
12316
12317 Remove nounput option. At an unexpected end of file, we now unput
12318 the minimal input necessary to end cleanly; this simplifies the
12319 code.
12320
12321 Avoid unbounded token sizes where this is easy.
12322
12323 (unexpected_end_of_file): New function.
12324 Use it to systematize the error message on unexpected EOF.
12325 (last-string): Now auto, not static.
12326 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
12327 (scanner_last_string_free): Remove; not used.
12328 (percent_percent_count): Move decl to just before use.
12329 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
12330 not the (never otherwised-used) CHARACTER.
12331
93724f13
AD
123322002-11-07 Akim Demaille <akim@epita.fr>
12333
12334 Let yyerror always receive the msg as last argument, so that
12335 yyerror can be variadic.
12336
12337 * data/yacc.c (b4_yyerror_args): New.
12338 Use it when calling yyerror.
12339 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
12340 Use it when calling yyerror.
12341 * doc/bison.texinfo (Error Reporting): Adjust.
12342 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
12343 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
12344
6e40b4eb
AD
123452002-11-06 Akim Demaille <akim@epita.fr>
12346
12347 #line should have quoted strings.
12348 Ideally, this should be done by m4_quotearg.
12349
12350 * src/scan-skel.l: Include quotearg.h.
12351 Quote __ofile__.
12352 * src/output.c (symbol_printers_output)
12353 (symbol_destructors_output): Quote the file name.
12354
2dfbfc12
AD
123552002-11-06 Akim Demaille <akim@epita.fr>
12356
12357 * tests/regression.at (Invalid inputs): Adjust to the recent
12358 messages.
12359
437c2d80
AD
123602002-11-06 Akim Demaille <akim@epita.fr>
12361
12362 Restore --no-lines.
12363 Reported by Jim Kent.
12364
12365 * data/c.m4 (b4_syncline): New.
12366 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
12367 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
12368 * src/output.c (user_actions_output): Likewise.
12369 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 12370 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 12371
900c5db5
AD
123722002-11-06 Akim Demaille <akim@epita.fr>
12373
12374 * src/main.c (main): Free `infile'.
12375 * src/scan-gram.l (handle_syncline): New.
12376 Recognize `#line'.
12377 * src/output.c (user_actions_output, symbol_destructors_output)
12378 (symbol_printers_output): Use the location's file name, not
12379 infile.
12380 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12381
e183b123 123822002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 12383
e183b123 12384 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 12385 either has GLR conflict entries.
e183b123 12386
193eb6b7
PE
123872002-11-05 Paul Eggert <eggert@twinsun.com>
12388
e183b123
PE
12389 * src/scan-gram.l: Use more accurate diagnostics, e.g.
12390 "integer out of range" rather than "invalid value".
12391 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
12392 accordingly.
12393
193eb6b7
PE
12394 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
12395 Also, remove one static variable in the scanner.
12396
12397 * src/scan-gram.l (braces_level): Now auto, not static.
12398 Initialize to zero if the compiler is being picky.
12399 (INITIAL): Clear braces_level instead of incrementing it.
12400 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
12401 as POSIX 1003.1-2001 requires.
12402 * src/system.h (IF_LINT): New macro, taken from coreutils.
12403 * configure.ac: Define "lint" if --enable-gcc-warnings.
12404
29c01725
AD
124052002-11-05 Akim Demaille <akim@epita.fr>
12406
12407 * src/scan-gram.l: When it starts with `%', complain about the
12408 whole directive, not just that `invalid character: %'.
12409
8aeac3ca
AD
124102002-11-04 Akim Demaille <akim@epita.fr>
12411
12412 * Makefile.maint: Update from Autoconf.
12413 (update, cvs-update, po-update, do-po-update): New.
12414
793a58bb
AD
124152002-11-04 Akim Demaille <akim@epita.fr>
12416
12417 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
12418 and yyerror.
12419 Have yyerror `use' its arguments.
12420 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
12421 returns true when location & yacc & pure & parse-param.
12422 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
12423
c4d720cd
AD
124242002-11-04 Akim Demaille <akim@epita.fr>
12425
12426 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
12427 clashes.
12428 * src/scan-gram.l: Use [\'] instead of ['] to pacify
12429 font-lock-mode.
12430 Use complain_at.
12431 Use quote, not quote_n since LOCATION_PRINT no longer uses the
12432 slot 0.
12433
613a0dc5
PE
124342002-11-03 Paul Eggert <eggert@twinsun.com>
12435
12436 * src/reader.c (get_merge_function, grammar_current_rule_check):
12437 Use consistent diagnostics for reporting type name clashes.
12438 Quote the types with <>, for consistency with Yacc.
12439 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
12440
2a8d363a
AD
124412002-11-03 Akim Demaille <akim@epita.fr>
12442
12443 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
12444 New.
12445 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
12446 (b4_parse_param): Remove.
12447 Use b4_identification.
12448 Propagate b4_pure_args where needed to pass them to yyerror.
12449 * data/glr.m4 (b4_parse_param): Remove.
12450 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
12451 (b4_lpure_formals): New.
12452 Use b4_identification.
12453 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
12454 b4_user_formals and b4_user_args.
12455 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
12456 (yyreportAmbiguity): When using a pure parser, also need
12457 the location, and the parse-params.
12458 Adjust callers.
12459 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
12460 When using a pure parser, also need the parse-params.
12461 Adjust callers.
12462 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
12463 (%pure-parser + %parse-param) LALR and GLR parsers.
12464 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
12465 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
12466 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
12467 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
12468 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
12469 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
12470 * doc/bison.texinfo: Untabify the whole file.
12471 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
12472 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
12473 (Error Reporting): Adjust to these new directives.
12474 Document %error-verbose, deprecate YYERROR_VERBOSE.
12475
9e32add8
AD
124762002-11-03 Akim Demaille <akim@epita.fr>
12477
12478 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
12479 AT_CHECK_CALC_GLR invocations to use % directives, instead of
12480 command line options.
12481 * tests/cxx-type.at: Formatting changes.
12482
b02d90a5
PE
124832002-11-03 Paul Eggert <eggert@twinsun.com>
12484
12485 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
12486 to count columns correctly, and to check for invalid inputs.
9e32add8 12487
b02d90a5
PE
12488 Use mbsnwidth to count columns correctly. Account for tabs, too.
12489 Include mbswidth.h.
12490 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
12491 (extend_location): New function.
12492 (YY_LINES): Remove.
12493
12494 Handle CRLF in C code rather than in Lex code.
12495 (YY_INPUT): New macro.
12496 (no_cr_read): New function.
12497
12498 Scan UCNs, even though we don't fully handle them yet.
12499 (convert_ucn_to_byte): New function.
12500
12501 Handle backslash-newline correctly in C code.
12502 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
12503 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
12504 all uses changed.
12505 (tag, splice): New EREs. Do not allow NUL or newline in tags.
12506 Use {splice} wherever C allows backslash-newline.
12507 YY_STEP after space, newline, vertical-tab.
12508 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 12509
b02d90a5
PE
12510 (letter, id): Don't assume ASCII; e.g., spell out a-z.
12511
12512 ({int}, handle_action_dollar, handle_action_at): Check for integer
12513 overflow.
9e32add8 12514
b02d90a5
PE
12515 (YY_STEP): Omit trailing semicolon, so that it's more like C.
12516
12517 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
12518 as well as \000. Check for UCHAR_MAX, not 255.
12519 Allow \x with an arbitrary positive number of digits, as in C.
12520 Check for overflow here.
12521 Allow \? and UCNs, for compatibility with C.
12522
12523 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
12524 with quote slot used by complain_at.
12525
12526 * tests/input.at: Add tests for backslash-newline, m4 quotes
12527 in symbols, long literals, and funny escapes in strings.
12528
12529 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
12530 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
12531 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
12532 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
12533 * m4/mbswidth.m4: New file, from GNU coreutils.
12534
12535 * doc/bison.texinfo (Grammar Outline): Document // comments.
12536 (Symbols): Document that trigraphs have no special meaning in Bison,
12537 nor is backslash-newline allowed.
12538 (Actions): Document that trigraphs have no special meaning.
12539
12540 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
12541 no longer used.
12542
125432002-11-02 Paul Eggert <eggert@twinsun.com>
12544
12545 * src/reader.c: Don't include quote.h; not needed.
12546 (get_merge_function): Reword warning to be consistent with
12547 type clash diagnostic in grammar_current_rule_check.
12548
12549 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
12550 bug in trigraph handling.
12551
12552 * src/output.c (prepare_symbols): When printing token names,
12553 escape "[" as "@<:@" and likewise for "]".
12554
12555 * src/system.h (errno): Remove declaration, as we are now
12556 assuming C89 or better, and C89 guarantees errno.
12557
762b212b
PE
125582002-10-30 Paul Eggert <eggert@twinsun.com>
12559
12560 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
12561 Check for close failures.
12562 * src/files.h (xfclose): Return void, not int, since it always
12563 returned zero.
12564 * src/files.c (xfclose): Likewise. Report I/O error if ferror
12565 indicates one.
12566 * src/output.c (output_skeleton): Use xfclose rather than fclose
12567 and ferror. xfclose now checks ferror.
12568
12569 * data/glr.c (YYLEFTMOST_STATE): Remove.
12570 (yyreportTree): Use a stack-based leftmost state. This avoids
12571 our continuing battles with bogus warnings about initializers.
12572
56100c60
AD
125732002-10-30 Akim Demaille <akim@epita.fr>
12574
12575 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
12576 #if.
12577
51b4a04c
PH
125782002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12579
12580 * tests/glr-regr1.at: New test for reported regressions.
12581 * tests/testsuite.at: Add glr-regr1.at test.
12582 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 12583
bf1ebda2
PE
125842002-10-24 Paul Eggert <eggert@twinsun.com>
12585
5c16c6b1
PE
12586 Version 1.75a.
12587
bf1ebda2
PE
12588 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
12589 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
12590 we use malloc. Don't assume 'A' through 'Z' are contiguous.
12591 Don't assume strdup exists; POSIX says its an XSI extension.
12592 Check for buffer overflow on input.
12593
b526ee61
AD
125942002-10-24 Akim Demaille <akim@epita.fr>
12595
12596 * src/output.c (output_skeleton): Don't disable M4sugar comments
12597 too soon: it results in comments being expanded.
12598 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
12599 first output.
12600
f1886bb2
AD
126012002-10-24 Akim Demaille <akim@epita.fr>
12602
12603 * data/yacc.c (m4_int_type): New.
12604 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
12605 char' as only yacc.c wants K&R portability.
12606 * data/glr.c (yysigned_char): Remove.
12607 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
12608 Reported by Quoc Peyrot.
12609
c5576256
PE
126102002-10-23 Paul Eggert <eggert@twinsun.com>
12611
12612 * src/main.c (main): With --trace=time, report times even if a
12613 non-fatal error occurs. Formerly, the times were reported in some
12614 such cases but not in others.
12615 * src/reader.c (reader): Just return if a complaint has been issued,
12616 instead of exiting, so that 'main' can report times.
12617
27b0ffea
AD
126182002-10-22 Akim Demaille <akim@epita.fr>
12619
12620 * src/system.h: Include sys/types.
12621 Reported by Bert Deknuydt.
12622
223a7883
PE
126232002-10-23 Paul Eggert <eggert@twinsun.com>
12624
12625 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
12626 Suggested by Art Haas.
12627
126282002-10-22 Paul Eggert <eggert@twinsun.com>
12629
12630 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
12631 decl; not needed any more.
12632 * src/main.c (main): Use return to exit, undoing yesterday's change.
12633 The last OS that we could find where this wouldn't work is
12634 SunOS 3.5, and that's too old to worry about now.
12635
12636 * data/glr.c (struct yyltype): Define members even when not
12637 doing locations. This is more consistent with yacc.c, and it
12638 works around the following bug reports:
161a71f3
PE
12639 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
12640 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 12641
223a7883
PE
12642 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
12643 @acronym consistently. Standardize on "Yacc" instead of "YACC",
12644 "Algol" instead of "ALGOL". Give a bit more history about BNF.
12645
8b76775a
AD
126462002-10-22 Akim Demaille <akim@epita.fr>
12647
12648 * data/README: New.
12649
6db10d14
PE
126502002-10-21 Paul Eggert <eggert@twinsun.com>
12651
12652 Be consistent about 'bool'; the old code used an enum in one
12653 module and an int in another, and this violates the C standard.
12654 * m4/stdbool.m4: New file, from coreutils 4.5.3.
12655 * configure.ac (AC_HEADER_STDBOOL): Add.
12656 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
12657 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
12658 * src/symtab.c (hash_compare_symbol_t): Likewise.
12659 * src/system.h (bool, false, true): Use a definition consistent
12660 with ../lib/hash.c. All uses changed.
12661
12662 * src/complain.c (warning_issued): Renamed from warn_message_count,
12663 so that we needn't worry about integer overflow (!).
12664 Now of type bool. All uses changed.
12665 (complaint_issued): Renamed from complain_message_count; likewise.
12666
12667 * src/main.c (main): Use exit to exit with failure.
27b0ffea 12668
6db10d14
PE
12669 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
12670 rather than 1 and 0.
12671 * src/main.c (main): Likewise.
12672 * src/getargs.c (getargs): Likewise.
12673 * src/reader.c (reader): Likewise.
12674
12675 * src/getarg.c (getargs): Remove duplicate code for
12676 "Try `bison --help'".
12677
12678 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
12679 What was that "2" for?
12680
12681 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
12682 * src/getargs.c (usage): Likewise.
12683
12684 * src/getargs.c (getargs): When there are too few operands, report
12685 the last one. When there are too many, report the first extra
12686 one. This is how diffutils does it.
12687
92a060fd
PE
126882002-10-20 Paul Eggert <eggert@twinsun.com>
12689
12690 Remove K&R vestiges.
12691 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
12692 * src/complain.c (VA_START): Remove. Assume prototypes.
12693 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
12694 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
12695 fatal): Assume prototypes.
12696 * src/complain.h: Assume prototypes.
12697 * src/system.h (PARAMS): Remove.
12698 Include <limits.h> unconditionally, since it's guaranteeed even
12699 for a freestanding C89 compiler.
12700 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
12701 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 12702
e7cb57c0
AD
127032002-10-20 Akim Demaille <akim@epita.fr>
12704
12705 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
12706 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
12707 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
12708 (yyresolveStates, yyresolveAction, yyresolveStack)
12709 (yyprocessOneStack): Use them.
12710 (yy_reduce_print): New.
12711 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
12712
0245f82d
AD
127132002-10-20 Akim Demaille <akim@epita.fr>
12714
12715 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
12716 arguments and output `void'.
12717 (b4_c_function): Rename as...
12718 (b4_c_function_def): this.
12719 (b4_c_function_decl, b4_c_ansi_function_def)
12720 (b4_c_ansi_function_decl): New.
12721 Change the interpretation of the arguments: before `int, foo', now
12722 `int foo, foo'.
12723 * data/yacc.c (yyparse): Prototype and define thanks to these.
12724 Adjust b4_c_function_def uses.
12725 * data/glr.c (yyparse): Likewise, but ANSI only.
12726
39912f52
AD
127272002-10-20 Akim Demaille <akim@epita.fr>
12728
12729 * src/output.c (prepare): Move the definition of `tokens_number',
12730 `nterms_number', `undef_token_number', `user_token_number_max'
12731 to...
12732 (prepare_tokens): Here.
12733 (prepare_tokens): Rename as...
12734 (prepare_symbols): this.
12735 (prepare): Move the definition of `rules_number' to...
12736 (prepare_rules): here.
12737 (prepare): Move the definition of `last', `final_state_number',
12738 `states_number' to...
12739 (prepare_states): here.
12740 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
12741
20c1e2ad
AD
127422002-10-20 Akim Demaille <akim@epita.fr>
12743
12744 * src/tables.h, src/tables.c, src/output.c: Comment changes.
12745
21964f43
AD
127462002-10-20 Akim Demaille <akim@epita.fr>
12747
12748 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
12749 * data/c.m4: here.
12750
66d30cd4
AD
127512002-10-20 Akim Demaille <akim@epita.fr>
12752
12753 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
12754 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
12755 `pair'.
12756 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
12757 `name' to...
12758 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
12759 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
12760 These.
12761
95f2c9fe
PE
127622002-10-19 Paul Eggert <eggert@twinsun.com>
12763
12764 Do not create a temporary file, as that involves security and
12765 cleanup headaches. Instead, use a pair of pipes.
12766 Derived from a suggestion by Florian Krohm.
12767 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
12768 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
12769 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
12770 (BISON_PREREQ_SUBPIPE): Add.
12771 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
12772 Add subpipe.h, subpipe.c.
12773 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
12774 * po/POTFILES.in: Add lib/subpipe.c.
12775 * src/output.c: Include "subpipe.h".
12776 (m4_invoke): Remove decl.
12777 (scan_skel): New decl.
12778 (output_skeleton): Use pipe rather than temporary file for m4 input.
12779 Check that m4sugar.m4 is readable, to avoid deadlock.
12780 Check for pipe I/O error.
12781 * src/scan-skel.l (readpipe): Remove decl.
12782 (scan_skel): New function, to be used in place of m4_invoke.
12783 Read from stream rather than file.
66d30cd4 12784
95f2c9fe
PE
12785 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
12786 float, as this generates a warning on Solaris 8 + GCC 3.2 with
12787 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
12788 this generates a more-accurate value anyway.
12789
12790 * lib/timevar.c (timervar_accumulate): Rename locals to
12791 avoid confusion with similarly-named more-global.
12792 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
12793
12794 * src/output.c (prepare): Use xstrdup to convert char const *
12795 to char *, to avoid GCC warning.
12796
c19988b7
AD
127972002-10-19 Akim Demaille <akim@epita.fr>
12798
12799 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
12800 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
12801 Use them to have `calc.y' ready for %pure-parser.
12802 * data/yacc.c (YYLEX): Pass a yylex return type to
12803 b4_c_function_call.
12804
ae7453f2
AD
128052002-10-19 Akim Demaille <akim@epita.fr>
12806
12807 Prototype support of %lex-param and %parse-param.
12808
12809 * src/parse-gram.y: Add the definition of the %lex-param and
12810 %parse-param tokens, plus their rules.
12811 Drop the `_' version of %glr-parser.
12812 Add the "," token.
12813 * src/scan-gram.l (INITIAL): Scan them.
12814 * src/muscle_tab.c: Comment changes.
12815 (muscle_insert, muscle_find): Rename `pair' as `probe'.
12816 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
12817 (muscle_entry_s): The `value' member is no longer const.
12818 Adjust all dependencies.
12819 * src/muscle_tab.c (muscle_init): Adjust: use
12820 MUSCLE_INSERT_STRING.
12821 Initialize the obstack earlier.
12822 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
12823 (muscle_pair_list_grow): New.
12824 * data/c.m4 (b4_c_function_call, b4_c_args): New.
12825 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
12826 * tests/calc.at: Use %locations, not --locations.
12827 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
12828
0e575721
AD
128292002-10-19 Akim Demaille <akim@epita.fr>
12830
12831 * src/getargs.c (usage): Take status as argument and exit
12832 accordingly.
12833 Report the traditional `Try ... --help' message when status != 0.
12834 (usage, version): Don't take a FILE * as arg, it is pointless.
12835 (getargs): When there is an incorrect number of arguments, make it
12836 an error, and report it GNUlically thanks to `usage ()'.
12837
724ce7f5
PE
128382002-10-18 Paul Eggert <eggert@twinsun.com>
12839
3a781eb2
PE
12840 * data/glr.c (yyreportParseError): Don't assume that sprintf
12841 yields the length of the printed string, as this is not true
12842 on SunOS 4.1.4. Reported by Peter Klein.
12843
724ce7f5
PE
12844 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
12845 * tests/conflicts.at (%nonassoc and eof): Likewise.
12846 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
12847
473d0a75
AD
128482002-10-17 Akim Demaille <akim@epita.fr>
12849
12850 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
12851 * src/getargs.c (trace_types, trace_args): Adjust.
12852 * src/reader.c (grammar_current_rule_prec_set)
12853 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
12854 Standardize error messages.
12855 And s/@prec/%prec/!
12856 (reader): Use trace_flag to enable scanner/parser debugging,
12857 instead of an adhoc scheme.
12858 * src/scan-gram.l: Remove trailing debugging code.
12859
e76d2469
PE
128602002-10-16 Paul Eggert <eggert@twinsun.com>
12861
93e2236a
PE
12862 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
12863 MUSCLE_TAB_H.
12864
e76d2469
PE
12865 * NEWS: Officially drop support for building Bison with K&R C,
12866 since it didn't work anyway and it's not worth worrying about.
12867 * Makefile.maint (wget_files): Remove ansi2knr.c.
12868 (ansi2knr.c-url_prefix): Remove.
12869 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
12870 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12871 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12872
5bd1c419
PE
128732002-10-15 Paul Eggert <eggert@twinsun.com>
12874
12875 Stop using the "enum_" trick for K&R-style function definitions;
12876 it confused me, and I was the author! Instead, assume that people
12877 who want to use K&R C compilers (when using these modules in GCC,
12878 perhaps?) will run ansi2knr.
12879
12880 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
12881 All uses of "enum_" changed to "enum ".
12882 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12883 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 12884
5bd1c419
PE
12885 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
12886 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
12887 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
12888 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
12889 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
12890 abitset_not, abitset_ones, abitset_or, abitset_or_and,
12891 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
12892 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
12893 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
12894 Use function prototypes; this removes the need for declaring
12895 static functions simply to provide their prototypes.
12896 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
12897 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
12898 bitset_count_, bitset_create, bitset_dump, bitset_first,
12899 bitset_free, bitset_init, bitset_last, bitset_next,
12900 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
12901 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
12902 bitset_print, bitset_release_memory, bitset_toggle_,
12903 bitset_type_choose, bitset_type_get, bitset_type_name_get,
12904 debug_bitset): Likewise.
12905 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
12906 * lib/bitset_stats.c (bitset_log_histogram_print,
12907 bitset_percent_histogram_print, bitset_stats_and,
12908 bitset_stats_and_cmp, bitset_stats_and_or,
12909 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
12910 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
12911 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
12912 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
12913 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
12914 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
12915 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
12916 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
12917 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
12918 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
12919 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
12920 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
12921 bitset_stats_zero): Likewise.
12922 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12923 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12924 bitsetv_dump, debug_bitsetv): Likewise.
12925 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
12926 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
12927 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
12928 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
12929 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
12930 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
12931 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
12932 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
12933 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
12934 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
12935 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
12936 Likewise.
12937 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
12938 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
12939 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
12940 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
12941 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
12942 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
12943 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
12944 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
12945 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
12946 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
12947 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 12948
ae26e1f0
AD
129492002-10-14 Akim Demaille <akim@epita.fr>
12950
12951 Version 1.75.
12952
d43baf71
AD
129532002-10-14 Akim Demaille <akim@epita.fr>
12954
12955 * tests/Makefile.am (maintainer-check-posix): New.
12956
7ebc83e3
AD
129572002-10-14 Akim Demaille <akim@epita.fr>
12958
12959 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
12960 member.
12961
05846dae
AD
129622002-10-14 Akim Demaille <akim@epita.fr>
12963
12964 * src/tables.c (table_ninf_remap): base -> tab.
12965 Reported by Matt Rosing.
12966
1318e37d
PE
129672002-10-14 Paul Eggert <eggert@twinsun.com>
12968
447fbb17
PE
12969 * tests/action.at, tests/calc.at, tests/conflicts.at,
12970 tests/cxx-type.at, tests/headers.at, tests/input.at,
12971 tests/regression.at, tests/synclines.at, tests/torture.at:
12972 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
12973 so that the tests still work even if POSIXLY_CORRECT is set.
12974 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 12975
1318e37d
PE
12976 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
12977 for portability to K&R hosts. Fix typo: signed char is guaranteed
12978 only to 127, not to 128.
12979 * data/glr.c (yysigned_char): New type.
12980 * data/yacc.c (yysigned_char): Likewise.
12981 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
12982
cc0f0794
PE
129832002-10-13 Paul Eggert <eggert@twinsun.com>
12984
5038f418
PE
12985 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
12986 true due to limited range of data type" warning from GCC.
12987
cc0f0794
PE
12988 * data/c.m4 (b4_token_defines): Protect against double-inclusion
12989 by wrapping enum yytokentype's definition inside #ifndef
12990 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
12991
6fed0802
AD
129922002-10-13 Akim Demaille <akim@epita.fr>
12993
12994 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
12995 Un yy- yyrhs to avoid the name clash with the global YYRHS.
12996
32f0598d
AD
129972002-10-13 Akim Demaille <akim@epita.fr>
12998
12999 * Makefile.maint: Update from Autoconf 2.54.
13000 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13001
7ea9a33f
AD
130022002-10-13 Akim Demaille <akim@epita.fr>
13003
13004 * src/print.c (print_state): Separate the list of solved conflicts
13005 from the other items.
13006 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13007
ea99527d
AD
130082002-10-13 Akim Demaille <akim@epita.fr>
13009
13010 Let nondeterministic skeletons be usable with deterministic
13011 tables.
13012
13013 With the patch, GAWK compiled by GCC without -O2 passes its test
13014 suite using a GLR parser driven by LALR tables. It fails with -O2
13015 because `struct stat' gives two different answers on my machine:
13016 88 (definition of an auto var) and later 96 (memset on this var).
13017 Hence the stack is badly corrumpted. The headers inclusion is to
13018 blame: if I move the awk.h inclusion before GLR's system header
13019 inclusion, the two struct stat have the same size.
13020
13021 * src/tables.c (pack_table): Always create conflict_table.
13022 (token_actions): Always create conflict_list.
13023 * data/glr.c (YYFLAG): Remove, unused.
13024
f377f69f
AD
130252002-10-13 Akim Demaille <akim@epita.fr>
13026
13027 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13028 (O0FLAGS): New.
13029 (VALGRIND, GXX): New.
13030 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13031 * tests/bison.in: Run $PREBISON a pre-command.
13032 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13033 (maintainer-check-g++): New.
13034 * Makefile.am (maintainer-check): New.
13035
2a1fe6ed
AD
130362002-10-13 Akim Demaille <akim@epita.fr>
13037
13038 * data/glr.c: Formatting changes.
13039 Tweak some trace messages to match yacc.c's.
13040
f50adbbd
AD
130412002-10-13 Akim Demaille <akim@epita.fr>
13042
13043 GLR parsers sometimes raise parse errors instead of performing the
13044 default reduction.
13045 Reported by Charles-Henry de Boysson.
13046
13047 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 13048 check the length of the traces when %glr.
f50adbbd
AD
13049 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13050 GLR's traces.
13051 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13052 Test GLR parsers.
13053 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13054 (yyltype): Remove the yy prefix from the member names.
13055 (yytable): Complete its comment.
13056 (yygetLRActions): Map error action number from YYTABLE from
13057 YYTABLE_NINF to 0.
13058 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13059 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13060 not satisfying as we could compare an YYACTION computed from
13061 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13062 only value for error actions.
13063 (yyreportParseError): In verbose parse error messages, don't issue
13064 `error' in the list of expected tokens.
13065 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13066 next action to perform to match glr.c's decoding.
13067 (yytable): Complete its comment.
13068
bcbad5b9
PE
130692002-10-13 Paul Eggert <eggert@twinsun.com>
13070
13071 Fix problem reported by Henrik Grubbstroem in
161a71f3 13072 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
13073 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13074 because the Bison parser reads the second action before reducing
13075 the first one.
13076 * src/scan-gram.l (rule_length): New static var.
13077 Use it to keep track of the rule length in the scanner, since
13078 we can't expect the parser to be in lock-step sync with the scanner.
13079 (handle_action_dollar, handle_action_at): Use this var.
13080 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 13081
14904b89
PE
130822002-10-12 Paul Eggert <eggert@twinsun.com>
13083
1fe611e5
PE
13084 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13085 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13086 Include <sys/time.h> when checking for clock_t and struct tms.
13087 Use same include order as source.
13088 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 13089 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 13090
1fe611e5
PE
13091 * lib/timevar.c: Update copyright date and clarify comments.
13092 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 13093
1fe611e5
PE
13094 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13095 GCC version as of today, then merge Bison's changes.
13096 Change "GCC" to "Bison" in copyright notice. timevar.def's
13097 author is Akim, so change that too.
13098
98194095
PE
13099 * src/reader.c (grammar_current_rule_check):
13100 Don't worry about the default action if $$ is untyped.
13101 Prevents bogus warnings reported by Jim Gifford in
161a71f3 13102 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 13103
14904b89
PE
13104 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13105 * data/glr.c, data/lalr1.cc, data/yacc.c:
13106 Output token definitions before the first part of user declarations.
13107 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 13108 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 13109
ff6dca18
PE
131102002-10-11 Paul Eggert <eggert@twinsun.com>
13111
13112 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13113 (yyparse): here. This undoes some of the 2002-07-25 change.
13114 Compatibility problem reported by Ralf S. Engelschall with
13115 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13116
eb714592
AD
131172002-10-11 Akim Demaille <akim@epita.fr>
13118
13119 * tests/regression.at Characters Escapes): New.
13120 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13121 characters.
13122 Reported by Jan Nieuwenhuizen.
13123
b7195100
AD
131242002-10-11 Akim Demaille <akim@epita.fr>
13125
13126 * po/id.po: New.
13127
f28a0f2d
PE
131282002-10-10 Paul Eggert <eggert@twinsun.com>
13129
13130 Portability fixes for bitsets; this also avoids several GCC
13131 warnings.
13132
13133 * lib/abitset.c: Include <stddef.h>, for offsetof.
13134 * lib/lbitset.c: Likewise.
13135
13136 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13137 properly for vectors of objects. Do not assume that adding a
13138 header size to a multiple of a word size yields a value that is
13139 properly aligned for the whole union.
13140 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13141
13142 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13143 unique names for structures.
13144 * lib/ebitset.c (ebitset_bytes): Likewise.
13145 * lib/lbitset.c (lbitset_bytes): Likewise.
13146
13147 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13148 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13149 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13150 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13151 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13152 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13153 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13154 to improve the type-checking that GCC can do.
13155 * lib/bitset.c (bitset_op4_cmp): Likewise.
13156 * lib/bitset_stats.c (bitset_stats_count,
13157 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13158 bitset_stats_copy, bitset_stats_disjoint_p,
13159 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13160 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13161 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13162 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13163 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13164 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13165 bitset_stats_or_and_cmp): Likewise.
13166 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13167 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13168 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13169 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13170
13171 * lib/abitset.h: Include bitset.h, not bbitset.h.
13172 * lib/ebitset.h: Likewise.
13173 * lib/lbitset.h: Likewise.
13174
13175 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13176 All instances of parameters of type enum bitset_opts are now of
13177 type enum_bitset_opts, to conform to the C Standard, and similarly
13178 for enum_bitset_type.
13179 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13180 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13181
13182 Do not use "struct bitset_struct" to mean different things in
13183 different modules. Not only is this confusing, it violates
13184 the C Standard, which requires that structure types in different
13185 modules must be compatible if one is to be passed to the other.
13186 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13187 All instances of "struct bitset_struct *" replaced with "bitset".
13188 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13189 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13190 struct lbitset_struct, struct bitset_stats_struct): New types.
13191 All uses of struct bitset_struct changed to union bitset_union,
13192 etc.
ba0fe3c7 13193 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
13194 struct bitset_struct): Remove.
13195 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13196 struct bitset_struct): Remove.
13197 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13198 bitset_struct): Remove.
13199 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13200 Likewise.
13201
13202 Do not call a function of type T using a call that assumes the
13203 function is of a different type U. Standard C requires that a
13204 function must be called with a type that is compatible with its
13205 definition.
13206 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13207 New decls.
13208 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13209 New functions.
13210 * lib/ebitset.c (PFV): Remove.
13211 * lib/lbitset.c (PFV): Likewise.
13212 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13213 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13214 decls.
13215 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13216 (ebitset_vtable): Use them.
13217 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13218 lbitset_xor): New functions.
13219 (lbitset_vtable): Use them.
13220
13221 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13222 Declare.
13223
13224 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13225 GCC warning.
13226 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13227 Use offsetof, for simplicity.
13228
6fbe4984
PE
132292002-10-06 Paul Eggert <eggert@twinsun.com>
13230
13231 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13232 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 13233 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
13234 which was inadvertently undone by the 2002-09-30 patch.
13235 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13236 the same width as int.
13237
420f93c8
PE
132382002-10-04 Paul Eggert <eggert@twinsun.com>
13239
13240 Version 1.50.
13241
13242 * configure.ac (AC_INIT), NEWS: Increment version number.
13243
13244 * doc/bison.texinfo: Minor spelling, grammar, and white space
13245 fixes.
13246 (Symbols): Mention that any negative value returned from yylex
13247 signifies end-of-input. Warn about negative chars. Mention
13248 the portable Standard C character set.
13249
13250 The GNU coding standard says CFLAGS and YFLAGS are reserved
13251 for the installer to set.
13252 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13253 * src/Makefile.am (AM_CFLAGS): Likewise.
13254 (AM_YFLAGS): Renamed from YFLAGS.
13255
13256 Fix some MAX and MIN problems.
13257 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13258 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13259 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13260 * src/reader.c (reader): Use it.
13261
13262 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13263 POSIX 1003.1-2001 has removed fgrep.
13264
132652002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13266
13267 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13268 interpreted as signed.
13269 * lib/ebitset.c (ebitset_list): Fix bug.
13270
ff68026d
PE
132712002-10-01 Paul Eggert <eggert@twinsun.com>
13272
13273 More fixes for 64-bit hosts and large bitsets.
13274
13275 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13276 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13277 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13278 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13279 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13280 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13281 bitset_count_): Likewise.
13282 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13283 bitset_first, bitset_last): Likewise.
13284 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13285 bitset_stats_list_reverse, bitset_stats_size,
13286 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13287 Likewise.
13288 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13289 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13290 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13291 bitsetv_reflexive_transitive_closure): Likewise.
13292 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
13293 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
13294 Likewise.
13295 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
13296 Likewise.
420f93c8 13297
ff68026d
PE
13298 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
13299 Use size_t, not unsigned int, to count bytes.
13300 * lib/abitset.h (abitset_bytes): Likewise.
13301 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
13302 Likewise.
13303 * lib/bitset.h (bitset_bytes): Likewise.
13304 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
13305 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
13306 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13307 * lib/ebitset.c (ebitset_bytes): Likewise.
13308 * lib/ebitset.h (ebitset_bytes): Likewise.
13309 * lib/lbitset.c (lbitset_bytes): Likewise.
13310 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 13311
ff68026d
PE
13312 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
13313 abitset_subset_p, abitset_disjoint_p, abitset_and,
13314 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
13315 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
13316 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
13317 abitset_or_and, abitset_or_and_cmp):
13318 Use bitset_windex instead of unsigned int.
13319 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13320 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
13321 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
13322 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
13323 Likewise.
13324 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 13325
ff68026d
PE
13326 * lib/bitset.c (bitset_print):
13327 Use proper printf formats for widths of integer types.
13328 * lib/bitset_stats.c (bitset_percent_histogram_print,
13329 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
13330 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13331 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
13332 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 13333
ff68026d
PE
13334 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
13335 BITSET_SIZE_MAX): New macros.
13336 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
13337 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
13338 to BITSET_WINDEX_MAX.
13339
13340 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
13341 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
13342 since we now return the bitset_bindex type (not int).
13343
13344 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
13345 when computing sizes.
13346 * lib/ebitset.c (ebitset_elts_grow): Likewise.
13347
13348 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
13349 and avoid cast to unsigned.
13350
6aa452a6
AD
133512002-09-30 Akim Demaille <akim@epita.fr>
13352
13353 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13354 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
13355 Updates from Michael Hayes.
13356
927f7817
AD
133572002-09-30 Art Haas <ahaas@neosoft.com>
13358
13359 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
13360 invocations.
13361 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
13362 defined.
13363
9738f41e
AD
133642002-09-27 Akim Demaille <akim@epita.fr>
13365
13366 Version 1.49c.
13367
a5c75d7f
AD
133682002-09-27 Akim Demaille <akim@epita.fr>
13369
13370 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
13371 (Because of AC_LIBSOURCE).
13372
8280e179
AD
133732002-09-27 Akim Demaille <akim@epita.fr>
13374
13375 Playing with Autoscan.
13376
13377 * configure.ac: Remove the old LIBOBJ tweaks.
13378 (AC_REPLACE_FUNCS): Add strrchr and strtol.
13379 * lib/strrchr.c: New.
13380 * lib/strtol.c: New, from the Coreutils 4.5.1.
13381
ae64af35
AD
133822002-09-27 Akim Demaille <akim@epita.fr>
13383
13384 Playing with Autoscan.
13385
13386 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
13387 * lib/Makefile.am (libbison_a_SOURCES): No longer include
13388 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
13389 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
13390 Coreutils 4.5.1.
13391
d1a1114f
AD
133922002-09-24 Akim Demaille <akim@epita.fr>
13393
13394 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
13395 (Frequently Asked Questions, Parser Stack Overflow): New.
13396
b906441c
AD
133972002-09-13 Akim Demaille <akim@epita.fr>
13398
13399 Playing with autoscan.
13400
13401 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
13402 * src/files.c (skeleton_find): Remove, unused.
13403 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
13404 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
13405
bd701811
AD
134062002-09-13 Akim Demaille <akim@epita.fr>
13407
13408 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
13409 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
13410
e0a13e7b
AD
134112002-09-13 Akim Demaille <akim@epita.fr>
13412
13413 * configure.ac: Require 2.54.
13414 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
13415 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
13416 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
13417 Remove, provided by Autoconf macros.
13418
c97011bf
AD
134192002-09-12 Akim Demaille <akim@epita.fr>
13420
13421 * m4/prereq.m4: Update, from Coreutils 4.5.1.
13422
d862b1be
AD
134232002-09-12 Akim Demaille <akim@epita.fr>
13424
13425 * m4/prereq.m4: Update, from Fileutils 4.1.5.
13426 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
13427 Reported by Martin Mokrejs.
13428
3d38c03a
AD
134292002-09-10 Akim Demaille <akim@epita.fr>
13430
13431 * src/parse-gram.y: Associate a human readable string to each
13432 token type.
13433 * tests/regression.at (Invalid inputs): Adjust.
13434
b6347355
AD
134352002-09-10 Gary V. Vaughan <gary@gnu.org>
13436
13437 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
13438 with an Autoconf-2.5x style configure.ac.
13439
09ba4ab2
PE
134402002-09-06 Paul Eggert <eggert@twinsun.com>
13441
13442 * doc/bison.texinfo (Conditions): Make explicit that the GPL
13443 exception applies only to yacc.c. This is a modification of a
13444 patch originally suggested by Akim Demaille.
13445
21846f69
AD
134462002-09-06 Akim Demaille <akim@epita.fr>
13447
09ba4ab2
PE
13448 * data/c.m4 (b4_copyright): Move the GPL exception comment from
13449 here to...
13450 * data/yacc.c: here.
13451
21846f69
AD
13452 * data/lalr1.cc (struct yyltype): Don't define it, since we use
13453 LocationType.
13454 (b4_ltype): Default to yy::Location from location.hh.
13455
c0ad8bf3
AD
134562002-09-04 Jim Meyering <jim@meyering.net>
13457
13458 * data/yacc.c: Guard the declaration of yytoknum also with
13459 `#ifdef YYPRINT', so it is declared only when used.
13460
3a93251e
AD
134612002-09-04 Akim Demaille <akim@epita.fr>
13462
13463 * configure.in: Rename as...
13464 * configure.ac: this.
13465 Bump to 1.49c.
13466
427c0dda
AD
134672002-09-04 Akim Demaille <akim@epita.fr>
13468
13469 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
13470 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
13471 translate maintainer only messages.
13472
6a254321
PE
134732002-08-12 Paul Eggert <eggert@twinsun.com>
13474
645e30d1
PE
13475 Version 1.49b.
13476
6a254321
PE
13477 * Makefile.am (SUBDIRS): Remove intl.
13478 (DISTCLEANFILES): Remove.
13479 * NEWS: Mention that GNU M4 is now required. Clarify what is
13480 meant by "larger grammars". Mention the pt_BR translation.
13481 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
13482 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
13483 Bump version from 0.11.2 to 0.11.5.
13484 (BISON_PREREQ_STAGE): Remove.
13485 (AM_GNU_GETTEXT): Use external gettext.
13486 (AC_OUTPUT): Remove intl/Makefile.
13487
13488 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
13489
13490 * data/glr.c: Include string.h, for strlen.
13491 (yyreportParseError): Use size_t for yysize.
13492 (yy_yypstack): No longer nested inside yypstates, as nested
13493 functions are not portable. Do not assume size_t is the
13494 same width as int.
13495 (yypstates): Do not assume that ptrdiff_t is the same width
13496 as int, and similarly for yyposn and YYINDEX.
13497
13498 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
13499
13500 * lib/Makefile.am (INCLUDES): Do not include from the intl
13501 directory, which has been removed.
13502 * src/Makefile.am (INCLUDES): Likewise.
13503
13504 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
13505 (bitsets_sources, additional_bitsets_sources, timevars_sources):
13506 New vars.
13507
13508 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
13509 * tests/Makefile.am (EXTRA_DIST): Likewise.
13510
13511 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
13512 Do not assume that bitset_windex is the same width as unsigned.
13513
13514 * lib/abitset.c (abitset_unused_clear): Do not assume that
13515 bitset_word is the same width as int.
13516 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
13517 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
13518 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
13519 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
13520 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
13521
13522 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
13523 portability to one's complement hosts!).
13524 * lib/ebitset.c (ebitset_op1): Likewise.
13525 * lib/lbitset.c (lbitset_op1): Likewise.
13526
13527 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
13528 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13529 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
13530 Sync with fileutils.
13531 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
13532 lib/gettext.h: Sync with diffutils.
13533
13534 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
13535 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
13536
13537 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
13538 PROTOTYPES to check for prototypes, and "defined __STDC__" to
13539 check for void *.
13540
13541 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
13542 size_t; the old version tried to do this but casted improperly.
13543 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
13544 (bitset_test): Now returns int, not unsigned long.
13545
13546 * lib/bitset_stats.c: Include "gettext.h".
13547 (_): New macro.
13548 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
13549 name locals "index", as it generates unnecessary warnings on some
13550 hosts that have an "index" function.
13551
13552 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
13553 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
13554 they need translation.
13555 * src/LR0.c (state_list_append, new_itemsets, get_state,
13556 append_states, generate_states): Likewise.
13557 * src/assoc.c (assoc_to_string): Likewise.
13558 * src/closure.c (print_closure, set_firsts, closure): Likewise.
13559 * src/gram.c (grammar_dump): Likewise.
13560 * src/injections.c (injections_compute): Likewise.
13561 * src/lalr.c (lookaheads_print): Likewise.
13562 * src/relation.c (relation_transpose): Likewise.
13563 * src/scan-gram.l: Likewise.
13564 * src/tables.c (table_grow, pack_vector): Likewise.
13565
13566 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
13567 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
13568 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
13569 * m4/mbstate_t.m4: Sync with fileutils.
13570 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
13571
13572 * po/LINGUAS: Add pt_BR.
13573 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
13574 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
13575 lib/timevar.c.
13576 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
13577 manual recommends.
13578 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
13579
13580 * src/complain.c (strerror_r): Remove decl; not needed.
13581 (strerror): Use same pattern as ../lib/error.c.
13582
13583 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
13584
13585 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
13586
13587 * src/main.c (main): Cast result of bindtextdomain and textdomain
13588 to void, to avoid a GCC warning when --disable-nls is in effect.
13589
13590 * src/scan-gram.l: Use strings rather than escapes when possible,
13591 to minimize the number of warnings from xgettext.
13592 (handle_action_dollar, handle_action_at): Don't use isdigit,
13593 as it mishandles negative chars and it may not work as expected
13594 outside the C locale.
13595
13596 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
13597 this is a GCC extension and is not portable to other compilers.
13598
13599 * src/system.h (alloca): Use same pattern as ../lib/error.c.
13600 Do not include <ctype.h>; no longer needed.
13601 Do not include <malloc.h>; no longer needed (and generates
13602 warnings on OpenBSD 3.0).
13603
13604 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
13605 it's not portable.
13606
13607 * tests/regression.at: Do not use 'cc -c input.c -o input';
13608 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
13609
13610 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
13611 exit status as failure, not just exit status 1. Sun C exits
13612 with status 2 sometimes.
13613
13614 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
13615 Use it for the two large tests.
13616
c8f002c7
AD
136172002-08-02 Akim Demaille <akim@epita.fr>
13618
13619 * src/conflicts.c (conflicts_output): Don't output rules never
13620 reduced here, since anyway that computation doesn't work.
13621 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
13622 (rule_useless_p, rule_never_reduced_p): New.
13623 (grammar_rules_partial_print): Use a filter instead of a range.
13624 Display the title only if needed.
13625 (grammar_rules_print): Adjust.
13626 (grammar_rules_never_reduced_report): New.
13627 * src/tables.c (action_row): Move the computation of rules never
13628 reduced to...
13629 (token_actions): here.
13630 * src/main.c (main): Make the parser before making the report, so
13631 that rules never reduced are computed.
13632 Call grammar_rules_never_reduced_report.
13633 * src/print.c (print_results): Report rules never reduced.
13634 * tests/conflicts.at, tests/reduce.at: Adjust.
13635
cd08e51e
AD
136362002-08-01 Akim Demaille <akim@epita.fr>
13637
13638 Instead of attaching lookaheads and duplicating the rules being
13639 reduced by a state, attach the lookaheads to the reductions.
13640
13641 * src/state.h (state_t): Remove the `lookaheads',
13642 `lookaheads_rule' member.
13643 (reductions_t): Add a `lookaheads' member.
13644 Use a regular array for the `rules'.
13645 * src/state.c (reductions_new): Initialize the lookaheads member
13646 to 0.
13647 (state_rule_lookaheads_print): Adjust.
13648 * src/state.h, src/state.c (state_reductions_find): New.
13649 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
13650 (count_rr_conflicts): Adjust.
13651 * src/lalr.c (LArule): Remove.
13652 (add_lookback_edge): Adjust.
13653 (state_lookaheads_count): New.
13654 (states_lookaheads_initialize): Merge into...
13655 (initialize_LA): this.
13656 (lalr_free): Adjust.
13657 * src/main.c (main): Don't free nullable and derives too early: it
13658 is used by --verbose.
13659 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
13660
bb0027a9
AD
136612002-08-01 Akim Demaille <akim@epita.fr>
13662
13663 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
13664 `rule_number_t**'.
13665 (set_derives, free_derives): Rename as...
13666 (derives_compute, derives_free): this.
13667 Adjust all dependencies.
13668 * src/nullable.c (set_nullable, free_nullable): Rename as...
13669 (nullable_compute, nullable_free): these.
13670 (rule_list_t): Store rule_t *, not rule_number_t.
13671 * src/state.c (state_rule_lookaheads_print): Directly compare rule
13672 pointers, instead of their numbers.
13673 * src/main.c (main): Call nullable_free, and derives_free earlier,
13674 as they were lo longer used.
13675
3325ddc4
AD
136762002-08-01 Akim Demaille <akim@epita.fr>
13677
13678 * lib/timevar.c (get_time): Include children time.
13679 * src/lalr.h (LA, LArule): Don't export them: used with the
13680 state_t.
13681 * src/lalr.c (LA, LArule): Static.
13682 * src/lalr.h, src/lalr.c (lalr_free): New.
13683 * src/main.c (main): Call it.
13684 * src/tables.c (pack_vector): Check whether loc is >= to the
13685 table_size, not >.
13686 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
13687 (tables_generate): do it, since that's also it which allocates
13688 them.
13689 Don't free LA and LArule, main does.
13690
c6f1a33c
AD
136912002-07-31 Akim Demaille <akim@epita.fr>
13692
13693 Separate parser tables computation and output.
13694
13695 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
13696 (conflict_list, conflict_list_cnt, table, check, table_ninf)
13697 (yydefgoto, yydefact, high): Move to...
13698 * src/tables.h, src/tables.c: here.
13699 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13700 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13701 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
13702 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
13703 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
13704 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
13705 (action_row, save_row, token_actions, save_column, default_goto)
13706 (goto_actions, sort_actions, matching_state, pack_vector)
13707 (table_ninf_remap, pack_table, prepare_actions): Move to...
13708 * src/tables.c: here.
13709 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
13710 * src/output.c (token_actions, output_base, output_conflicts)
13711 (output_check): Merge into...
13712 (prepare_actions): this.
13713 (actions_output): Rename as...
13714 (user_actions_output): this.
13715 * src/main.c (main): Call tables_generate and tables_free.
13716
1509d42f
AD
137172002-07-31 Akim Demaille <akim@epita.fr>
13718
13719 Steal GCC's --time-report support.
13720
13721 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
13722 stolen/adjusted from GCC.
13723 * m4/stage.m4: Remove time related checks.
13724 * m4/timevar.m4: New.
13725 * configure.in: Adjust.
13726 * src/system.h: Adjust to using timevar.h.
13727 * src/getargs.h, src/getargs.c: Support trace_time for
13728 --trace=time.
13729 * src/main.c (stage): Remove.
13730 (main): Replace `stage' invocations with timevar calls.
13731 * src/output.c: Insert pertinent timevar calls.
13732
273a74fa
AD
137332002-07-31 Akim Demaille <akim@epita.fr>
13734
13735 Let --trace have arguments.
13736
13737 * src/getargs.h (enum trace_e): New.
13738 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
13739 (long_options, short_options): --trace/-T takes an optional
13740 argument.
13741 Change all the uses of trace_flag to reflect the new flags.
13742 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
13743
13744 Strengthen `stage' portability.
13745
13746 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
13747 * configure.in: Use it.
13748 Don't check for malloc.h and sys/times.h.
13749 * src/system.h: Include them when appropriate.
13750 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
13751 times and struct tms are available.
13752
217598da
AD
137532002-07-30 Akim Demaille <akim@epita.fr>
13754
13755 In verbose parse error message, don't report `error' as an
13756 expected token.
13757 * tests/actions.at (Printers and Destructors): Adjust.
13758 * tests/calc.at (Calculator $1): Adjust.
13759 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
13760 error message, do not report the parser accepts the error token in
13761 that state.
13762
52489d44
AD
137632002-07-30 Akim Demaille <akim@epita.fr>
13764
13765 Normalize conflict related messages.
13766
13767 * src/complain.h, src/complain.c (warn, complain): New.
13768 * src/conflicts.c (conflicts_print): Use them.
13769 (conflict_report_yacc): New, extracted from...
13770 (conflicts_print): here.
13771 * tests/conflicts.at, tests/existing.at: Adjust.
13772
e8832397
AD
137732002-07-30 Akim Demaille <akim@epita.fr>
13774
13775 Report rules which are never reduced by the parser: those hidden
13776 by conflicts.
13777
13778 * src/LR0.c (save_reductions): Don't make the final state too
13779 different: save its reduction (accept) instead of having a state
13780 without any action (no shift or goto, no reduce).
13781 Note: the final state is now a ``regular'' state, i.e., the
13782 parsers now contain `reduce 0' as default reduction.
13783 Nevertheless, since they decide to `accept' when yystate =
13784 final_state, they still will not reduce rule 0.
13785 * src/print.c (print_actions, print_reduction): Adjust.
13786 * src/output.c (action_row): Track reduced rules.
13787 (token_actions): Report rules never reduced.
13788 * tests/conflicts.at, tests/regression.at: Adjust.
13789
caf23d24
AD
137902002-07-30 Akim Demaille <akim@epita.fr>
13791
13792 `stage' was accidently included in a previous patch.
13793 Initiate its autoconfiscation.
13794
13795 * configure.in: Look for malloc.h and sys/times.h.
13796 * src/main.c (stage): Adjust.
13797 Report only when trace_flag.
13798
640748ee
AD
137992002-07-29 Akim Demaille <akim@epita.fr>
13800
13801 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
13802 state_number_t.
13803 (errs_t): symbol_t*, not symbol_number_t.
13804 (reductions_t): rule_t*, not rule_number_t.
13805 (FOR_EACH_SHIFT): New.
13806 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
13807 * src/print.c, src/print_graph.c: Adjust.
13808
88bce5a2
AD
138092002-07-29 Akim Demaille <akim@epita.fr>
13810
13811 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
13812
13813 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
13814 (endtoken, accept): these.
13815 * src/reader.c (reader): Set endtoken's default tag to "$end".
13816 Set undeftoken's tag to "$undefined" instead of "$undefined.".
13817 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
13818 Adjust.
13819
1bfb97db
AD
138202002-07-29 Akim Demaille <akim@epita.fr>
13821
13822 * src/reduce.c (reduce_grammar): When the language is empty,
13823 complain about the start symbol, not the axiom.
13824 Use its location.
13825 * tests/reduce.at (Empty Language): New.
13826
fc5734fe
AD
138272002-07-26 Akim Demaille <akim@epita.fr>
13828
13829 * src/reader.h, src/reader.c (gram_error): ... can't get
13830 yycontrol without making too strong assumptions on the parser
13831 itself.
13832 * src/output.c (prepare_tokens): Use the real 0th value of
13833 token_translations instead of `0'.
13834 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
13835 visible here.
13836 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
13837 for the time being: %locations ought to provide it to yyerror.
13838
3650b4b8
AD
138392002-07-25 Akim Demaille <akim@epita.fr>
13840
13841 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
13842 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
13843 * tests/regression.at (Web2c Actions): Adjust.
13844
4b3d3a8e
AD
138452002-07-25 Akim Demaille <akim@epita.fr>
13846
13847 Stop storing rules from 1 to nrules + 1.
13848
13849 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
13850 * src/nullable.c, src/output.c, src/print.c, src/reader.c
13851 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
13852 Iterate from 0 to nrules.
13853 Use rule_number_as_item_number and item_number_as_rule_number.
13854 Adjust to `derive' now containing possibly 0.
13855 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
13856 Handle the `- 1' part in rule numbers from/to item numbers.
13857 * src/conflicts.c (log_resolution): Fix the message which reversed
13858 shift and reduce.
13859 * src/output.c (action_row): Initialize default_rule to -1.
13860 (token_actions): Adjust.
13861 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
13862 expected output.
13863 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
13864
4a2a22f4
AD
138652002-07-25 Akim Demaille <akim@epita.fr>
13866
13867 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
13868 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
13869 (b4_c_knr_arg_decl): New.
13870 * data/yacc.c: Use it to define yysymprint, yydestruct, and
13871 yyreport_parse_error.
13872
b8df3223
AD
138732002-07-25 Akim Demaille <akim@epita.fr>
13874
13875 * data/yacc.c (yyreport_parse_error): New, extracted from...
13876 (yyparse): here.
13877 (yydestruct, yysymprint): Move above yyparse.
13878 Be K&R compliant.
13879
a762e609
AD
138802002-07-25 Akim Demaille <akim@epita.fr>
13881
13882 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
13883 replace...
13884 (b4_sint_type, b4_uint_type): these.
13885 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
13886 * tests/regression.at (Web2c Actions): Adjust.
13887
12b0043a
AD
138882002-07-25 Akim Demaille <akim@epita.fr>
13889
13890 * src/gram.h (TIEM_NUMBER_MAX): New.
13891 (item_number_of_rule_number, rule_number_of_item_number): Rename
13892 as...
13893 (rule_number_as_item_number, item_number_as_rule_number): these.
13894 Adjust dependencies.
13895 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
13896 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
13897 (symbol_number_to_vector_number): New.
13898 (order): Of vector_number_t* type.
13899 (base_t, BASE_MAX, BASE_MIN): New.
13900 (froms, tos, width, pos, check): Of base_t type.
13901 (action_number_t, ACTION_MIN, ACTION_MAX): New.
13902 (actrow): Of action_number_t type.
13903 (conflrow): Of unsigned int type.
13904 (table_ninf, base_ninf): New.
13905 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
13906 (muscle_insert_int_table, muscle_insert_base_table)
13907 (muscle_insert_rule_number_table): New.
13908 (prepare_tokens): Output `toknum' as int_table.
13909 (action_row): Returns a rule_number_t.
13910 Use ACTION_MIN, not SHRT_MIN.
13911 (token_actions): yydefact is rule_number_t*.
13912 (table_ninf_remap): New.
13913 (pack_table): Use it for `base' and `table'.
13914 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
13915 replaced with...
13916 (YYPACT_NINF, YYTABLE_NINF): these.
13917 (yypact, yytable): Compute their types instead of hard-coded
13918 `short'.
13919 * tests/regression.at (Web2c Actions): Adjust.
13920
5dde258a
AD
139212002-07-19 Akim Demaille <akim@epita.fr>
13922
13923 * src/scan-gram.l (id): Can start with an underscore.
13924
a945ec39
AD
139252002-07-16 Akim Demaille <akim@epita.fr>
13926
13927 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
13928 Adjust all former `associativity' dependencies.
13929 * src/symtab.c (symbol_new): Default associativity is `undef', not
13930 `right'.
13931 (symbol_check_alias_consistence): Adjust.
13932
fae437e8
AD
139332002-07-09 Akim Demaille <akim@epita.fr>
13934
13935 * doc/bison.texinfo: Properly set the ``header'' part.
13936 Use @dircategory ``GNU programming tools'' as per Texinfo's
13937 documentation.
13938 Use @copying.
13939
1a715ef2
AD
139402002-07-09 Akim Demaille <akim@epita.fr>
13941
13942 * lib/quotearg.h: Protect against multiple inclusions.
13943 * src/location.h (location_t): Add a `file' member.
13944 (LOCATION_RESET, LOCATION_PRINT): Adjust.
13945 * src/complain.c (warn_at, complain_at, fatal_at): Drop
13946 `error_one_per_line' support.
13947
a5d50994
AD
139482002-07-09 Akim Demaille <akim@epita.fr>
13949
13950 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
13951 * src/reader.c (lineno): Remove.
13952 Adjust all dependencies.
13953 (get_merge_function): Take a location and use complain_at.
13954 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
13955 * tests/regression.at (Invalid inputs, Mixing %token styles):
13956 Adjust.
13957
b275314e
AD
139582002-07-09 Akim Demaille <akim@epita.fr>
13959
13960 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
13961 recovery rule, and forbid extensions when --yacc.
13962 (gram_error): Use complain_at.
13963 * src/reader.c (reader): Exit if there were parse errors.
13964
865b9df1
AD
139652002-07-09 Akim Demaille <akim@epita.fr>
13966
13967 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
13968 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
13969 Reported by R Blake <blakers@mac.com>.
13970
c76e14da
AD
139712002-07-09 Akim Demaille <akim@epita.fr>
13972
13973 * data/yacc.c: Output the copyright notive in the header.
13974
7db2ed2d
AD
139752002-07-03 Akim Demaille <akim@epita.fr>
13976
13977 * src/output.c (froms, tos): Are state_number_t.
13978 (save_column): sp, sp1, and sp2 are state_number_t.
13979 (prepare): Rename `final' as `final_state_number', `nnts' as
13980 `nterms_number', `nrules' as `rules_number', `nstates' as
13981 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
13982 unused.
13983 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
13984 * data/lalr1.cc (nsym_): Remove, unused.
13985
e68e0410
AD
139862002-07-03 Akim Demaille <akim@epita.fr>
13987
13988 * src/lalr.h, src/lalr.c (goto_number_t): New.
13989 * src/lalr.c (goto_list_t): New.
13990 Propagate them.
13991 * src/nullable.c (rule_list_t): New.
13992 Propagate.
13993 * src/types.h: Remove.
13994
e1a4f3a4
AD
139952002-07-03 Akim Demaille <akim@epita.fr>
13996
13997 * src/closure.c (print_fderives): Use rule_rhs_print.
13998 * src/derives.c (print_derives): Use rule_rhs_print.
13999 (rule_list_t): New, replaces `shorts'.
14000 (set_derives): Add comments.
14001 * tests/sets.at (Nullable, Firsts): Adjust.
14002
536545f3
AD
140032002-07-03 Akim Demaille <akim@epita.fr>
14004
14005 * src/output.c (prepare_actions): Free `tally' and `width'.
14006 (prepare_actions): Allocate and free `order'.
14007 * src/symtab.c (symbols_free): Free `symbols'.
14008 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14009 * src/output.c (m4_invoke): Move to...
14010 * src/scan-skel.l: here.
14011 (<<EOF>>): Close yyout, and free its name.
14012
8b752b00
AD
140132002-07-03 Akim Demaille <akim@epita.fr>
14014
14015 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14016
14017 * src/LR0.c (new_state): Merge into...
14018 (state_list_append): this.
14019 (new_states): Merge into...
14020 (generate_states): here.
14021 (set_states): Don't ensure a proper `errs' state member here, do it...
14022 * src/conflicts.c (conflicts_solve): here.
14023 * src/state.h, src/state.c: Comment changes.
14024 (state_t): Rename member `shifts' as `transitions'.
14025 Adjust all dependencies.
14026 (errs_new): For consistency, also take the values as argument.
14027 (errs_dup): Remove.
14028 (state_errs_set): New.
14029 (state_reductions_set, state_transitions_set): Assert that no
14030 previous value was assigned.
14031 (state_free): New.
14032 (states_free): Use it.
14033 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14034 temporary storage: use `errs' and `nerrs' as elsewhere.
14035 (set_conflicts): Allocate and free this `errs'.
14036
613f5e1a
AD
140372002-07-02 Akim Demaille <akim@epita.fr>
14038
14039 * lib/libiberty.h: New.
14040 * lib: Update the bitset implementation from upstream.
14041 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14042 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14043 * src/main.c: Adjust bitset stats calls.
14044
26e0cadc
PE
140452002-07-01 Paul Eggert <eggert@twinsun.com>
14046
14047 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14048 char, so that negative chars don't collide with $.
14049
1154cced
AD
140502002-06-30 Akim Demaille <akim@epita.fr>
14051
14052 Have the GLR tests be `warning' checked, and fix the warnings.
14053
14054 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14055 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14056 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14057 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14058 (yyaddDeferredAction): static.
14059 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14060 (yyreportParseError): yyprefix is const.
14061 yytokenp is used only when verbose.
14062 (yy__GNUC__): Replace with __GNUC__.
14063 (yypdumpstack): yyi is size_t.
14064 (yypreference): Un-yy local variables and arguments, to avoid
14065 clashes with `yyr1'. Anyway, we are not in the user name space.
14066 (yytname_size): be an int, as is compared with ints.
14067 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14068 Use them.
14069 * tests/cxx-gram.at: Use quotation to protect $1.
14070 Use AT_COMPILE to enable warnings hunts.
14071 Prototype yylex and yyerror.
14072 `Use' argc.
14073 Include `string.h', not `strings.h'.
14074 Produce and prototype stmtMerge only when used.
14075 yylex takes a location.
14076
97650f4e
AD
140772002-06-30 Akim Demaille <akim@epita.fr>
14078
14079 We spend a lot of time in quotearg, in particular when --verbose.
14080
14081 * src/symtab.c (symbol_get): Store a quoted version of the key.
14082 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14083 Adjust all callers.
14084
d2576365
AD
140852002-06-30 Akim Demaille <akim@epita.fr>
14086
14087 * src/state.h (reductions_t): Rename member `nreds' as num.
14088 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14089 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14090
ccaf65bc
AD
140912002-06-30 Akim Demaille <akim@epita.fr>
14092
14093 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14094 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14095 (shifts_to): Rename as...
14096 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14097 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14098 (TRANSITION_IS_DISABLED, transitions_to): these.
14099
87675353
AD
141002002-06-30 Akim Demaille <akim@epita.fr>
14101
14102 * src/print.c (print_shifts, print_gotos): Merge into...
14103 (print_transitions): this.
14104 (print_transitions, print_errs, print_reductions): Align the
14105 lookaheads columns.
14106 (print_core, print_transitions, print_errs, print_state,
14107 print_grammar): Output empty lines separator before, not after.
14108 (state_default_rule_compute): Rename as...
14109 (state_default_rule): this.
14110 * tests/conflicts.at (Defaulted Conflicted Reduction),
14111 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14112 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14113
ce4ccb4b
AD
141142002-06-30 Akim Demaille <akim@epita.fr>
14115
14116 Display items as we display rules.
14117
14118 * src/gram.h, src/gram.c (rule_lhs_print): New.
14119 * src/gram.c (grammar_rules_partial_print): Use it.
14120 * src/print.c (print_core): Likewise.
14121 * tests/conflicts.at (Defaulted Conflicted Reduction),
14122 (Unresolved SR Conflicts): Adjust.
14123 (Unresolved SR Conflicts): Adjust and rename as...
14124 (Resolved SR Conflicts): this, as was meant.
14125 * tests/regression.at (Web2c Report): Adjust.
14126
bc933ef1
AD
141272002-06-30 Akim Demaille <akim@epita.fr>
14128
14129 * src/print.c (state_default_rule_compute): New, extracted from...
14130 (print_reductions): here.
14131 Pessimize, but clarify the code.
14132 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14133
53d4308d
AD
141342002-06-30 Akim Demaille <akim@epita.fr>
14135
14136 * src/output.c (action_row): Let default_rule be always a rule
14137 number.
14138
574fb2d5
AD
141392002-06-30 Akim Demaille <akim@epita.fr>
14140
14141 * src/closure.c (print_firsts, print_fderives, closure):
14142 Use BITSET_EXECUTE.
14143 * src/lalr.c (lookaheads_print): Likewise.
14144 * src/state.c (state_rule_lookaheads_print): Likewise.
14145 * src/print_graph.c (print_core): Likewise.
14146 * src/print.c (print_reductions): Likewise.
14147 * src/output.c (action_row): Likewise.
14148 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14149
05811fd7
AD
141502002-06-30 Akim Demaille <akim@epita.fr>
14151
14152 * src/print_graph.c: Use report_flag.
14153
0e4d5753
AD
141542002-06-30 Akim Demaille <akim@epita.fr>
14155
14156 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14157 to...
14158 * src/relation.h, src/relation.c (traverse, relation_digraph)
14159 (relation_print, relation_transpose): New.
14160
24c7d800
AD
141612002-06-30 Akim Demaille <akim@epita.fr>
14162
14163 * src/state.h, src/state.c (shifts_to): New.
14164 * src/lalr.c (build_relations): Use it.
14165
9222837b
AD
141662002-06-30 Akim Demaille <akim@epita.fr>
14167
14168 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14169 (item_number_of_rule_number, rule_number_of_item_number): New.
14170 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14171 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14172 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14173 Propagate their use.
14174 Much remains to be done, in particular wrt `shorts' from types.h.
14175
260008e5
AD
141762002-06-30 Akim Demaille <akim@epita.fr>
14177
14178 * src/symtab.c (symbol_new): Initialize the `printer' member.
14179
8a731ca8
AD
141802002-06-30 Akim Demaille <akim@epita.fr>
14181
14182 * src/LR0.c (save_reductions): Remove, replaced by...
14183 * src/state.h, src/state.c (state_reductions_set): New.
14184 (reductions, errs): Rename as...
14185 (reductions_t, errs_t): these.
14186 Adjust all dependencies.
14187
32e1e0a4
AD
141882002-06-30 Akim Demaille <akim@epita.fr>
14189
14190 * src/LR0.c (state_list_t, state_list_append): New.
14191 (first_state, last_state): Now symbol_list_t.
14192 (this_state): Remove.
14193 (new_itemsets, append_states, save_reductions): Take a state_t as
14194 argument.
14195 (set_states, generate_states): Adjust.
14196 (save_shifts): Remove, replaced by...
14197 * src/state.h, src/state.c (state_shifts_set): New.
14198 (shifts): Rename as...
14199 (shifts_t): this.
14200 Adjust all dependencies.
14201 * src/state.h (state_t): Remove the `next' member.
14202
e5fb6710
AD
142032002-06-30 Akim Demaille <akim@epita.fr>
14204
14205 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14206 escaped in slot 0.
14207
c7ca99d4
AD
142082002-06-30 Akim Demaille <akim@epita.fr>
14209
14210 Use hash.h for the state hash table.
14211
14212 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14213 (allocate_storage): Use state_hash_new.
14214 (free_storage): Use state_hash_free.
14215 (new_state, get_state): Adjust.
14216 * src/lalr.h, src/lalr.c (states): Move to...
14217 * src/states.h (state_t): Remove the `link' member, no longer
14218 used.
14219 * src/states.h, src/states.c: here.
14220 (state_hash_new, state_hash_free, state_hash_lookup)
14221 (state_hash_insert, states_free): New.
14222 * src/states.c (state_table, state_compare, state_hash): New.
14223 * src/output.c (output_actions): Do not free states now, since we
14224 still need to know the final_state number in `prepare', called
14225 afterwards. Do it...
14226 * src/main.c (main): here: call states_free after `output'.
14227
df0e7316
AD
142282002-06-30 Akim Demaille <akim@epita.fr>
14229
14230 * src/state.h, src/state.c (state_new): New, extracted from...
14231 * src/LR0.c (new_state): here.
14232 * src/state.h (STATE_ALLOC): Move to...
14233 * src/state.c: here.
14234 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14235 * src/state.h, src/state.c: here.
14236
39f41916
AD
142372002-06-30 Akim Demaille <akim@epita.fr>
14238
14239 * src/reader.c (gensym): Rename as...
14240 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14241 (getsym): Rename as...
14242 (symbol_get): this.
14243
d57650a5
AD
142442002-06-30 Akim Demaille <akim@epita.fr>
14245
14246 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14247 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14248 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14249 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14250
5a08f1ce
AD
142512002-06-30 Akim Demaille <akim@epita.fr>
14252
14253 Make the test suite pass with warnings checked.
14254
14255 * tests/actions.at (Printers and Destructors): Improve.
14256 Avoid unsigned vs. signed issues.
14257 * tests/calc.at: Don't exercise the scanner here, do it...
14258 * tests/input.at (Torturing the Scanner): here.
14259
720623af
PH
142602002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14261
88e7e941 14262 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
14263 reorganize first lines parallel to yacc.c.
14264
fb8135fa
AD
142652002-06-28 Akim Demaille <akim@epita.fr>
14266
14267 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14268 (b4_token_enum, b4_token_defines): New, factored from...
14269 * data/lalr1.cc, data/yacc.c, glr.c: here.
14270
41442480
AD
142712002-06-28 Akim Demaille <akim@epita.fr>
14272
14273 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14274 unused variables.
14275 * src/output.c (merger_output): static.
14276
e0e5bf84
AD
142772002-06-28 Akim Demaille <akim@epita.fr>
14278
ba0fe3c7 14279 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
14280 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14281 pacify GCC.
14282 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 14283
676385e2
PH
142842002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14285
14286 Accumulated changelog for new GLR parsing features.
14287
6a254321 14288 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
14289 conflicts_total_count.
14290 * src/conflicts.h: Ditto.
14291 * src/output.c (token_actions): Use the new name.
14292 (output_conflicts): Change conflp => conflict_list_heads, and
14293 confl => conflict_list for better readability.
14294 * data/glr.c: Use the new names.
14295 * NEWS: Add self to GLR announcement.
e0e5bf84 14296
676385e2
PH
14297 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
14298
14299 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
14300 Akim Demaille.
14301
14302 * data/bison.glr: Change name to glr.c
14303 * data/glr.c: Renamed from bison.glr.
14304 * data/Makefile.am: Add glr.c
e0e5bf84
AD
14305
14306 * src/getargs.c:
14307
676385e2 14308 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 14309 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 14310
676385e2
PH
14311 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14312
14313 * data/bison.glr: Be sure to restore the
14314 current #line when returning to the skeleton contents after having
14315 exposed the input file's #line.
14316
14317 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14318
14319 * data/bison.glr: Bring up to date with changes to bison.simple.
14320
14321 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14322
14323 * data/bison.glr: Correct definitions that use b4_prefix.
14324 Various reformatting.
14325 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
14326 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
14327 yytokenp argument; now part of stack.
14328 (yychar): Define to behave as documented.
14329 (yyclearin): Ditto.
e0e5bf84 14330
676385e2
PH
14331 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14332
14333 * src/reader.h: Add declaration for free_merger_functions.
14334
14335 * src/reader.c (merge_functions): New variable.
14336 (get_merge_function): New function.
14337 (free_merger_functions): New function.
14338 (readgram): Check for %prec that is not followed by a symbol.
14339 Handle %dprec and %merge declarations.
14340 (packgram): Initialize dprec and merger fields in rules array.
14341
14342 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
14343 conflict_list_cnt, conflict_list_free): New variables.
14344 (table_grow): Also grow conflict_table.
e0e5bf84 14345 (prepare_rules): Output dprec and merger tables.
676385e2 14346 (conflict_row): New function.
e0e5bf84 14347 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
14348 default reduction in conflicted states for GLR parser so that there
14349 are spaces for the conflict lists.
14350 (save_row): Also save conflict information.
14351 (token_actions): Allocate conflict list.
14352 (merger_output): New function.
14353 (pack_vector): Pack conflict table, too.
14354 (output_conflicts): New function to output yyconflp and yyconfl.
14355 (output_check): Allocate conflict_tos.
14356 (output_actions): Output conflict tables, also.
14357 (output_skeleton): Output b4_mergers definition.
14358 (prepare): Output b4_max_rhs_length definition.
14359 Use 'bison.glr' as default skeleton for GLR parsers.
14360
14361 * src/gram.c (glr_parser): New flag.
14362 (grammar_free): Call free_merger_functions.
14363
14364 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
14365 all pairs of conflicting reductions, rather than just all tokens
14366 causing conflicts. Needed to size conflict tables.
e0e5bf84 14367 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
14368 interface.
14369 (conflicts_print): Ditto.
14370 (count_total_conflicts): New function.
14371
14372 * src/reader.h (merger_list): New type.
14373 (merge_functions): New variable.
14374
14375 * src/lex.h (tok_dprec, tok_merge): New token types.
14376
14377 * src/gram.h (rule_s): Add dprec and merger fields.
14378 (glr_parser): New flag.
14379
14380 * src/conflicts.h (count_total_conflicts): New function.
14381
14382 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
14383
14384 * doc/bison.texinfo (Generalized LR Parsing): New section.
14385 (GLR Parsers): New section.
14386 (Language and Grammar): Mention GLR parsing.
14387 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
14388 Correct typo ("tge" -> "the").
14389
14390 * data/bison.glr: New skeleton for GLR parsing.
14391
14392 * tests/cxx-gram.at: New tests for GLR parsing.
14393
14394 * tests/testsuite.at: Include cxx-gram.at.
14395
14396 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 14397
676385e2
PH
14398 * src/parse-gram.y:
14399
14400 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
14401
14402 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 14403
b5480d74 144042002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
14405
14406 * src/options.h, src/options.c: Remove.
14407 * src/getargs.c (short_options, long_options): New.
14408
60491a94
AD
144092002-06-27 Akim Demaille <akim@epita.fr>
14410
14411 * data/bison.simple, data/bison.c++: Rename as...
14412 * data/yacc.c, data/lalr1.cc: these.
14413 * doc/bison.texinfo (Environment Variables): Remove.
14414
9be0c25b
AD
144152002-06-25 Raja R Harinath <harinath@cs.umn.edu>
14416
14417 * src/getargs.c (report_argmatch): Initialize strtok().
14418
1ae72863
AD
144192002-06-20 Akim Demaille <akim@epita.fr>
14420
14421 * data/bison.simple (b4_symbol_actions): New, replaces...
14422 (b4_symbol_destructor, b4_symbol_printer): these.
14423 (yysymprint): Be sure to call YYPRINT only for tokens, and using
14424 user token numbers.
14425
87542d29
AD
144262002-06-20 Akim Demaille <akim@epita.fr>
14427
14428 * data/bison.simple (yydestructor): Rename as...
14429 (yydestruct): this.
14430
1a31ed21
AD
144312002-06-20 Akim Demaille <akim@epita.fr>
14432
14433 * src/symtab.h, src/symtab.c (symbol_type_set)
14434 (symbol_destructor_set, symbol_precedence_set): The location is
14435 the last argument.
14436 Adjust all callers.
14437
e776192e
AD
144382002-06-20 Akim Demaille <akim@epita.fr>
14439
14440 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
14441 internals.
14442 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
14443 Takes a location.
14444 * src/symtab.h, src/symtab.c (symbol_class_set)
14445 (symbol_user_token_number_set): Likewise.
14446 Adjust all callers.
14447 Promote complain_at.
14448 * tests/input.at (Type Clashes): Adjust.
14449
5c1180b3
AD
144502002-06-20 Akim Demaille <akim@epita.fr>
14451
14452 * data/bison.simple (YYLEX): Fix the declaration when
14453 %pure-parser.
14454
e3170060
AD
144552002-06-20 Akim Demaille <akim@epita.fr>
14456
14457 * data/bison.simple (yysymprint): Don't print the token number,
14458 just its name.
14459 * tests/actions.at (Destructors): Rename as...
14460 (Printers and Destructors): this.
14461 Also exercise %printer.
14462
253862fd
AD
144632002-06-20 Akim Demaille <akim@epita.fr>
14464
14465 * data/bison.simple (YYDSYMPRINT): New.
14466 Use it to remove many of the #if YYDEBUG/if (yydebug).
14467
366eea36
AD
144682002-06-20 Akim Demaille <akim@epita.fr>
14469
14470 * src/symtab.h, src/symtab.c (symbol_t): printer and
14471 printer_location are new members.
14472 (symbol_printer_set): New.
14473 * src/parse-gram.y (PERCENT_PRINTER): New token.
14474 Handle its associated rule.
14475 * src/scan-gram.l: Adjust.
14476 (handle_destructor_at, handle_destructor_dollar): Rename as...
14477 (handle_symbol_code_at, handle_symbol_code_dollar): these.
14478 * src/output.c (symbol_printers_output): New.
14479 (output_skeleton): Call it.
14480 * data/bison.simple (yysymprint): New. Cannot be named yyprint
14481 since there are already many grammar files with a user `yyprint'.
14482 Replace the calls to YYPRINT to calls to yysymprint.
14483 * tests/calc.at: Adjust.
14484 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
14485 taking advantage of parser very internal details (stack size!).
14486
4f25ebb0
AD
144872002-06-20 Akim Demaille <akim@epita.fr>
14488
14489 * src/scan-gram.l: Complete the scanner with the missing patterns
14490 to pacify Flex.
14491 Use `quote' and `symbol_tag_get' where appropriate.
14492
93b68a0e
AD
144932002-06-19 Akim Demaille <akim@epita.fr>
14494
14495 * tests/actions.at (Destructors): Augment to test locations.
14496 * data/bison.simple (yydestructor): Pass it the current location
14497 if locations are enabled.
14498 Prototype only when __STDC__ or C++.
14499 Change the argument names to move into the yy name space: there is
14500 user code here.
14501
58612f1d
AD
145022002-06-19 Akim Demaille <akim@epita.fr>
14503
74310291
AD
14504 * data/bison.simple (b4_pure_if): New.
14505 Use it instead of #ifdef YYPURE.
14506
145072002-06-19 Akim Demaille <akim@epita.fr>
14508
14509 * data/bison.simple (b4_location_if): New.
58612f1d
AD
14510 Use it instead of #ifdef YYLSP_NEEDED.
14511
f25bfb75
AD
145122002-06-19 Akim Demaille <akim@epita.fr>
14513
14514 Prepare @$ in %destructor, but currently don't bind it in the
14515 skeleton, as %location use is not cleaned up yet.
14516
14517 * src/scan-gram.l (handle_dollar, handle_destructor_at)
14518 (handle_action_at): New.
14519 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
14520 a braced_code_t and a location as additional arguments.
14521 (handle_destructor_dollar): Instead of requiring `b4_eval', just
14522 unquote one when outputting `b4_dollar_dollar'.
14523 Adjust callers.
14524 * data/bison.simple (b4_eval): Remove.
14525 (b4_symbol_destructor): Adjust.
14526 * tests/input.at (Invalid @n): Adjust.
14527
c732d2c6
AD
145282002-06-19 Zack Weinberg <zack@codesourcery.com>
14529
14530 * doc/bison.texinfo: Document ability to have multiple
14531 prologue sections.
14532
8c165d89
AD
145332002-06-18 Akim Demaille <akim@epita.fr>
14534
14535 * src/files.c (compute_base_names): When computing the output file
14536 names from the input file name, strip the directory part.
14537
ca98bf57
AD
145382002-06-18 Akim Demaille <akim@epita.fr>
14539
14540 * data/bison.simple.new: Comment changes.
14541 Reported by Andreas Schwab.
14542
0bfb02ff
AD
145432002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
14544
14545 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
14546 there are no `label `yyoverflowlab' defined but not used' warnings
14547 when yyoverflow is defined.
14548
24c0aad7
AD
145492002-06-18 Akim Demaille <akim@epita.fr>
14550
14551 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
14552 new member.
14553 (symbol_destructor_set): Adjust.
14554 * src/output.c (symbol_destructors_output): Output the destructor
14555 locations.
14556 Output the symbol name.
14557 * data/bison.simple (b4_symbol_destructor): Adjust.
14558
5719c109
AD
145592002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
14560 and Akim Demaille <akim@epita.fr>
14561
14562 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
14563 what's left on the stack when the error recovery hits EOF.
14564 * tests/actions.at (Destructors): Complete to exercise this case.
14565
9280d3ef
AD
145662002-06-17 Akim Demaille <akim@epita.fr>
14567
14568 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
14569 arguments is really empty, not only equal to `[]'.
14570 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
14571 member.
14572 (symbol_destructor_set): New.
14573 * src/output.c (symbol_destructors_output): New.
14574 * src/reader.h (brace_code_t, current_braced_code): New.
14575 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
14576 (handle_dollar): Rename as...
14577 (handle_action_dollar): this.
14578 (handle_destructor_dollar): New.
14579 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
14580 (grammar_declaration): Use it.
14581 * data/bison.simple (yystos): Is always defined.
14582 (yydestructor): New.
14583 * tests/actions.at (Destructors): New.
14584 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
14585
dafdc66f
AD
145862002-06-17 Akim Demaille <akim@epita.fr>
14587
14588 * src/symlist.h, src/symlist.c (symbol_list_length): New.
14589 * src/scan-gram.l (handle_dollar, handle_at): Compute the
14590 rule_length only when needed.
14591 * src/output.c (actions_output, token_definitions_output): Output
14592 the full M4 block.
14593 * src/symtab.c: Don't access directly to the symbol tag, use
14594 symbol_tag_get.
14595 * src/parse-gram.y: Use symbol_list_free.
14596
56c47203
AD
145972002-06-17 Akim Demaille <akim@epita.fr>
14598
14599 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
14600 (symbol_list_prepend, get_type_name): Move to...
14601 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
14602 (symbol_list_prepend, symbol_list_n_type_name_get): here.
14603 Adjust all callers.
14604 (symbol_list_free): New.
14605 * src/scan-gram.l (handle_dollar): Takes a location.
14606 * tests/input.at (Invalid $n): Adjust.
14607
1e0bab92
AD
146082002-06-17 Akim Demaille <akim@epita.fr>
14609
14610 * src/reader.h, src/reader.c (symbol_list_new): Export it.
14611 (symbol_list_prepend): New.
14612 * src/parse-gram.y (%union): `list' is a new member.
14613 (symbols.1): New, replaces...
14614 (terms_to_prec.1, nterms_to_type.1): these.
14615 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
14616 Take a location as additional argument.
14617 Adjust all callers.
14618
04e60654
AD
146192002-06-15 Akim Demaille <akim@epita.fr>
14620
14621 * src/parse-gram.y: Move %token in the declaration section so that
14622 we don't depend upon CVS Bison.
14623
10e5b8bd
AD
146242002-06-15 Akim Demaille <akim@epita.fr>
14625
14626 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
14627 * src/print.c (print_core): Use it.
14628
9801d40c
AD
146292002-06-15 Akim Demaille <akim@epita.fr>
14630
14631 * src/conflicts.c (log_resolution): Accept the rule involved in
14632 the sr conflicts instead of the lookahead number that points to
14633 that rule.
14634 (flush_reduce): Accept the current lookahead vector as argument,
14635 instead of the index in LA.
14636 (resolve_sr_conflict): Accept the current number of lookahead
14637 bitset to consider for the STATE, instead of the index in LA.
14638 (set_conflicts): Adjust.
14639 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
14640
c0263492
AD
146412002-06-15 Akim Demaille <akim@epita.fr>
14642
14643 * src/state.h (state_t): Replace the `lookaheadsp' member, a
14644 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
14645 Adjust all dependencies.
14646 * src/lalr.c (initialize_lookaheads): Split into...
14647 (states_lookaheads_count, states_lookaheads_initialize): these.
14648 (lalr): Adjust.
14649
9757c359
AD
146502002-06-15 Akim Demaille <akim@epita.fr>
14651
14652 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
14653 out of...
14654 (grammar_rules_print): here.
14655 * src/reduce.c (reduce_output): Use it.
14656 * tests/reduce.at (Useless Rules, Reduced Automaton)
14657 (Underivable Rules): Adjust.
14658
6b98e4b5
AD
146592002-06-15 Akim Demaille <akim@epita.fr>
14660
14661 Copy BYacc's nice way to report the grammar.
14662
14663 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
14664 New.
14665 Don't print the rules' location, it is confusing and useless.
14666 (rule_print): Use grammar_rhs_print.
14667 * src/print.c (print_grammar): Use grammar_rules_print.
14668
6b98e4b5
AD
146692002-06-15 Akim Demaille <akim@epita.fr>
14670
14671 Complete and rationalize `useless thing' warnings.
14672
14673 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
14674 (symbol_tag_print): New.
14675 Use them everywhere in place of accessing directly the tag member.
14676 * src/gram.h, src/gram.c (rule_print): New.
14677 Use it where a rule used to be printed `by hand'.
14678 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
14679 (reduce_grammar_tables): Report the useless rules.
14680 (reduce_print): Useless things are a warning, not an error.
14681 Report it as such.
14682 * tests/reduce.at (Useless Nonterminals, Useless Rules):
14683 (Reduced Automaton, Underivable Rules): Adjust.
14684 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
14685 * tests/conflicts.at (Unresolved SR Conflicts)
14686 (Solved SR Conflicts): Adjust.
14687
ee000ba4
AD
146882002-06-15 Akim Demaille <akim@epita.fr>
14689
14690 Let symbols have a location.
14691
14692 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
14693 (getsym): Adjust.
14694 Adjust all callers.
14695 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
14696 Use location_t, not int.
14697 * src/symtab.c (symbol_check_defined): Take advantage of the
14698 location.
14699 * tests/regression.at (Invalid inputs): Adjust.
14700
8efe435c
AD
147012002-06-15 Akim Demaille <akim@epita.fr>
14702
14703 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
14704 (input): Don't try to initialize yylloc here, do it in the
14705 scanner.
14706 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
14707 * src/gram.h (rule_t): Change line and action_line into location
14708 and action_location, of location_t type.
14709 Adjust all dependencies.
14710 * src/location.h, src/location.c (empty_location): New.
14711 * src/reader.h, src/reader.c (grammar_start_symbol_set)
14712 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
14713 (grammar_current_rule_symbol_append)
14714 (grammar_current_rule_action_append): Expect a location as argument.
14715 * src/reader.c (grammar_midrule_action): Adjust to attach an
14716 action's location as dummy symbol location.
14717 * src/symtab.h, src/symtab.c (startsymbol_location): New.
14718 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
14719 the line numbers.
14720
1921f1d7
AD
147212002-06-14 Akim Demaille <akim@epita.fr>
14722
14723 Grammar declarations may be found in the grammar section.
14724
14725 * src/parse-gram.y (rules_or_grammar_declaration): New.
14726 (declarations): Each declaration may end with a semicolon, not
14727 just...
14728 (grammar_declaration): `"%union"'.
14729 (grammar): Branch to rules_or_grammar_declaration.
14730
4515534c
AD
147312002-06-14 Akim Demaille <akim@epita.fr>
14732
14733 * src/main.c (main): Invoke scanner_free.
14734
f958596b
AD
147352002-06-14 Akim Demaille <akim@epita.fr>
14736
14737 * src/output.c (m4_invoke): Extracted from...
14738 (output_skeleton): here.
14739 Free tempfile.
14740
2c569025
AD
147412002-06-14 Akim Demaille <akim@epita.fr>
14742
14743 * src/parse-gram.y (directives, directive, gram)
14744 (grammar_directives, precedence_directives, precedence_directive):
14745 Rename as...
14746 (declarations, declaration, grammar, grammar_declaration)
14747 (precedence_declaration, precedence_declarator): these.
14748 (symbol_declaration): New.
14749
592e8d4d
AD
147502002-06-14 Akim Demaille <akim@epita.fr>
14751
14752 * src/files.c (action_obstack): Remove, unused.
14753 (output_obstack): Remove it, and all its dependencies, as it is no
14754 longer needed.
14755 * src/reader.c (epilogue_set): Build the epilogue in the
14756 muscle_obstack.
14757 * src/output.h, src/output.c (muscle_obstack): Move to...
14758 * src/muscle_tab.h, src/muscle_tab.h: here.
14759 (muscle_init): Initialize muscle_obstack.
14760 (muscle_free): New.
14761 * src/main.c (main): Call it.
14762
0c15323d
AD
147632002-06-14 Akim Demaille <akim@epita.fr>
14764
14765 * src/location.h: New, extracted from...
14766 * src/reader.h: here.
14767 * src/Makefile.am (noinst_HEADERS): Merge into
14768 (bison_SOURCES): this.
14769 Add location.h.
14770 * src/parse-gram.y: Use location_t instead of Bison's.
14771 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
14772 Use location_t instead of ints.
14773
e96c9728
AD
147742002-06-14 Akim Demaille <akim@epita.fr>
14775
14776 * data/bison.simple, data/bison.c++: Be sure to restore the
14777 current #line when returning to the skeleton contents after having
14778 exposed the input file's #line.
14779
75d1fe16
AD
147802002-06-12 Akim Demaille <akim@epita.fr>
14781
14782 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
14783 eager.
14784 * tests/actions.at (Exotic Dollars): New.
14785
6c35d22c
AD
147862002-06-12 Akim Demaille <akim@epita.fr>
14787
14788 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
14789 ['"/] too eagerly.
14790 * tests/input.at (Torturing the Scanner): New.
14791
1d6412ad
AD
147922002-06-11 Akim Demaille <akim@epita.fr>
14793
14794 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
14795 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
14796 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
14797 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
14798 * src/reader.c (reader): Use it.
14799
4cdb01db
AD
148002002-06-11 Akim Demaille <akim@epita.fr>
14801
14802 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
14803 Adjust all callers.
14804 (scanner_last_string_free): New.
14805
44995b2e
AD
148062002-06-11 Akim Demaille <akim@epita.fr>
14807
14808 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
14809 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
14810 (last_string, YY_OBS_FREE): New.
14811 Use them when returning an ID.
14812
e9955c83
AD
148132002-06-11 Akim Demaille <akim@epita.fr>
14814
14815 Have Bison grammars parsed by a Bison grammar.
14816
14817 * src/reader.c, src/reader.h (prologue_augment): New.
14818 * src/reader.c (copy_definition): Remove.
14819
14820 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
14821 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
14822 (grammar_current_rule_prec_set, grammar_current_rule_check)
14823 (grammar_current_rule_symbol_append)
14824 (grammar_current_rule_action_append): Export.
14825 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
14826 (symbol_list_action_append): Remove.
14827 Hook the routines from reader.
14828 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
14829 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
14830
14831 * src/reader.c (read_declarations): Remove, unused.
14832
14833 * src/parse-gram.y: Handle the epilogue.
14834 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
14835 (grammar_start_symbol_set): this.
14836 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
14837 * src/reader.c (readgram): Remove, unused.
14838 (reader): Adjust to insert eoftoken and axiom where appropriate.
14839
14840 * src/reader.c (copy_dollar): Replace with...
14841 * src/scan-gram.h (handle_dollar): this.
14842 * src/parse-gram.y: Remove `%thong'.
14843
14844 * src/reader.c (copy_at): Replace with...
14845 * src/scan-gram.h (handle_at): this.
14846
14847 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
14848 New.
14849
14850 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
14851 time being.
14852
14853 * src/reader.h, src/reader.c (grammar_rule_end): New.
14854
14855 * src/parse.y (current_type, current_class): New.
14856 Implement `%nterm', `%token' support.
14857 Merge `%term' into `%token'.
14858 (string_as_id): New.
14859 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
14860 type name.
14861
14862 * src/parse-gram.y: Be sure to handle properly the beginning of
14863 rules.
14864
14865 * src/parse-gram.y: Handle %type.
14866 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
14867
14868 * src/parse-gram.y: More directives support.
14869 * src/options.c: No longer handle source directives.
14870
14871 * src/parse-gram.y: Fix %output.
14872
14873 * src/parse-gram.y: Handle %union.
14874 Use the prologue locations.
14875 * src/reader.c (parse_union_decl): Remove.
14876
14877 * src/reader.h, src/reader.c (epilogue_set): New.
14878 * src/parse-gram.y: Use it.
14879
14880 * data/bison.simple, data/bison.c++: b4_stype is now either not
14881 defined, then default to int, or to the contents of %union,
14882 without `union' itself.
14883 Adjust.
14884 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
14885
14886 * src/output.c (actions_output): Don't output braces, as they are
14887 already handled by the scanner.
14888
14889 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
14890 characters to themselves.
14891
14892 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
14893 that the epilogue has a proper #line.
14894
14895 * src/parse-gram.y: Handle precedence/associativity.
14896
14897 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
14898 a terminal.
14899 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
14900 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
14901 at all to define terminals that cannot be emitted.
14902
14903 * src/scan-gram.l: Escape M4 characters.
14904
14905 * src/scan-gram.l: Working properly with escapes in user
14906 strings/characters.
14907
14908 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
14909 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
14910 grammar.
14911 Use more modest sizes, as for the time being the parser does not
14912 release memory, and therefore the process swallows a huge amount
14913 of memory.
14914
14915 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
14916 stricter %token grammar.
14917
14918 * src/symtab.h (associativity): Add `undef_assoc'.
14919 (symbol_precedence_set): Do nothing when passed an undef_assoc.
14920 * src/symtab.c (symbol_check_alias_consistence): Adjust.
14921
14922 * tests/regression.at (Invalid %directive): Remove, as it is now
14923 meaningless.
14924 (Invalid inputs): Adjust to the new error messages.
14925 (Token definitions): The new grammar doesn't allow too many
14926 eccentricities.
14927
14928 * src/lex.h, src/lex.c: Remove.
14929 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
14930 (copy_character, copy_string2, copy_string, copy_identifier)
14931 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
14932 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
14933 (parse_action): Remove.
14934 * po/POTFILES.in: Adjust.
14935
2e047461
AD
149362002-06-11 Akim Demaille <akim@epita.fr>
14937
cd05d13c 14938 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
14939 rule's action member: return the action as a string.
14940 Don't require `rule_length' as an argument: compute it.
14941 (grammar_current_rule_symbol_append)
14942 (grammar_current_rule_action_append): New, eved out from
14943 (readgram): here.
14944 Remove `action_flag', `rulelength', unused now.
14945
9af3fbce
AD
149462002-06-11 Akim Demaille <akim@epita.fr>
14947
14948 * src/reader.c (grammar_current_rule_prec_set).
14949 (grammar_current_rule_check): New, eved out from...
14950 (readgram): here.
14951 Remove `xaction', `first_rhs': useless.
14952 * tests/input.at (Type clashes): New.
14953 * tests/existing.at (GNU Cim Grammar): Adjust.
14954
1485e106
AD
149552002-06-11 Akim Demaille <akim@epita.fr>
14956
14957 * src/reader.c (grammar_midrule_action): New, Eved out from
14958 (readgram): here.
14959
da4160c3
AD
149602002-06-11 Akim Demaille <akim@epita.fr>
14961
14962 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
14963 New.
14964 (readgram): Use them as replacement of inlined code, crule and
14965 crule1.
14966
f6d0f937
AD
149672002-06-11 Akim Demaille <akim@epita.fr>
14968
14969 * src/reader.c (grammar_end, grammar_symbol_append): New.
14970 (readgram): Use them.
14971 Make the use of `p' as local as possible.
14972
69078d4b
AD
149732002-06-10 Akim Demaille <akim@epita.fr>
14974
14975 GCJ's parser requires the tokens to be defined before the prologue.
14976
14977 * data/bison.simple: Output the token definition before the user's
14978 prologue.
14979 * tests/regression.at (Braces parsing, Duplicate string)
14980 (Mixing %token styles): Check the output from bison.
14981 (Early token definitions): New.
14982
5e424082
AD
149832002-06-10 Akim Demaille <akim@epita.fr>
14984
14985 * src/symtab.c (symbol_user_token_number_set): Don't complain when
14986 assigning twice the same user number to a token, so that we can
14987 use it in...
14988 * src/lex.c (lex): here.
14989 Also use `symbol_class_set' instead of hand written code.
14990 * src/reader.c (parse_assoc_decl): Likewise.
14991
44536b35
AD
149922002-06-10 Akim Demaille <akim@epita.fr>
14993
14994 * src/symtab.c, src/symtab.c (symbol_class_set)
14995 (symbol_user_token_number_set): New.
14996 * src/reader.c (parse_token_decl): Use them.
14997 Use a switch instead of ifs.
14998 Use a single argument.
14999
8b9f2372
AD
150002002-06-10 Akim Demaille <akim@epita.fr>
15001
15002 Remove `%thong' support as it is undocumented, unused, duplicates
15003 `%token's job, and creates useless e-mail traffic with people who
15004 want to know what it is, why it is undocumented, unused, and
15005 duplicates `%token's job.
15006
15007 * src/reader.c (parse_thong_decl): Remove.
15008 * src/options.c (option_table): Remove "thong".
15009 * src/lex.h (tok_thong): Remove.
15010
3ae2b51f
AD
150112002-06-10 Akim Demaille <akim@epita.fr>
15012
15013 * src/symtab.c, src/symtab.c (symbol_type_set)
15014 (symbol_precedence_set): New.
15015 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15016 (value_components_used): Remove, unused.
15017
2f1afb73
AD
150182002-06-09 Akim Demaille <akim@epita.fr>
15019
15020 Move symbols handling code out of the reader.
15021
15022 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15023 (axiom): Move to...
15024 * src/symtab.h, src/symtab.c: here.
15025
15026 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15027 * src/reader.c (startval): Rename as...
15028 * src/symtab.h, src/symtab.c (startsymbol): this.
15029 * src/reader.c: Adjust.
15030
15031 * src/reader.c (symbol_check_defined, symbol_make_alias)
15032 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15033 (token_translations_init)
15034 Move to...
15035 * src/symtab.c: here.
15036 * src/reader.c (packsymbols): Move to...
15037 * src/symtab.h, src/symtab.c (symbols_pack): here.
15038 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15039 argument.
15040
e9bca3ad
AD
150412002-06-03 Akim Demaille <akim@epita.fr>
15042
15043 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15044 then statements.
15045
86eff183
AD
150462002-06-03 Akim Demaille <akim@epita.fr>
15047
15048 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15049 structs with non literals.
15050 * src/scan-skel.l: never-interactive.
15051 * src/conflicts.c (enum conflict_resolution_e): No trailing
15052 comma.
15053 * src/getargs.c (usage): Split long literal strings.
15054 Reported by Hans Aberg.
15055
717be197
AD
150562002-05-28 Akim Demaille <akim@epita.fr>
15057
15058 * data/bison.c++: Use C++ ostreams.
15059 (cdebug_): New member.
15060
670ddffd
AD
150612002-05-28 Akim Demaille <akim@epita.fr>
15062
15063 * src/output.c (output_skeleton): Be sure to allocate enough room
15064 for `/' _and_ for `\0' in full_skeleton.
15065
769b430f
AD
150662002-05-28 Akim Demaille <akim@epita.fr>
15067
15068 * data/bison.c++: Catch up with bison.simple:
15069 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15070 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15071 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15072 and popping traces.
15073
7067cb36
PH
150742002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15075
15076 * src/output.c (output_skeleton): Put an explicit path in front of
15077 the skeleton file name, rather than relying on the -I directory,
15078 to partially alleviate effects of having a skeleton file lying around
15079 in the current directory.
769b430f 15080
4a713ec2
PH
150812002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15082
769b430f 15083 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
15084 obstack_printf should be obstack_fgrow1.
15085
b408954b
AD
150862002-05-26 Akim Demaille <akim@epita.fr>
15087
15088 * src/state.h (state_t): `solved_conflicts' is a new member.
15089 * src/LR0.c (new_state): Set it to 0.
15090 * src/conflicts.h, src/conflicts.c (print_conflicts)
15091 (free_conflicts, solve_conflicts): Rename as...
15092 (conflicts_print, conflicts_free, conflicts_solve): these.
15093 Adjust callers.
15094 * src/conflicts.c (enum conflict_resolution_e)
15095 (solved_conflicts_obstack): New, used by...
15096 (log_resolution): this.
15097 Adjust to attach the conflict resolution to each state.
15098 Complete the description with the precedence/associativity
15099 information.
15100 (resolve_sr_conflict): Adjust.
15101 * src/print.c (print_state): Output its solved_conflicts.
15102 * tests/conflicts.at (Unresolved SR Conflicts)
15103 (Solved SR Conflicts): Exercise --report=all.
15104
a49aecd5
AD
151052002-05-26 Akim Demaille <akim@epita.fr>
15106
15107 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15108 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15109 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15110 (token_number_t, item_number_as_token_number)
15111 (token_number_as_item_number, muscle_insert_token_number_table):
15112 Rename as...
15113 (symbol_number_t, item_number_as_symbol_number)
15114 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15115 these, since it is more appropriate.
15116
5504898e
AD
151172002-05-26 Akim Demaille <akim@epita.fr>
15118
15119 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15120 `Error:' lines.
15121 * data/bison.simple (yystos) [YYDEBUG]: New.
15122 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15123 error recovery.
15124 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15125
ec3bc396
AD
151262002-05-25 Akim Demaille <akim@epita.fr>
15127
15128 * doc/bison.texinfo (Debugging): Split into...
15129 (Tracing): this new section, its former contents, and...
15130 (Understanding): this new section.
15131 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15132 by...
15133 (report_flag): this.
15134 Adjust all dependencies.
15135 (report_args, report_types, report_argmatch): New.
15136 (usage, getargs): Report/support -r, --report.
15137 * src/options.h
15138 (struct option_table_struct): Rename as..,
15139 (struct option_table_s): this.
15140 Rename the `set_flag' member to `flag' to match with getopt_long's
15141 struct.
15142 * src/options.c (option_table): Split verbose into an entry for
15143 %verbose, and another for --verbose.
15144 Support --report/-r, so remove -r from the obsolete --raw.
15145 * src/print.c: Attach full item sets and lookaheads reports to
15146 report_flag instead of trace_flag.
15147 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15148
78df8250
PE
151492002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15150 and Paul Eggert <eggert@twinsun.com>
769b430f 15151
78df8250
PE
15152 * data/bison.simple (yyparse): Correct error handling to conform to
15153 POSIX and yacc. Specifically, after syntax error is discovered,
15154 do not reduce further before shifting the error token.
15155 Clean up the code a bit by removing the labels yyerrdefault,
15156 yyerrhandle, yyerrpop.
15157 * NEWS: Document the above.
15158
c0c9ea05
PH
151592002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15160
15161 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15162 type; it isn't always big enough, since it doesn't necessarily
15163 include non-terminals.
769b430f 15164 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
15165 the latter can be removed.
15166 (yy_token_number_type): Remove, only one use.
15167 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15168 don't use TokenNumberType as element type.
769b430f 15169
c0c9ea05
PH
15170 * tests/regression.at: Modify expected output to agree with change
15171 to yyr1 and yytranslate.
769b430f 15172
6390a83f
FK
151732002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15174
15175 * src/reader.c (parse_action): Use copy_character instead of
15176 obstack_1grow.
15177
db7c8e9a
AD
151782002-05-13 Akim Demaille <akim@epita.fr>
15179
15180 * tests/regression.at (Token definitions): Prototype yylex and
15181 yyerror.
15182
fcc61800
PH
151832002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15184
158c687b 15185 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
15186 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15187 32-bit arithmetic.
15188 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15189
5683e9b2
AD
151902002-05-07 Akim Demaille <akim@epita.fr>
15191
15192 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15193 avoid GCC warnings.
15194
0c2d3f4c
AD
151952002-05-07 Akim Demaille <akim@epita.fr>
15196
15197 Kill GCC warnings.
15198
15199 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15200 over the RHS of each rule.
15201 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15202 * src/state.h (state_t): Member `nitems' is unsigned short.
15203 * src/LR0.c (get_state): Adjust.
15204 * src/reader.c (packgram): Likewise.
15205 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15206 `Type'.
15207 (muscle_insert_int_table): Remove, unused.
15208 (prepare_rules): Remove `max'.
15209
1565b720
AD
152102002-05-06 Akim Demaille <akim@epita.fr>
15211
15212 * src/closure.c (print_firsts): Display of the symbol tags.
15213 (bitmatrix_print): Move to...
15214 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15215 here.
15216 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15217
cfaee611
AD
152182002-05-06 Akim Demaille <akim@epita.fr>
15219
15220 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15221 hash_do_for_each.
15222
458be8e0
AD
152232002-05-06 Akim Demaille <akim@epita.fr>
15224
15225 * src/LR0.c (new_state, get_state): Instead of using the global
15226 `kernel_size' and `kernel_base', have two new arguments:
15227 `core_size' and `core'.
15228 Adjust callers.
15229
a900a624
AD
152302002-05-06 Akim Demaille <akim@epita.fr>
15231
15232 * src/reader.c (packgram): No longer end `ritem' with a 0
15233 sentinel: it is not used.
15234
d4e7d3a1
AD
152352002-05-05 Akim Demaille <akim@epita.fr>
15236
15237 New experimental feature: display the lookaheads in the report and
15238 graph.
15239
15240 * src/print (print_core): When --trace-flag, display the rules
15241 lookaheads.
15242 * src/print_graph.c (print_core): Likewise.
15243 Swap the arguments.
15244 Adjust caller.
15245
39ceb25b
AD
152462002-05-05 Akim Demaille <akim@epita.fr>
15247
15248 * tests/torture.at (Many lookaheads): New test.
15249
5372019f
AD
152502002-05-05 Akim Demaille <akim@epita.fr>
15251
15252 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15253 (GENERATE_MUSCLE_INSERT_TABLE): this.
15254 (output_int_table, output_unsigned_int_table, output_short_table)
15255 (output_token_number_table, output_item_number_table): Replace with...
15256 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15257 (muscle_insert_short_table, muscle_insert_token_number_table)
15258 (muscle_insert_item_number_table): these.
15259 Adjust all callers.
15260 (prepare_tokens): Don't free `translations', since...
15261 * src/reader.h, src/reader.c (grammar_free): do it.
15262 Move to...
15263 * src/gram.h, src/gram.c (grammar_free): here.
15264 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15265 b4_translate_max.
15266
5df5f6d5
AD
152672002-05-05 Akim Demaille <akim@epita.fr>
15268
15269 * src/output.c (output_unsigned_int_table): New.
15270 (prepare_rules): `i' is unsigned.
15271 `prhs', `rline', `r2' are unsigned int.
15272 Rename muscle `rhs_number_max' as `rhs_max'.
15273 Output muscles `prhs_max', `rline_max', and `r2_max'.
15274 Free rline and r1.
15275 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15276 to compute types instead of constant types.
15277 * tests/regression.at (Web2c Actions): Adjust.
15278
b87f8b21
AD
152792002-05-04 Akim Demaille <akim@epita.fr>
15280
15281 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15282 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15283 Adjust dependencies.
15284 * src/output.c (token_definitions_output): Be sure not to output a
15285 `#define 'a'' when fed with `%token 'a' "a"'.
15286 * tests/regression.at (Token definitions): New.
15287
8bb936e4
PE
152882002-05-03 Paul Eggert <eggert@twinsun.com>
15289
15290 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15291 for K&R C.
15292
152932002-05-03 gettextize <bug-gnu-gettext@gnu.org>
15294
15295 * Makefile.am (SUBDIRS): Remove intl.
15296 (EXTRA_DIST): Add config/config.rpath.
15297
53c71a12
AD
152982002-05-03 Akim Demaille <akim@epita.fr>
15299
15300 * data/bison.simple (m4_if): Don't output empty enums.
15301 And actually, output valid enum definitions :(.
15302
289dd0cf
AD
153032002-05-03 Akim Demaille <akim@epita.fr>
15304
15305 * configure.bat: Remove, completely obsolete.
15306 * Makefile.am (EXTRA_DIST): Adjust.
15307 Don't distribute config.rpath...
15308 * config/Makefile.am (EXTRA_DIST): Do it.
15309
db85e524
AD
153102002-05-03 Akim Demaille <akim@epita.fr>
15311
15312 * configure.in (GETTEXT_VERSION): New.
15313 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
15314
83ccf991
AD
153152002-05-03 Akim Demaille <akim@epita.fr>
15316
15317 * data/bison.simple (b4_token_enum): New.
15318 (b4_token_defines): Use it to output tokens both as #define and
15319 enums.
15320 Suggested by Paul Eggert.
15321 * src/output.c (token_definitions_output): Don't output spurious
15322 white spaces.
15323
1f418995
AD
153242002-05-03 Akim Demaille <akim@epita.fr>
15325
15326 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15327
45119f04
RA
153282002-05-02 Robert Anisko <robert@lrde.epita.fr>
15329
15330 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
15331 Update the stack class, give a try to deque as the default container.
15332
b2d52318
AD
153332002-05-02 Akim Demaille <akim@epita.fr>
15334
15335 * data/bison.simple (yyparse): Do not implement @$ = @1.
15336 (YYLLOC_DEFAULT): Adjust to do it.
15337 * doc/bison.texinfo (Location Default Action): Fix.
15338
3a8b4109
AD
153392002-05-02 Akim Demaille <akim@epita.fr>
15340
15341 * src/reader.c (parse_braces): Merge into...
15342 (parse_action): this.
15343
84614e13
AD
153442002-05-02 Akim Demaille <akim@epita.fr>
15345
15346 * configure.in (ALL_LINGUAS): Remove.
15347 * po/LINGUAS, hr.po: New.
15348
fdbcd8e2
AD
153492002-05-02 Akim Demaille <akim@epita.fr>
15350
15351 Remove the so called hairy (semantic) parsers.
15352
15353 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
15354 * src/gram.h, src/gram.c (semantic_parser): Remove.
15355 (rule_t): Remove the guard and guard_line members.
15356 * src/lex.h (token_t): remove tok_guard.
15357 * src/options.c (option_table): Remove %guard and %semantic_parser
15358 support.
15359 * src/output.c, src/output.h (guards_output): Remove.
15360 (prepare): Adjust.
15361 (token_definitions_output): Don't output the `T'
15362 tokens (???).
15363 (output_skeleton): Don't output the guards.
15364 * src/files.c, src/files.c (attrsfile): Remove.
15365 * src/reader.c (symbol_list): Remove the guard and guard_line
15366 members.
15367 Adjust dependencies.
15368 (parse_guard): Remove.
15369 * data/bison.hairy: Remove.
15370 * doc/bison.texinfo (Environment Variables): Remove occurrences of
15371 BISON_HAIRY.
15372
82b6cb3f
AD
153732002-05-02 Akim Demaille <akim@epita.fr>
15374
15375 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
15376 (parse_guard): Rename the formal argument `stack_offset' as
15377 `rule_length', which is more readable.
15378 Adjust callers.
15379 (copy_at, copy_dollar): Instead of outputting the hard coded
15380 values of $$, $n and so forth, output invocation to b4_lhs_value,
15381 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
15382 Note: this patch partially drops `semantic-parser' support: it
15383 always does `rule_length - n', where semantic parsers ought to
15384 always use `-n'.
82b6cb3f
AD
15385 * data/bison.simple, data/bison.c++ (b4_lhs_value)
15386 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15387
6cbfbcc5
AD
153882002-05-02 Akim Demaille <akim@epita.fr>
15389
15390 * configure.in (AC_INIT): Bump to 1.49b.
15391 (AM_INIT_AUTOMAKE): Short invocation.
15392
b8548114
AD
153932002-05-02 Akim Demaille <akim@epita.fr>
15394
15395 Version 1.49a.
15396
c20cd1fa
AD
153972002-05-01 Akim Demaille <akim@epita.fr>
15398
15399 * src/skeleton.h: Remove.
15400
8a9566d4
AD
154012002-05-01 Akim Demaille <akim@epita.fr>
15402
15403 * src/skeleton.h: Fix the #endif.
15404 Reported by Magnus Fromreide.
15405
8c6d399a
PE
154062002-04-26 Paul Eggert <eggert@twinsun.com>
15407
15408 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
15409 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 15410 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 15411
2b7ed18a
RA
154122002-04-25 Robert Anisko <robert@lrde.epita.fr>
15413
15414 * src/scan-skel.l: Postprocess quadrigraphs.
15415
15416 * src/reader.c (copy_character): New function, used to output
15417 single characters while replacing `[' and `]' with quadrigraphs, to
15418 avoid troubles with M4 quotes.
15419 (copy_comment): Output characters with copy_character.
15420 (read_additionnal_code): Likewise.
15421 (copy_string2): Likewise.
15422 (copy_definition): Likewise.
15423
15424 * tests/calc.at: Exercise M4 quoting.
15425
34a89c50
AD
154262002-04-25 Akim Demaille <akim@epita.fr>
15427
15428 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
15429 between `!' and the command.
15430 Reported by Paul Eggert.
15431
0dd1580a
RA
154322002-04-24 Robert Anisko <robert@lrde.epita.fr>
15433
15434 * tests/calc.at: Exercise prologue splitting.
15435
15436 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
15437 `b4_post_prologue' instead of `b4_prologue'.
15438
15439 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
15440 muscles.
15441 (output): Free pre_prologue_obstack and post_prologue_obstack.
15442 * src/files.h, src/files.c (attrs_obstack): Remove.
15443 (pre_prologue_obstack, post_prologue_obstack): New.
15444 * src/reader.c (copy_definition): Add a parameter to specify the
15445 obstack to fill, instead of using attrs_obstack unconditionally.
15446 (read_declarations): Pass pre_prologue_obstack to copy_definition if
15447 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
15448
83c1796f
PE
154492002-04-23 Paul Eggert <eggert@twinsun.com>
15450
15451 * data/bison.simple: Remove unnecessary commentary and white
15452 space differences from 1_29-branch.
15453 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
15454
15455 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
15456 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
15457 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
15458 constructors or destructors.
15459
15460 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
15461
1207eeac
AD
154622002-04-23 Akim Demaille <akim@epita.fr>
15463
15464 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
15465 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
15466 location with columns.
15467 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
15468 All reported by Paul Eggert.
15469
78ab8f67
AD
154702002-04-22 Akim Demaille <akim@epita.fr>
15471
15472 * src/reduce.c (dump_grammar): Move to...
15473 * src/gram.h, src/gram.c (grammar_dump): here.
15474 Be sure to separate long item numbers.
15475 Don't read the members of a rule's prec if its nil.
15476
133c20e2
AD
154772002-04-22 Akim Demaille <akim@epita.fr>
15478
15479 * src/output.c (table_size, table_grow): New.
15480 (MAXTABLE): Remove, replace uses with table_size.
15481 (pack_vector): Instead of dying when the table is too big, grow it.
15482
9515e8a7
AD
154832002-04-22 Akim Demaille <akim@epita.fr>
15484
15485 * data/bison.simple (yyr1): Its type is that of a token number.
15486 * data/bison.c++ (r1_): Likewise.
15487 * tests/regression.at (Web2c Actions): Adjust.
15488
23c5a174
AD
154892002-04-22 Akim Demaille <akim@epita.fr>
15490
15491 * src/reader.c (token_translations_init): 256 is now the default
15492 value for the error token, i.e., it will be assigned another
15493 number if the user assigned 256 to one of her tokens.
15494 (reader): Don't force 256 to error.
15495 * doc/bison.texinfo (Symbols): Adjust.
15496 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
15497 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
15498 etc. instead of 10, 20, 30 (which was used to `jump' over error
15499 (256) and undefined (2)).
15500
5fbb0954
AD
155012002-04-22 Akim Demaille <akim@epita.fr>
15502
15503 Propagate more token_number_t.
15504
15505 * src/gram.h (token_number_as_item_number)
15506 (item_number_as_token_number): New.
15507 * src/output.c (GENERATE_OUTPUT_TABLE): New.
15508 Use it to create output_item_number_table and
15509 output_token_number_table.
15510 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15511 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
15512 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
15513 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
15514
4f940944
AD
155152002-04-22 Akim Demaille <akim@epita.fr>
15516
15517 * src/output.h, src/output.c (get_lines_number): Remove.
15518
3ded9a63
AD
155192002-04-19 Akim Demaille <akim@epita.fr>
15520
15521 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
15522 as Lex/Flex'.
15523 (Debugging): More details about enabling the debugging features.
15524 (Table of Symbols): Describe $$, $n, @$, and @n.
15525 Suggested by Tim Josling.
15526
e0c471a9
AD
155272002-04-19 Akim Demaille <akim@epita.fr>
15528
15529 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
15530
fecc10cd
AD
155312002-04-10 Akim Demaille <akim@epita.fr>
15532
15533 * src/system.h: Rely on HAVE_LIMITS_H.
15534 Suggested by Paul Eggert.
15535
51dec47b
AD
155362002-04-09 Akim Demaille <akim@epita.fr>
15537
15538 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
15539 full stderr, and strip it according to the bison options, instead
15540 of composing the error message from different bits.
15541 This makes it easier to check for several error messages.
15542 Adjust all the invocations.
15543 Add an invocation exercising the error token.
15544 Add an invocation demonstrating a stupid error message.
15545 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
15546 Adjust the tests.
15547 Error message are for stderr, not stdout.
15548
007a50a4
AD
155492002-04-09 Akim Demaille <akim@epita.fr>
15550
15551 * src/gram.h, src/gram.c (error_token_number): Remove, use
15552 errtoken->number.
15553 * src/reader.c (reader): Don't specify the user token number (2)
15554 for $undefined, as it uselessly prevents using it.
15555 * src/gram.h (token_number_t): Move to...
15556 * src/symtab.h: here.
15557 (state_t.number): Is a token_number_t.
15558 * src/print.c, src/reader.c: Use undeftoken->number instead of
15559 hard coded 2.
15560 (Even though this 2 is not the same as above: the number of the
15561 undeftoken remains being 2, it is its user token number which
15562 might not be 2).
15563 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
15564 `user_token_number_max'.
15565 Output `undef_token_number'.
15566 * data/bison.simple, data/bison.c++: Use them.
15567 Be sure to map invalid yylex return values to
15568 `undef_token_number'. This saves us from gratuitous SEGV.
15569
15570 * tests/conflicts.at (Solved SR Conflicts)
15571 (Unresolved SR Conflicts): Adjust.
15572 * tests/regression.at (Web2c Actions): Adjust.
15573
06446ccf
AD
155742002-04-08 Akim Demaille <akim@epita.fr>
15575
15576 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
15577 Adding #line.
15578 Remove the duplicate `typedefs'.
15579 (RhsNumberType): Fix the declaration and various other typos.
15580 Use __ofile__.
15581 * data/bison.simple: Use __ofile__.
15582 * src/scan-skel.l: Handle __ofile__.
15583
62a3e4f0
AD
155842002-04-08 Akim Demaille <akim@epita.fr>
15585
15586 * src/gram.h (item_number_t): New, the type of item numbers in
15587 RITEM. Note that it must be able to code symbol numbers as
15588 positive number, and the negation of rule numbers as negative
15589 numbers.
15590 Adjust all dependencies (pretty many).
15591 * src/reduce.c (rule): Remove this `short *' pointer: use
15592 item_number_t.
15593 * src/system.h (MINSHORT, MAXSHORT): Remove.
15594 Include `limits.h'.
15595 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
15596 (shortcpy): Remove.
15597 (MAXTABLE): Move to...
15598 * src/output.c (MAXTABLE): here.
15599 (prepare_rules): Use output_int_table to output rhs.
15600 * data/bison.simple, data/bison.c++: Adjust.
15601 * tests/torture.at (Big triangle): Move the limit from 254 to
15602 500.
15603 * tests/regression.at (Web2c Actions): Ajust.
15604
15605 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
15606 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
15607 passes, but produces negative #line number, once fixed, GCC is
15608 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
15609 C), it passes.
15610 * src/state.h (state_h): Code input lines on ints, not shorts.
15611
bb88b0fc
AD
156122002-04-08 Akim Demaille <akim@epita.fr>
15613
15614 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
15615 and then the grammar.
15616
9a636f47
AD
156172002-04-08 Akim Demaille <akim@epita.fr>
15618
15619 * src/system.h: No longer using strndup.
15620
680e8701
AD
156212002-04-07 Akim Demaille <akim@epita.fr>
15622
15623 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
15624 * src/output.c (output_table_data): Return the longest number.
15625 (prepare_tokens): Output `token_number_max').
15626 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
15627 New.
15628 Use them to define yy_token_number_type/TokenNumberType.
15629 Use this type for yytranslate.
15630 * tests/torture.at (Big triangle): Push the limit from 124 to
15631 253.
15632 * tests/regression.at (Web2c Actions): Adjust.
15633
817e9f41
AD
156342002-04-07 Akim Demaille <akim@epita.fr>
15635
15636 * tests/torture.at (Big triangle): New.
15637 (GNU AWK Grammar, GNU Cim Grammar): Move to...
15638 * tests/existing.at: here.
15639
5123689b
AD
156402002-04-07 Akim Demaille <akim@epita.fr>
15641
15642 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
15643 nritems.
15644 Adjust dependencies.
15645
f3849179
AD
156462002-04-07 Akim Demaille <akim@epita.fr>
15647
15648 * src/reader.c: Normalize increments to prefix form.
15649
bd02036a
AD
156502002-04-07 Akim Demaille <akim@epita.fr>
15651
15652 * src/reader.c, symtab.c: Remove debugging code.
15653
db8837cb
AD
156542002-04-07 Akim Demaille <akim@epita.fr>
15655
15656 Rename all the `bucket's as `symbol_t'.
15657
15658 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
15659 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
15660 * src/symtab.c, src/symtab.h (bucket): Rename as...
15661 (symbol_t): this.
15662 (symbol_list_new, bucket_check_defined, bucket_make_alias)
15663 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
15664 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15665 (buckets_new, buckets_free, buckets_do): Rename as...
15666 (symbol_list_new, symbol_check_defined, symbol_make_alias)
15667 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15668 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
15669 (symbols_new, symbols_free, symbols_do): these.
15670
72a23c97
AD
156712002-04-07 Akim Demaille <akim@epita.fr>
15672
15673 Use lib/hash for the symbol table.
15674
15675 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
15676 EOF.
15677 * src/lex.c (lex): Set the `number' member of new terminals.
15678 * src/reader.c (bucket_check_defined, bucket_make_alias)
15679 (bucket_check_alias_consistence, bucket_translation): New.
15680 (reader, grammar_free, readgram, token_translations_init)
15681 (packsymbols): Adjust.
15682 (reader): Number the predefined tokens.
15683 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
15684 for predefined tokens.
15685 * src/symtab.h (bucket): Remove all the hash table related
15686 members.
15687 * src/symtab.c (symtab): Replace by...
15688 (bucket_table): this.
15689 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
15690 (buckets_new, buckets_do): New.
15691
280a38c3
AD
156922002-04-07 Akim Demaille <akim@epita.fr>
15693
15694 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
15695 (start_symbol, max_user_token_number, semantic_parser)
15696 (error_token_number): Initialize.
15697 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
15698 Initialize.
15699 (reader): Don't.
15700 (errtoken, eoftoken, undeftoken, axiom): Extern.
15701
03b31c0c
AD
157022002-04-07 Akim Demaille <akim@epita.fr>
15703
15704 * src/gram.h (rule_s): prec and precsym are now pointers
15705 to the bucket giving the priority/associativity.
15706 Member `associativity' removed: useless.
15707 * src/reduce.c, src/conflicts.c: Adjust.
15708
8b3df748
AD
157092002-04-07 Akim Demaille <akim@epita.fr>
15710
15711 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
15712 Properly escape the symbols' TAG when outputting them.
15713
e601aa1d
AD
157142002-04-07 Akim Demaille <akim@epita.fr>
15715
15716 * src/lalr.h (LA): Is a bitsetv, not bitset*.
15717
b0299a2e
AD
157182002-04-07 Akim Demaille <akim@epita.fr>
15719
15720 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
15721 (LArule): this, which is an array to rule_t*.
15722 * src/print.c, src/conflicts.c: Adjust.
15723
d7e1f00c
AD
157242002-04-07 Akim Demaille <akim@epita.fr>
15725
15726 * src/gram.h (rule_t): Rename `number' as `user_number'.
15727 `number' is a new member.
15728 Adjust dependencies.
15729 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
15730
cc9305dd
AD
157312002-04-07 Akim Demaille <akim@epita.fr>
15732
15733 As a result of the previous patch, it is no longer needed
15734 to reorder ritem itself.
15735
15736 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
15737
b0940840
AD
157382002-04-07 Akim Demaille <akim@epita.fr>
15739
15740 Be sure never to walk through RITEMS, but use only data related to
15741 the rules themselves. RITEMS should be banished.
15742
15743 * src/output.c (output_token_translations): Rename as...
15744 (prepare_tokens): this.
15745 In addition to `translate', prepare the muscles `tname' and
15746 `toknum', which were handled by...
15747 (output_rule_data): this.
15748 Remove, and move the remainder of its outputs into...
15749 (prepare_rules): this new routines, which also merges content from
15750 (output_gram): this.
15751 (prepare_rules): Be sure never to walk through RITEMS.
15752 (output_stos): Rename as...
15753 (prepare_stos): this.
15754 (output): Always invoke prepare_states, after all, just don't use it
15755 in the output if you don't need it.
15756
643a5994
AD
157572002-04-07 Akim Demaille <akim@epita.fr>
15758
15759 * src/LR0.c (new_state): Display `nstates' as the name of the
15760 newly created state.
15761 Adjust to initialize first_state and last_state if needed.
15762 Be sure to distinguish the initial from the final state.
15763 (new_states): Create the itemset of the initial state, and use
15764 new_state.
15765 * src/closure.c (closure): Now that the initial state has its
15766 items properly set, there is no need for a special case when
15767 creating `ruleset'.
15768
15769 As a result, now the rule 0, reducing to $axiom, is visible in the
15770 outputs. Adjust the test suite.
15771
15772 * tests/conflicts.at (Solved SR Conflicts)
15773 (Unresolved SR Conflicts): Adjust.
15774 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
15775 * tests/conflicts.at (S/R in initial): New.
15776
b4c4ccc2
AD
157772002-04-07 Akim Demaille <akim@epita.fr>
15778
15779 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
15780 the RHS of the rules.
15781 * src/output.c (output_gram): Likewise.
15782
bba97eb2
AD
157832002-04-07 Akim Demaille <akim@epita.fr>
15784
15785 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
15786 bucket.
15787 Adjust all dependencies.
15788 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
15789 `number' of the buckets too.
15790 * src/gram.h: Include `symtab.h'.
15791 (associativity): Move to...
15792 * src/symtab.h: here.
15793 No longer include `gram.h'.
15794
c3b407f4
AD
157952002-04-07 Akim Demaille <akim@epita.fr>
15796
15797 * src/gram.h, src/gram.c (rules_rhs_length): New.
15798 (ritem_longest_rhs): Use it.
15799 * src/gram.h (rule_t): `number' is a new member.
15800 * src/reader.c (packgram): Set it.
15801 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
15802 the end of `rules', and count them out of `nrules'.
15803 (reduce_output, dump_grammar): Adjust.
15804 * src/print.c (print_grammar): It is no longer needed to check for
15805 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
15806 * tests/reduce.at (Reduced Automaton): New test.
15807
11652ab3
AD
158082002-04-07 Akim Demaille <akim@epita.fr>
15809
15810 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
15811 lacking `+ 1' to nrules, Bison reported as useless a token if it
15812 was used solely to set the precedence of the last rule...
15813
26b23c1a
AD
158142002-04-07 Akim Demaille <akim@epita.fr>
15815
15816 * data/bison.c++, data/bison.simple: Don't output the current file
15817 name in #line, to avoid useless diffs between two identical
15818 outputs under different names.
15819
18bcecb0
AD
158202002-04-07 Akim Demaille <akim@epita.fr>
15821
15822 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
15823 Normalize loops to using `< nrules + 1', not `<= nrules'.
15824
fa770c86
AD
158252002-04-07 Akim Demaille <akim@epita.fr>
15826
15827 * TODO: Update.
15828
d9b739c3
AD
158292002-04-07 Akim Demaille <akim@epita.fr>
15830
15831 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
15832 bucket.value as bucket.number.
15833
99013900
AD
158342002-04-07 Akim Demaille <akim@epita.fr>
15835
15836 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
15837 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15838 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
15839 RHS, instead of being an index in RITEMS.
15840
e966383b
PE
158412002-04-04 Paul Eggert <eggert@twinsun.com>
15842
15843 * doc/bison.texinfo: Update copyright date.
15844 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
15845 (Symbols): Warn about running Bison in one character set,
15846 but compiling and/or running in an incompatible one.
15847 Warn about character code 256, too.
15848
158492002-04-03 Paul Eggert <eggert@twinsun.com>
15850
15851 * src/bison.data (YYSTACK_ALLOC): Depend on whether
15852 YYERROR_VERBOSE is nonzero, not whether it is defined.
15853
15854 Merge changes from bison-1_29-branch.
c307773e 15855
8d6c48b9
PE
158562002-03-20 Paul Eggert <eggert@twinsun.com>
15857
15858 Merge fixes from Debian bison_1.34-1.diff.
15859
15860 * configure.in (AC_PREREQ): 2.53.
15861
e53c6322
AD
158622002-03-20 Akim Demaille <akim@epita.fr>
15863
15864 * src/conflicts.c (log_resolution): Argument `resolution' is const.
15865
9ffbeca7
PE
158662002-03-19 Paul Eggert <eggert@twinsun.com>
15867
21db0b2a
PE
15868 * src/bison.simple (YYCOPY): New macro.
15869 (YYSTACK_RELOCATE): Use it.
15870 Remove Type arg; no longer needed. All callers changed.
15871 (yymemcpy): Remove; no longer needed.
15872
9ffbeca7
PE
15873 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
15874 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15875
642cb8f8
AD
158762002-03-19 Akim Demaille <akim@epita.fr>
15877
15878 Test and fix the #line outputs.
15879
15880 * tests/atlocal.at (GCC): New.
15881 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 15882 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
15883 (Action synch line, Epilogue synch line): New tests.
15884 * src/reader.c (parse_union_decl): Define the muscle stype_line.
15885 * data/bison.simple, data/bison.c++: Use it.
15886
3c31a486
AD
158872002-03-19 Akim Demaille <akim@epita.fr>
15888
15889 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
15890 (Solved SR Conflicts, %expect not enough, %expect right)
15891 (%expect too much): Move to...
15892 * tests/conflicts.at: this new file.
15893
0d8bed56
AD
158942002-03-19 Akim Demaille <akim@epita.fr>
15895
15896 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
15897 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
15898 that we can move to enums for instance.
15899 * src/output.c (token_definitions_output): Output a list of
15900 `token-name, token-number' instead of the #define.
15901 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
15902
9208d17f
AD
159032002-03-14 Akim Demaille <akim@epita.fr>
15904
15905 Use Gettext 0.11.1.
15906
af27eacb
RA
159072002-03-09 Robert Anisko <robert@lrde.epita.fr>
15908
15909 * data/bison.c++: Make the user able to add members to the generated
15910 parser by subclassing.
15911
9101a310
RA
159122002-03-05 Robert Anisko <robert@lrde.epita.fr>
15913
15914 * src/reader.c (read_additionnal_code): `c' should be an integer, not
15915 a character.
15916 Reported by Nicolas Tisserand and Nicolas Burrus.
15917
fff9bf0b
RA
159182002-03-04 Robert Anisko <robert@lrde.epita.fr>
15919
15920 * src/reader.c: Warn about lacking semi-colons, do not complain.
15921
64dba31e
RA
159222002-03-04 Robert Anisko <robert@lrde.epita.fr>
15923
15924 * data/bison.c++: Remove a debug line.
15925
374f5a14
RA
159262002-03-04 Robert Anisko <robert@lrde.epita.fr>
15927
15928 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
15929 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
15930 provide a default implementation.
15931
bfcf1f3a
AD
159322002-03-04 Akim Demaille <akim@epita.fr>
15933
15934 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
15935 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
15936 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
15937 * tests/semantic.at (Parsing Guards): Similarly.
15938 * src/reader.at (readgram): Complain if the last rule is not ended
15939 with a semi-colon.
15940
65ccf9fc
AD
159412002-03-04 Akim Demaille <akim@epita.fr>
15942
15943 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
15944 * src/closure.c: here.
15945 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
15946 RTC.
15947 * src/warshall.h, src/warshall.c: Remove.
15948 * tests/sets.at (Broken Closure): Adjust.
15949
d0039cbc
AD
159502002-03-04 Akim Demaille <akim@epita.fr>
15951
15952 * src/output.c (output_skeleton): tempdir is const.
15953 bytes_read is unused.
15954
345cea78
AD
159552002-03-04 Akim Demaille <akim@epita.fr>
15956
15957 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
15958 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
15959 Update.
15960 From Michael Hayes.
15961
564801f7
AD
159622002-03-04 Akim Demaille <akim@epita.fr>
15963
15964 * src/closure.c (closure): `r' is unused.
15965
e5352bc7
AD
159662002-03-04 Akim Demaille <akim@epita.fr>
15967
15968 * tests/sets.at (Broken Closure): Add the ending `;'.
15969 * src/reader.at (readgram): Complain if a rule is not ended with a
15970 semi-colon.
15971
914feea9
AD
159722002-03-04 Akim Demaille <akim@epita.fr>
15973
15974 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
15975 (count_sr_conflicts): Use bitset_count.
15976 * src/reduce.c (inaccessable_symbols): Ditto.
15977 (bits_size): Remove.
15978 * src/warshall.h, src/warshall.c: Convert to bitsetv.
15979
f0250de6
AD
159802002-03-04 Akim Demaille <akim@epita.fr>
15981
15982 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
15983 * src/reduce.c: Remove the `bitset_zero's following the
15984 `bitset_create's, as now it is performed by the latter.
15985
ef017502
AD
159862002-03-04 Akim Demaille <akim@epita.fr>
15987
15988 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
15989 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
15990 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
15991 latest sources from Michael.
15992
76514394
AD
159932002-03-04 Akim Demaille <akim@epita.fr>
15994
15995 * src/output.c (output): Don't free the grammar.
15996 * src/reader.c (grammar_free): New.
15997 * src/main.c (main): Call it and don't free symtab here.
15998
55024580
AD
159992002-03-04 Akim Demaille <akim@epita.fr>
16000
16001 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16002 before returning.
16003 Reported by Benoit Perrot.
16004
f9abaa2c
AD
160052002-03-04 Akim Demaille <akim@epita.fr>
16006
16007 Use bitset operations when possible, not loops over bits.
16008
16009 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16010 bitset_or.
16011 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16012 * src/reduce.c (useless_nonterminals): Formatting changes.
16013 * src/warshall.c (TC): Use bitset_or.
16014
0e721e75
AD
160152002-03-04 Akim Demaille <akim@epita.fr>
16016
16017 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16018 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16019 Ditto.
16020
0fb1ffb1
AD
160212002-03-04 Akim Demaille <akim@epita.fr>
16022
16023 * src/lalr.c (F): Now a bitset*.
16024 Adjust all dependencies.
16025
b86796bf
AD
160262002-03-04 Akim Demaille <akim@epita.fr>
16027
16028 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16029 Adjust all dependencies.
16030
602bbf31
AD
160312002-03-04 Akim Demaille <akim@epita.fr>
16032
16033 * src/L0.c, src/LR0.h (nstates): Be size_t.
16034 Adjust comparisons (signed vs unsigned).
16035 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16036 bitset*.
16037 Adjust all dependencies.
16038
d8a0245c
AD
160392002-03-04 Akim Demaille <akim@epita.fr>
16040
16041 * src/closure.c (firsts): Now, also a bitset.
16042 Adjust all dependencies.
16043 (varsetsize): Remove, now unused.
16044 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16045
34ba9743
AD
160462002-03-04 Akim Demaille <akim@epita.fr>
16047
16048 * src/print.c: Convert to use bitset.h, not hand coded iterations
16049 over ints.
16050
ed86e78c
AD
160512002-03-04 Akim Demaille <akim@epita.fr>
16052
16053 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16054
dfdb1797
AD
160552002-03-04 Akim Demaille <akim@epita.fr>
16056
16057 * src/closure.c (ruleset): Be a bitset.
16058 (rulesetsize): Remove.
16059
7086e707
AD
160602002-03-04 Akim Demaille <akim@epita.fr>
16061
16062 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16063 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16064 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16065 * src/closure.c (fderives): Be an array of bitsets.
16066
98254360
RA
160672002-02-28 Robert Anisko <robert@lrde.epita.fr>
16068
16069 * data/bison.c++: Merge the two generated headers. Insert a copyright
16070 notice in each output file.
16071
a75c057f
AD
160722002-02-28 Akim Demaille <akim@epita.fr>
16073
16074 * data/bison.c++: Copy the prologue of bison.simple to fetch
16075 useful M4 definitions, such as b4_header_guard.
16076
06b00abc
AD
160772002-02-25 Akim Demaille <akim@epita.fr>
16078
16079 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
16080 translator friendly scheme for the bgr
16081 copyright notice.
06b00abc 16082
70e7d534
AD
160832002-02-25 Akim Demaille <akim@epita.fr>
16084
16085 * src/output.c (header_output): Remove, now handled completely via
16086 M4.
16087
abe017f6
AD
160882002-02-25 Akim Demaille <akim@epita.fr>
16089
16090 * m4/m4.m4: New, from CVS Autoconf.
16091 * configure.in: Invoke it.
16092 * src/output.c (output_skeleton): Use its result instead of the
16093 hard coded name.
16094
381fb12e
AD
160952002-02-25 Akim Demaille <akim@epita.fr>
16096
16097 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16098 Fileutils 4.1.5.
16099 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16100 * src/output.c (output_skeleton): Use mkstemp to create a real
16101 temporary file.
16102 Move the filling of `skeleton' and its muscle to...
16103 (prepare): here.
16104 (output): Move the definition of the prologue muscle to...
16105 (prepare): here.
16106 * src/system.h (DEFAULT_TMPDIR): New.
16107
6f38107f
PE
161082002-02-14 Paul Eggert <eggert@twinsun.com>
16109
16110 Remove the support for C++ namespace cleanliness; it was
16111 causing more problems than it was curing, since it didn't work
16112 properly on some nonstandard C++ compilers. This can wait
16113 for a proper C++ parser.
16114
16115 * NEWS: Document this.
16116 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16117 of C++, as it's treated like C now.
16118 * src/bison.simple (YYSTD): Remove.
16119 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16120 Treat C++ just like Standard C instead of trying to support
16121 namespace cleanliness.
16122
80cce3da
AD
161232002-02-14 Akim Demaille <akim@epita.fr>
16124
16125 * tests/regression.at (else): Adjust to Andreas' change.
16126
842e8679
AD
161272002-02-14 Akim Demaille <akim@epita.fr>
16128
16129 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16130
4bda3f10
AD
161312002-02-13 Andreas Schwab <schwab@suse.de>
16132
16133 * src/output.c (output_rule_data): Don't output NULL, it might
16134 not be defined yet.
16135
4162fa07 161362002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 16137
4162fa07
RA
16138 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16139 (Copyright notice): Update.
b418ecd8 16140
bd16a5dc
AD
161412002-02-11 Akim Demaille <akim@epita.fr>
16142
16143 * tests/regression.at (%nonassoc and eof): Don't include
16144 nonportable headers.
16145
8d69a1a3
RA
161462002-02-08 Robert Anisko <robert@lrde.epita.fr>
16147
16148 * data/bison.c++: Correct error recovery. Make the user able to
16149 initialize the starting location.
16150
9b2d0677
AD
161512002-02-07 Akim Demaille <akim@epita.fr>
16152
16153 * tests/input.at: New.
16154
69e2658b
RA
161552002-02-07 Robert Anisko <robert@lrde.epita.fr>
16156
16157 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 16158 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
16159 directives around tables only needed for debugging.
16160
4aacc3a7
RA
161612002-02-07 Robert Anisko <robert@lrde.epita.fr>
16162
16163 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16164 C++ parsers.
16165 (yy::b4_name::parse): Use print_.
16166
762a801e
RA
161672002-02-07 Robert Anisko <robert@lrde.epita.fr>
16168
16169 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16170
4bb2bc3f
RA
161712002-02-07 Robert Anisko <robert@lrde.epita.fr>
16172
16173 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16174 C++ parsers.
16175 (yy::b4_name::parse): Build verbose error messages, and use error_.
16176
6b45a3ca
RA
161772002-02-06 Robert Anisko <robert@lrde.epita.fr>
16178
16179 * data/bison.c++: Fix m4 quoting in comments.
16180
50997c6e
RA
161812002-02-06 Robert Anisko <robert@lrde.epita.fr>
16182
16183 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16184 not expanded by m4.
16185
3f3eed27
AD
161862002-02-05 Akim Demaille <akim@epita.fr>
16187
16188 * data/bison.c++: Adjust to the M4 back end.
16189 More is certainly needed.
16190
be2a1a68
AD
161912002-02-05 Akim Demaille <akim@epita.fr>
16192
16193 Give a try to M4 as a back end.
16194
16195 * lib/readpipe.c: New, from wdiff.
16196 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16197 BISON_HAIRY.
16198 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16199 specific values. Now it is m4 that performs the lookup.
16200 * src/parse-skel.y: Remove.
16201 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16202 * src/output.c (actions_output, guards_output)
16203 (token_definitions_output): No longer keeps track of the output
16204 line number, hence remove the second argument.
16205 (guards_output): Check against the guard member of a rule, not the
16206 action member.
16207 Adjust callers.
16208 (output_skeleton): Don't look for the skeleton location, let m4 do
16209 that.
16210 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16211 file will be used.
16212 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16213 (prepare): Given that for the time being changesyntax is not
16214 usable in M4, rename the muscles using `-' to `_'.
16215 Define `defines_flag', `output_parser_name' and `output_header_name'.
16216 * src/output.h (actions_output, guards_output)
16217 (token_definitions_output): Adjust prototypes.
16218 * src/scan-skel.l: Instead of scanning the skeletons, it now
16219 processes the output of m4: `__oline__' and `#output'.
16220 * data/bison.simple: Adjust to be used by M4(sugar).
16221 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16222 to date.
16223 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16224 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16225 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16226 shamelessly stolen from CVS Autoconf.
16227
beda758b
AD
162282002-02-05 Akim Demaille <akim@epita.fr>
16229
16230 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16231 * configure.in: Check for the declarations of free and malloc.
16232 * src/muscle_tab.c: Adjust.
16233
5ece6d43
AD
162342002-02-05 Akim Demaille <akim@epita.fr>
16235
16236 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16237 which have no values.
16238
5bb18f9a
AD
162392002-02-05 Akim Demaille <akim@epita.fr>
16240
16241 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16242 * data/: here.
16243
894dd62e
PE
162442002-01-29 Paul Eggert <eggert@twinsun.com>
16245
16246 * src/bison.simple (YYSIZE_T): Do not define merely because
16247 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16248 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16249
82841af7
AD
162502002-01-27 Akim Demaille <akim@epita.fr>
16251
16252 Fix `%nonassoc and eof'.
16253
16254 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16255 which were not properly copied! Replace
16256 memcpy (res->errs, src->errs, src->nerrs);
16257 with
16258 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16259 !!!
16260 * tests/regression.at (%nonassoc and eof): Adjust to newest
16261 Autotest: `.' is not in the PATH.
16262
318b76e9
AD
162632002-01-27 Akim Demaille <akim@epita.fr>
16264
16265 * tests/sets.at (AT_EXTRACT_SETS): New.
16266 (Nullable): Use it.
16267 (Firsts): New.
16268
30d2f3d5
AD
162692002-01-26 Akim Demaille <akim@epita.fr>
16270
16271 * tests/actions.at, tests/calc.at, tests/headers.at,
16272 * tests/torture.at: Adjust to the newest Autotest which no longer
16273 forces `.' in the PATH.
16274
30f8c395
AD
162752002-01-25 Akim Demaille <akim@epita.fr>
16276
16277 * tests/regression.at (%nonassoc and eof): New.
16278 Suggested by Robert Anisko.
16279
29ae55f1
AD
162802002-01-24 Akim Demaille <akim@epita.fr>
16281
16282 Bison dumps core when trying to complain about broken input files.
16283 Reported by Cris van Pelt.
16284
16285 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16286 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16287 into...
16288 (Invalid inputs): Strengthen: exercise parse_percent_token.
16289
2b548aa6
RA
162902002-01-24 Robert Anisko <robert.anisko@epita.fr>
16291
16292 * src/Makefile.am: Add bison.c++.
16293 * src/bison.c++: New skeleton.
16294
bb0146c2
AD
162952002-01-21 Paolo Bonzini <bonzini@gnu.org>
16296
16297 * po/it.po: New.
16298
bec30531
AD
162992002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
16300
16301 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
16302
fc6edc45
MA
163032002-01-20 Marc Autret <marc@gnu.org>
16304
16305 * src/files.c (compute_output_file_names): Fix
16306
5e5d5415
MA
163072002-01-20 Marc Autret <marc@gnu.org>
16308
16309 * tests/output.at: New test.
16310 * src/files.c (compute_base_names): Don't map extensions when
16311 the YACC flag is set, use defaults.
16312 Reported by Evgeny Stambulchik.
16313
44ea3fbd
MA
163142002-01-20 Marc Autret <marc@gnu.org>
16315
ba0fe3c7
PE
16316 * src/system.h: Need to define __attribute__ away for non-GCC
16317 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
16318 Suggested by Albert Chin-A-Young.
16319
338963d1
TVH
163202002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
16321
16322 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
16323 canonical definition.
16324 * src/system.h: Use the canonical definition for PARAMS (avoids
16325 a conflict with the macro from lib/hash.h).
16326
c57b2479
AD
163272002-01-11 Akim Demaille <akim@epita.fr>
16328
16329 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 16330 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 16331
b85810ae
AD
163322002-01-09 Akim Demaille <akim@epita.fr>
16333
16334 * src/files.c, src/files.h (output_infix): New.
16335 (tab_extension): Remove.
16336 (compute_base_names): Compute the former, drop the latter.
16337 * src/output.c (prepare): Insert the muscles `output-infix', and
16338 `output-suffix'.
16339 * src/parse-skel.y (string, string.1): New.
16340 (section.header): Use it.
16341 (section.yacc): Remove.
16342 (prefix): Remove too.
16343 * src/scan-skel.l: Adjust.
16344 * src/bison.simple, src/bison.hairy: Adjust.
16345
cae60122
AD
163462002-01-09 Akim Demaille <akim@epita.fr>
16347
16348 * configure.in (WERROR_CFLAGS): Compute it.
16349 * src/Makefile.am (CFLAGS): Pass it.
16350 * tests/atlocal.in (CFLAGS): Idem.
16351 * src/files.c: Fix a few warnings.
16352 (get_extension_index): Remove, unused.
16353
ae404801
AD
163542002-01-08 Akim Demaille <akim@epita.fr>
16355
16356 * src/getargs.c (AS_FILE_NAME): New.
16357 (getargs): Use it to convert DOSish file names.
16358 * src/files.c (base_name): Rename as full_base_name to avoid
16359 clashes with `base_name ()'.
16360 (filename_split): New.
16361 (compute_base_names): N-th rewrite, using filename_split.
16362
22312b71
AD
163632002-01-08 Akim Demaille <akim@epita.fr>
16364
16365 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
16366 New, stolen from the Fileutils 4.1.
16367 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16368 * configure.in: Check for the presence of memrchr, and of its
16369 prototype.
16370
a67cef01
TVH
163712002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
16372
16373 * lib/hash.h (__P): Added definition for this macro.
16374 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
16375 BUILT_SOURCES, to ensure they are generated first.
16376 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
16377 %error-verbose to allow bootstrapping with bison 1.30x.
16378
2b25d624
AD
163792002-01-06 Akim Demaille <akim@epita.fr>
16380
16381 * src/reader.c (parse_braces): Don't fetch the next char, the
16382 convention is to fetch on entry.
16383 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
16384 'switch' without a following semicolon.
16385 * tests/regression.at (braces parsing): New.
16386
3460813b
AD
163872002-01-06 Akim Demaille <akim@epita.fr>
16388
16389 Bison is dead wrong in its RR conflict reports.
16390
16391 * tests/torture.at (GNU Cim Grammar): New.
16392 * src/conflicts.c (count_rr_conflicts): Fix.
16393
73784c64
AD
163942002-01-06 Akim Demaille <akim@epita.fr>
16395
16396 Creating package.m4 from configure.ac causes too many problems.
16397
16398 * tests/Makefile.am (package.m4): Create it by hand,
16399 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
16400
25d81090
AD
164012002-01-06 Akim Demaille <akim@epita.fr>
16402
16403 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
16404 skeleton.h.
16405
a9b8959e
PE
164062002-01-04 Paul Eggert <eggert@twinsun.com>
16407
16408 * doc/bison.texinfo (Debugging):
16409 Remove YYSTDERR; it's no longer defined or used.
16410 Also, s/cstdio.h/cstdio/.
16411
25d81090
AD
164122002-01-03 Akim Demaille <akim@epita.fr>
16413
16414 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
16415
1109455c
AD
164162002-01-03 Akim Demaille <akim@epita.fr>
16417
16418 * src/parse-skel.y (process_skeleton): Don't bind the parser's
16419 tracing code to --trace, wait for a better --trace option, with
16420 args.
16421
7ea5e977
AD
164222002-01-03 Akim Demaille <akim@epita.fr>
16423
16424 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
16425 The ISO C++ standard is extremely clear about it: stderr is
16426 considered a macro, not a regular symbol (see table 94 `Header
16427 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
16428 Therefore std:: does not apply to it. It still does with fprintf.
16429 Also, s/cstdio.h/cstdio/.
16430
fab5b110
AD
164312002-01-03 Akim Demaille <akim@epita.fr>
16432
16433 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
16434 for non system headers.
16435
aed7fd9b
AD
164362002-01-02 Akim Demaille <akim@epita.fr>
16437
16438 Equip the skeleton chain with location tracking, runtime trace,
16439 pure parser and scanner.
16440
16441 * src/parse-skel.y: Request a pure parser, locations, and prefix
16442 renaming.
16443 (%union): Having several members with the same type does not help
16444 type mismatches, simplify.
16445 (YYPRINT, yyprint): New.
16446 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
16447 (skel_error): this.
16448 Handle locations.
16449 * src/scan-skel.l: Adjust to these changes.
16450 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
16451 (LOCATION_PRINT, skel_control_t): New.
16452
24fad99e
AD
164532001-12-30 Akim Demaille <akim@epita.fr>
16454
16455 * src/parse-skel.y: Get rid of the shift/reduce conflict:
16456 replace `gb' with BLANKS.
16457 * src/scan-skel.l: Adjust.
16458
a4b36db4
AD
164592001-12-30 Akim Demaille <akim@epita.fr>
16460
16461 * src/system.h: We don't need nor want bcopy.
16462 Throw away MS-DOS crap: we don't need getpid.
16463 * configure.in: We don't need strndup. It was even causing
16464 problems: because Flex includes the headers *before* us,
16465 _GNU_SOURCE is not defined by config.h, and therefore strndup was
16466 not visible.
16467 * lib/xstrndup.c: New.
16468 * src/scan-skel.l: Use it.
16469 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
16470 * src/parse-skel.y: Use %directives instead of #defines.
16471
1239777d
AD
164722001-12-30 Akim Demaille <akim@epita.fr>
16473
16474 * src/skeleton.h: New.
16475 * src/output.c (output_parser, output_master_parser): Remove, dead
16476 code.
16477 * src/output.h (get_lines_number, actions_output, guards_output)
16478 (token_definitions_output): Prototype them.
16479 * src/parse-skel.y: Add the license notice.
16480 Include output.h and skeleton.h.
16481 (process_skeleton): Returns void, and takes a single parameter.
16482 * src/scan-skel.l: Add the license notice.
16483 Include skeleton.h.
16484 Don't use %option yylineno: it seems that then Flex imagines
16485 REJECT has been used, and therefore it won't reallocate its
16486 buffers (which makes no other sense to me than a bug). It results
16487 in warnings for `unused: yy_flex_realloc'.
16488
9b3add5b
RA
164892001-12-30 Robert Anisko <robert.anisko@epita.fr>
16490
16491 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16492 (MUSCLE_INSERT_PREFIX): ...to there.
16493 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
16494 (MUSCLE_INSERT_PREFIX): Move from here...
16495
16496 * src/bison.hairy: Add a section directive. Put braces around muscle
16497 names. This parser skeleton is still broken, but Bison should not
16498 choke on a bad muscle 'syntax'.
16499 * src/bison.simple: Add a section directive. Put braces around muscle
16500 names.
16501
16502 * src/files.h (strsuffix, stringappend): Add declarations.
16503 (tab_extension): Add declaration.
16504 (short_base_name): Add declaration.
16505
16506 * src/files.c (strsuffix, stringappend): No longer static. These
16507 functions are used in the skeleton parser.
16508 (tab_extension): New.
16509 (compute_base_names): Use the computations done in this function
fab5b110 16510 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
16511 names.
16512 (short_base_name): No longer static.
16513
16514 * src/output.c (output_skeleton): New.
16515 (output): Disable call to output_master_parser, and give a try to
16516 a new skeleton handling system.
16517 (guards_output, actions_output): No longer static.
16518 (token_definitions_output, get_lines_number): No longer static.
16519
16520 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
16521
fab5b110 16522 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
16523 parse-skel.y.
16524
16525 * src/parse-skel.y: New file.
16526 * src/scan-skel.l: New file.
16527
b5b61c61
AD
165282001-12-29 Akim Demaille <akim@epita.fr>
16529
16530 %name-prefix is broken.
16531
16532 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
16533 Adjust all dependencies.
16534 * tests/headers.at (export YYLTYPE): Strengthen this test: use
16535 %name-prefix.
16536
16537 Renaming yylval but not yylloc is not consistent. Now we do.
16538
16539 * src/bison.simple: Prefix yylloc if used.
16540 * doc/bison.texinfo (Decl Summary): Document that.
16541
8c9a50be
AD
165422001-12-29 Akim Demaille <akim@epita.fr>
16543
16544 * doc/bison.texinfo: Promote `%long-directive' over
16545 `%long_directive'.
16546 Remove all references to fixed-output-files, yacc is enough.
16547
d99361e6
AD
165482001-12-29 Akim Demaille <akim@epita.fr>
16549
16550 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
16551 user prologue. These are defaults.
16552 * tests/actions.at (Mid-rule actions): Make sure the user can
16553 define YYDEBUG and YYERROR_VERBOSE.
16554
b9cecb91
AD
165552001-12-29 Akim Demaille <akim@epita.fr>
16556
16557 * src/output.c (header_output): Don't forget to export YYLTYPE and
16558 yylloc.
16559 * tests/headers.at (export YYLTYPE): New, make sure it does.
16560 * tests/regression.at (%union and --defines, Invalid CPP headers):
16561 Move to...
16562 * tests/headers.at: here.
16563
aea13e97
AD
165642001-12-29 Akim Demaille <akim@epita.fr>
16565
16566 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
16567
931394cb
AD
165682001-12-29 Akim Demaille <akim@epita.fr>
16569
16570 * tests/actions.at (Mid-rule actions): Output on a single line
16571 instead of several.
16572
704a47c4
AD
165732001-12-29 Akim Demaille <akim@epita.fr>
16574
16575 * doc/bison.texinfo: Formatting changes.
16576
091e20bb
AD
165772001-12-29 Akim Demaille <akim@epita.fr>
16578
16579 Don't store the token defs in a muscle, just be ready to output it
16580 on command. Now possible via `symbols'. Fixes a memory leak.
16581
16582 * src/output.c (token_definitions_output): New.
16583 (output_parser, header_output): Use it.
16584 * src/reader.c (symbols_save): Remove.
16585
cce71710
AD
165862001-12-29 Akim Demaille <akim@epita.fr>
16587
16588 * src/bison.simple: Do not provide a default for YYSTYPE and
16589 YYLTYPE before the user's prologue. Otherwise it's hardly... a
16590 default.
16591
82c035a8
AD
165922001-12-29 Akim Demaille <akim@epita.fr>
16593
16594 Mid-rule actions are simply... ignored!
16595
16596 * src/reader.c (readgram): Be sure to attach mid-rule actions to
16597 the empty-rule associated to the dummy symbol, not to the host
16598 rule.
16599 * tests/actions.at (Mid-rule actions): New.
16600
8419d367
AD
166012001-12-29 Akim Demaille <akim@epita.fr>
16602
16603 Memory leak.
16604
16605 * src/reader.c (reader): Free grammar.
16606
375d5806
AD
166072001-12-29 Akim Demaille <akim@epita.fr>
16608
16609 Memory leak.
16610
16611 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
16612 since it allocates it for each state, although only one is needed.
16613 (allocate_storage): Do it here.
16614
f51cb8ff
AD
166152001-12-29 Akim Demaille <akim@epita.fr>
16616
16617 * src/options.h, src/options.c (create_long_option_table): Rename
16618 as...
16619 (long_option_table_new): this, with a clearer prototype.
16620 (percent_table): Remove, unused,
16621 * src/getargs.c (getargs): Adjust.
16622
29e88316
AD
166232001-12-29 Akim Demaille <akim@epita.fr>
16624
16625 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
16626 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
16627 as states.
16628
b9f71f19
AD
166292001-12-29 Akim Demaille <akim@epita.fr>
16630
16631 * src/lalr.c (build_relations): Rename `states' as `states1'.
16632 Sorry, I don't understand exactly what it is, no better name...
16633
1a2b5d37
AD
166342001-12-29 Akim Demaille <akim@epita.fr>
16635
16636 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
16637 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
16638 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
16639 as rules.
16640
1cca533e
AD
166412001-12-29 Akim Demaille <akim@epita.fr>
16642
16643 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
16644 ago.
16645
c03ae966
AD
166462001-12-29 Akim Demaille <akim@epita.fr>
16647
16648 * src/reader.c, src/reader.h (user_toknums): Remove.
16649 Adjust all users to use symbols[i]->user_token_number.
16650
5a670b1e
AD
166512001-12-29 Akim Demaille <akim@epita.fr>
16652
16653 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
16654 Adjust all users to use symbols[i]->prec or ->assoc.
16655
ad949da9
AD
166562001-12-29 Akim Demaille <akim@epita.fr>
16657
16658 * src/reader.c, src/reader.h (tags): Remove.
16659 Adjust all users to use symbols[i]->tag.
16660
0e78e603
AD
166612001-12-29 Akim Demaille <akim@epita.fr>
16662
16663 * src/gram.h, src/gram.c (symbols): New, similar to state_table
16664 and rule_table.
16665 * src/reader.c (packsymbols): Fill this table.
16666 Drop sprec.
16667 * src/conflicts.c (resolve_sr_conflict): Adjust.
16668 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
16669 single table.
16670 Use symbols[i]->tag instead of tags[i].
16671
213e640e
AD
166722001-12-29 Akim Demaille <akim@epita.fr>
16673
16674 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
16675 In addition, put a comment in there, to replace...
16676 * tests/regression.at (%union and C comments): Remove.
16677
e7b8bef1
AD
166782001-12-29 Akim Demaille <akim@epita.fr>
16679
16680 * tests/regression.at (Web2c Actions): Blindly move the actual
16681 output as expected output. The contents *seem* right to me, but I
16682 can't pretend reading perfectly parser tables... Nonetheless, all
16683 the other tests pass correctly, the table look OK, even though the
16684 presence of `$axiom' is to be noted: AFAICS it is useless (but
16685 harmless).
16686
b68e7744
AD
166872001-12-29 Akim Demaille <akim@epita.fr>
16688
16689 * src/reader.c (readgram): Don't add the rule 0 if there were no
16690 rules read. In other words, add it _after_ having performed
16691 grammar sanity checks.
16692 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
16693
78d5bae9
AD
166942001-12-29 Akim Demaille <akim@epita.fr>
16695
16696 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
16697 visible, and some states have now a different number.
16698
ff442794
AD
166992001-12-29 Akim Demaille <akim@epita.fr>
16700
16701 * src/reader.c (readgram): Bind the initial rule's lineno to that
16702 of the first rule.
16703 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
16704 (Solved SR Conflicts): Adjust rule 0's line number.
16705
610ab194
AD
167062001-12-29 Akim Demaille <akim@epita.fr>
16707
16708 Fix the `GAWK Grammar' failure.
16709
16710 * src/LR0.c (final_state): Initialize to -1 so that we do compute
16711 the reductions of the first state which was mistakenly confused
16712 with the final state because precisely final_state was initialized
16713 to 0.
16714 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
16715 now noticed by Bison.
16716 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
16717 have a reduction on $default.
16718
29d29c8f
AD
167192001-12-29 Akim Demaille <akim@epita.fr>
16720
16721 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
16722 rule line numbers.
16723 * src/closure.c (print_closure): Likewise.
16724 * src/derives.c (print_derives): Likewise.
16725 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
16726 now.
16727
7c6b64d0
AD
167282001-12-29 Akim Demaille <akim@epita.fr>
16729
16730 * src/lalr.c (lookaheads_print): New.
16731 (lalr): Call it when --trace-flag.
16732 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
16733 are dumped.
16734
3d4daee3
AD
167352001-12-29 Akim Demaille <akim@epita.fr>
16736
16737 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
16738 when walking through ritem, even via rule->rhs.
16739 * src/reduce.c (dump_grammar, useful_production, reduce_output)
16740 (useful_production, useless_nonterminals): Likewise.
16741 (reduce_grammar_tables): Likewise, plus update nritems.
16742 * src/nullable.c (set_nullable): Likewise.
16743 * src/lalr.c (build_relations): Likewise.
16744 * tests/sets.at (Nullable): Adjust.
16745 Fortunately, now, the $axiom is no longer nullable.
16746
9e7f6bbd
AD
167472001-12-29 Akim Demaille <akim@epita.fr>
16748
16749 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
16750 the 0-sentinel.
16751 * src/gram.c (ritem_longest_rhs): Likewise.
16752 * src/reduce.c (nonterminals_reduce): Likewise.
16753 * src/print_graph.c (print_graph): Likewise.
16754 * src/output.c (output_rule_data): Likewise.
16755 * src/nullable.c (set_nullable): Likewise.
16756
255ef638
AD
167572001-12-29 Akim Demaille <akim@epita.fr>
16758
16759 * src/output.c: Comment changes.
16760
0d8a7363
AD
167612001-12-27 Paul Eggert <eggert@twinsun.com>
16762
16763 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
16764 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
16765 Sparc, as they were causing more porting problems than the
16766 (minor) performance improvement was worth.
16767
16768 Also, catch up with 1.31's YYSTD.
16769
3db472b9
AD
167702001-12-27 Akim Demaille <akim@epita.fr>
16771
16772 * src/output.c (output_gram): Rely on nritems, not the
16773 0-sentinel. See below.
16774 Use -1 as separator, not 0.
16775 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
16776 Rely on -1 as separator in yyrhs, instead of 0.
16777 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
16778 twice `Now at end of input', therefore there are two lines less to
16779 expect.
16780
b365aa05
AD
167812001-12-27 Akim Demaille <akim@epita.fr>
16782
16783 * tests/regression.at (Unresolved SR Conflicts):
16784 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
16785 below.
16786
30171f79
AD
167872001-12-27 Akim Demaille <akim@epita.fr>
16788
16789 * src/LR0.c (new_state): Recognize the final state by the fact it
16790 is reached by eoftoken.
16791 (insert_start_shifting_state, insert_eof_shifting_state)
16792 (insert_accepting_state, augment_automaton): Remove, since now
16793 these states are automatically computed from the initial state.
16794 (generate_states): Adjust.
16795 * src/print.c: When reporting a rule number to the user, substract
16796 1, so that the axiom rule is rule 0, and the first user rule is 1.
16797 * src/reduce.c: Likewise.
16798 * src/print_graph.c (print_core): For the time being, just as for
16799 the report, depend upon --trace-flags to dump the full set of
16800 items.
16801 * src/reader.c (readgram): Once the grammar read, insert the rule
16802 0: `$axiom: START-SYMBOL $'.
16803 * tests/set.at: Adjust: rule 0 is now displayed, and since the
16804 number of the states has changed (the final state is no longer
16805 necessarily the last), catch up.
16806
75142d45
AD
168072001-12-27 Akim Demaille <akim@epita.fr>
16808
16809 Try to make the use of the eoftoken valid. Given that its value
16810 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
16811 is used instead of > 0 where appropriate, (ii), depend upon nritems
16812 instead of the 0-sentinel.
16813
16814 * src/gram.h, src/gram.c (nritems): New.
16815 Expected to be duplication of nitems, but for the time being...
16816 * src/reader.c (packgram): Assert nritems and nitems are equal.
16817 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
16818 * src/closure.c (print_closure, print_fderives): Likewise.
16819 * src/gram.c (ritem_print): Likewise.
16820 * src/print.c (print_core, print_grammar): Likewise.
16821 * src/print_graph.c: Likewise.
16822
b7c49edf
AD
168232001-12-27 Akim Demaille <akim@epita.fr>
16824
16825 * src/main.c (main): If there are complains after grammar
16826 reductions, then output the report anyway if requested, then die.
16827 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
16828 * src/reader.c (eoftoken): New.
16829 (parse_token_decl): If the token being defined has value `0', it
16830 is the eoftoken.
16831 (packsymbols): No longer hack `tags' to insert `$' by hand.
16832 Be sure to preserve the value of the eoftoken.
16833 (reader): Make sure eoftoken is defined.
16834 Initialize nsyms to 0: now eoftoken is created just like the others.
16835 * src/print.c (print_grammar): Don't special case the eof token.
16836 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
16837 lie anyway, albeit pleasant.
16838 * tests/calc.at: Exercise error messages with eoftoken.
16839 Change the grammar so that empty input is invalid.
16840 Adjust expectations.
16841 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
16842
ec2da99f
AD
168432001-12-27 Akim Demaille <akim@epita.fr>
16844
16845 * configure.in: Check the protos of strchr ans strspn.
16846 Replace strchr if needed.
16847 * src/system.h: Provide the protos of strchr, strspn and memchr if
16848 missing.
16849 * lib/strchr.c: New.
16850 * src/reader.c (symbols_save): Use strchr.
16851
8adfa272
AD
168522001-12-27 Akim Demaille <akim@epita.fr>
16853
16854 * src/print.c, src/print_graph.c (escape): New.
16855 Use it to quote the TAGS outputs.
16856 * src/print_graph.c (print_state): Now errors are in red, and
16857 reductions in green.
16858 Prefer high to wide: output the state number on a line of its own.
16859
80dac38c
AD
168602001-12-27 Akim Demaille <akim@epita.fr>
16861
16862 * src/state.h, src/state.c (reductions_new): New.
16863 * src/LR0.c (set_state_table): Let all the states have a
16864 `reductions', even if reduced to 0.
16865 (save_reductions): Adjust.
16866 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
16867 * src/print.c (print_reductions, print_actions): Adjust.
16868 * src/output.c (action_row): Adjust.
16869
2cec70b9
AD
168702001-12-27 Akim Demaille <akim@epita.fr>
16871
16872 * src/state.h, src/state.c (errs_new, errs_dup): New.
16873 * src/LR0.c (set_state_table): Let all the states have an errs,
16874 even if reduced to 0.
16875 * src/print.c (print_errs, print_reductions): Adjust.
16876 * src/output.c (output_actions, action_row): Adjust.
16877 * src/conflicts.c (resolve_sr_conflict): Adjust.
16878
13ca549a
AD
168792001-12-27 Akim Demaille <akim@epita.fr>
16880
16881 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
16882
5092aba5
AD
168832001-12-27 Akim Demaille <akim@epita.fr>
16884
16885 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
16886 * src/print.c: here.
16887 (lookaheadset, shiftset): New, used as additional storage by
16888 print_reductions.
16889 (print_results): Adjust.
16890 (print_shifts, print_gotos, print_errs): New, extracted from...
16891 (print_actions): here.
16892 * src/print_graph.c (print_actions): Remove dead code.
16893
11e2beca
AD
168942001-12-27 Akim Demaille <akim@epita.fr>
16895
16896 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
16897 `$n' and `@n'.
16898
dac3c910
AD
168992001-12-27 Akim Demaille <akim@epita.fr>
16900
16901 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
16902 (build_relations): Adjust.
16903
d0b0fefa
AD
169042001-12-27 Akim Demaille <akim@epita.fr>
16905
16906 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
16907 duplication.
16908
adc8c848
AD
169092001-12-27 Akim Demaille <akim@epita.fr>
16910
16911 * src/reader.c (packgram): Catch nitems overflows.
16912
14d293ac
AD
169132001-12-27 Akim Demaille <akim@epita.fr>
16914
16915 * src/files.c, src/files.h (guard_obstack): Remove.
16916 * src/output.c (output): Adjust.
16917 * src/reader.c (parse_braces): New, factoring...
16918 (copy_action, copy_guard): these two which are renamed as...
16919 (parse_action, parse_guard): these.
16920 As a voluntary consequence, using braces around guards is now
16921 mandatory.
16922
f499b062
AD
169232001-12-27 Akim Demaille <akim@epita.fr>
16924
16925 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
16926 * src/reader.c (symbol_list): `guard' and `guard_line' are new
16927 members.
16928 (symbol_list_new): Adjust.
16929 (copy_action): action_line is the first line, not the last.
16930 (copy_guard): Just as for actions, store the `action' only, not
16931 the switch/case/break flesh.
16932 Don't parse the user action that might follow the guard, let...
16933 (readgram): do it, i.e., now, there can be an action after a
16934 guard.
16935 In other words the guard is just explicitly optional.
16936 (packgram): Adjust.
16937 * src/output.c (guards_output): New.
16938 (output_parser): Call it when needed.
16939 (output): Also free the guard and attrs obstacks.
16940 * src/files.c, src/files.h (obstack_save): Remove.
16941 (output_files): Remove.
16942 As a result, if one needs the former `.act' file, using an
16943 appropriate skeleton which requires actions and guards is now
16944 required.
16945 * src/main.c (main): Adjust.
16946 * tests/semantic.at: New.
16947 * tests/regression.at: Use `input.y' as input file name.
16948 Avoid 8+3 problems by requiring input.c when the test needs the
16949 parser.
16950
d945f5cd
AD
169512001-12-27 Akim Demaille <akim@epita.fr>
16952
16953 * src/reader.c (symbol_list_new): Be sure to initialize all the
16954 fields.
16955
d200e455
AD
169562001-12-27 Akim Demaille <akim@epita.fr>
16957
16958 All the hacks using a final pseudo state are now useless.
16959
16960 * src/LR0.c (set_state_table): state_table holds exactly nstates.
16961 * src/lalr.c (nLA): New.
16962 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
16963 instead of lookaheadsp from the pseudo state (nstate + 1).
16964
f9507c28
AD
169652001-12-27 Akim Demaille <akim@epita.fr>
16966
16967 * src/output.c (action_row, token_actions): Use a state_t instead
16968 of a integer, and nlookaheads instead of the following state's
16969 lookaheadsp.
16970
065fbd27
AD
169712001-12-27 Akim Demaille <akim@epita.fr>
16972
16973 * src/conflicts.c (log_resolution, flush_shift)
16974 (resolve_sr_conflict, set_conflicts, solve_conflicts)
16975 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
16976 (conflicts_print, print_reductions): Use a state_t instead of an
16977 integer when referring to a state.
16978 As much as possible, depend upon nlookaheads, instead of the
16979 `lookaheadsp' member of the following state (since lookaheads of
16980 successive states are successive, the difference between state n + 1
16981 and n served as the number of lookaheads for state n).
16982 * src/lalr.c (add_lookback_edge): Likewise.
16983 * src/print.c (print_core, print_actions, print_state)
16984 (print_results): Likewise.
16985 * src/print_graph.c (print_core, print_actions, print_state)
16986 (print_graph): Likewise.
16987 * src/conflicts.h: Adjust.
16988
1b177bd7
AD
169892001-12-27 Akim Demaille <akim@epita.fr>
16990
16991 * src/bison.hairy: Formatting/comment changes.
16992 ANSIfy.
16993 Remove `register' indications.
16994 Add plenty of `static'.
16995
7742ddeb
AD
169962001-12-27 Akim Demaille <akim@epita.fr>
16997
16998 * src/output.c (prepare): Drop the muscle `ntbase' which
16999 duplicates ntokens.
17000 * src/bison.simple: Formatting/comment changes.
17001 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17002 is an undocumented synonym.
17003
1fa14068
AD
170042001-12-22 Akim Demaille <akim@epita.fr>
17005
17006 * src/output.c (output_table_data): Change the prototype to use
17007 `int' for array ranges: some invocations do pass an int, not a
17008 short.
17009 Reported by Wayne Green.
17010
b9752825
AD
170112001-12-22 Akim Demaille <akim@epita.fr>
17012
17013 Some actions of web2c.y are improperly triggered.
17014 Reported by Mike Castle.
17015
17016 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17017 * tests/regression.at (Web2c): Rename as...
17018 (Web2c Report): this.
17019 (Web2c Actions): New.
17020
776209d6
AD
170212001-12-22 Akim Demaille <akim@epita.fr>
17022
17023 Reductions in web2c.y are improperly reported.
17024 Reported by Mike Castle.
17025
17026 * src/conflicts.c (print_reductions): Fix.
17027 * tests/regression.at (Web2c): New.
17028
275fc3ad
AD
170292001-12-18 Akim Demaille <akim@epita.fr>
17030
17031 Some host fail on `assert (!"foo")', which expands to
17032 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17033 Reported by Nelson Beebee.
17034
17035 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17036 `#define it_succeeded 0' and `assert (it_succeeded)'.
17037
897668ee
MA
170382001-12-17 Marc Autret <autret_m@epita.fr>
17039
17040 * src/bison.simple: Don't hard code the skeleton line and filename.
17041 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17042 New line counter 'skeleton_line' (skeleton-line muscle).
17043
ab3399e0
PE
170442001-12-17 Paul Eggert <eggert@twinsun.com>
17045
17046 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17047 YYDEBUG must be defined to a nonzero value.
17048
17049 * src/bison.simple (yytname): Do not assume that the user defines
17050 YYDEBUG to a properly parenthesized expression.
17051
3877f72b
AD
170522001-12-17 Akim Demaille <akim@epita.fr>
17053
17054 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17055 nlookaheads is a new member.
17056 Adjust all users.
17057 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17058 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17059 state.
776209d6 17060
331dbc1b
AD
170612001-12-17 Akim Demaille <akim@epita.fr>
17062
17063 * src/files.h, src/files.c (open_files, close_files): Remove.
17064 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17065 let...
17066 * src/reader.c (reader): Do it.
776209d6 17067
be750e4c
AD
170682001-12-17 Akim Demaille <akim@epita.fr>
17069
17070 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 17071
709ae8c6
AD
170722001-12-17 Akim Demaille <akim@epita.fr>
17073
17074 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17075 (flush_reduce): New.
17076 (resolve_sr_conflict): Adjust.
776209d6 17077
f87685c3
AD
170782001-12-17 Akim Demaille <akim@epita.fr>
17079
17080 * src/output.c (output_obstack): Be static and rename as...
17081 (format_obstack): this, to avoid any confusion with files.c's
17082 output_obstack.
17083 * src/reader.h (muscle_obstack): Move to...
17084 * src/output.h: here, since it's defined in output.c.
17085
837491d8
AD
170862001-12-17 Akim Demaille <akim@epita.fr>
17087
17088 * src/output.c (action_row, save_column, default_goto)
17089 (sort_actions, matching_state, pack_vector): Better variable
17090 locality.
17091
796d61fb
AD
170922001-12-17 Akim Demaille <akim@epita.fr>
17093
17094 * src/output.c: Various formatting changes.
776209d6 17095
64d15509
AD
170962001-12-17 Akim Demaille <akim@epita.fr>
17097
17098 * src/files.c (output_files): Free the output_obstack.
17099 * src/main.c (main): Call print and print_graph conditionally.
17100 * src/print.c (print): Work unconditionally.
17101 * src/print_graph.c (print_graph): Work unconditionally.
17102 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17103
fbc8ecb7
MA
171042001-12-16 Marc Autret <autret_m@epita.fr>
17105
17106 * src/output.c (actions_output): Fix. When we use %no-lines,
17107 there is one less line per action.
17108
f0440388
MA
171092001-12-16 Marc Autret <autret_m@epita.fr>
17110
17111 * src/bison.simple: Remove a useless #line directive.
17112 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17113 * src/output.c (get_lines_number): New.
776209d6 17114 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
17115 output muscles.
17116 Fix line numbering.
17117 (actions_output): Computes the number of lines taken by actions.
17118 (output_master_parser): Insert new skeleton which is the name of
17119 the output parser file name.
17120
a79986b8
MA
171212001-12-15 Marc Autret <autret_m@epita.fr>
17122
17123 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17124
4ec8e00f
MA
171252001-12-15 Marc Autret <autret_m@epita.fr>
17126
17127 * src/output.c (output_gram): Keep track of the hairy one.
17128
1a4648ff
AD
171292001-12-15 Akim Demaille <akim@epita.fr>
17130
17131 Make `make distcheck' work.
17132
17133 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17134 system.h which uses libgettext.h.
17135
9c2c67e6
AD
171362001-12-15 Akim Demaille <akim@epita.fr>
17137
17138 * src/nullable.c (set_nullable): Useless rules must be skipped,
17139 otherwise, since we range over their symbols, we might look at a
17140 nonterminal which no longer ``exists'', i.e., it is not counted in
17141 `nvars', hence we overflow our arrays.
17142
93ede233
AD
171432001-12-15 Akim Demaille <akim@epita.fr>
17144
17145 The header can also be produced directly, without any obstack!
17146 Yahoo!
17147
17148 * src/files.c, src/files.h (defines_obstack): Remove.
17149 (compute_header_macro): Global.
17150 (defines_obstack_save): Remove.
17151 * src/reader.c (parse_union_decl): No longer output to
17152 defines_obstack: its content can be found in the `stype' muscle
17153 anyway.
17154 (output_token_translations): Merge into...
17155 (symbols_output): this.
17156 Rename as...
17157 (symbols_save): this.
17158 (reader): Adjust.
17159 * src/output.c (header_output): New.
17160 (output): Call it.
17161
2666f928
AD
171622001-12-15 Akim Demaille <akim@epita.fr>
17163
17164 * src/reader.c (parse_union_decl): Instead of handling two obstack
17165 simultaneously, use one to define the `stype' muscle, and use the
17166 value of the latter to fill defines_obstack.
17167 (copy_comment): Remove.
17168 (copy_comment2): Work for a single obstack.
17169 Rename as...
17170 (copy_comment): this.
17171
428046f8
AD
171722001-12-15 Akim Demaille <akim@epita.fr>
17173
17174 * src/lex.c, src/lex.h (xgetc): No longer static.
17175 * src/reader.c (parse_union_decl): Revamp.
17176
ea52d706
AD
171772001-12-15 Akim Demaille <akim@epita.fr>
17178
17179 Still making progress in separating Bison into (i) input, (ii)
17180 process, (iii) output: now we can directly output the parser file
17181 without using table_obstack at all.
17182
17183 * src/files.c, src/files.h (table_obstack): Bye bye.
17184 (parser_file_name): New.
17185 * src/files.c (compute_output_file_names): Compute it.
17186 * src/output.c (actions_output, output_parser)
17187 (output_master_parser): To a file instead of an obstack.
17188
3f96f4dc
AD
171892001-12-15 Akim Demaille <akim@epita.fr>
17190
17191 Attach actions to rules, instead of pre-outputting them to
17192 actions_obstack.
17193
17194 * src/gram.h (rule_t): action and action_line are new members.
17195 * src/reader.c (symbol_list): Likewise.
17196 (copy_action): Save the actions within the rule.
17197 (packgram): Save them in rule_table.
17198 * src/output.c (actions_output): New.
17199 (output_parser): Use it on `%%actions'.
17200 (output_rule_data): Don't free rule_table.
17201 (output): Do it.
17202 (prepare): Don't save the `action' muscle.
17203 * src/bison.simple: s/%%action/%%actions/.
17204
51576fb3
AD
172052001-12-15 Akim Demaille <akim@epita.fr>
17206
17207 * src/reader.c (copy_action): When --yacc, don't append a `;'
17208 to the user action: let it fail if lacking.
dee049eb 17209 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 17210
2648a72d
AD
172112001-12-14 Akim Demaille <akim@epita.fr>
17212
17213 * src/lex.c (literalchar): Simply return the char you decoded, non
17214 longer mess around with obstacks and int pointers.
17215 Adjust all callers.
17216
92790e5b
AD
172172001-12-14 Akim Demaille <akim@epita.fr>
17218
17219 * src/lex.c (literalchar): Don't escape the special characters,
17220 just decode them, and keep them as char (before, eol was output as
17221 the 2 char string `\n' etc.).
17222 * src/output.c (output_rule_data): Use quotearg to output the
17223 token strings.
17224
927c1557
PE
172252001-12-13 Paul Eggert <eggert@twinsun.com>
17226
17227 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17228 Do not infringe on the global user namespace when using C++.
17229 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17230 All uses of `fprintf' and `stderr' changed.
17231
17232 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17233
ed8e1f68
AD
172342001-12-13 Akim Demaille <akim@epita.fr>
17235
17236 The computation of nullable is broken: it doesn't handle empty
17237 RHS's properly.
17238
17239 * tests/torture.at (GNU AWK Grammar): New.
17240 * tests/sets.at (Nullable): New.
17241 * src/nullable.c (set_nullable): Instead of blindly looping over
17242 `ritems', loop over the rules, and then over their rhs's.
17243
17244 Work around Autotest bugs.
17245
17246 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17247 frame, because Autotest understand lines starting with a `+' as
17248 traces from the shell. Then, they are not processed properly.
17249 Admittedly an Autotest bug, but we don't have time to wait for
17250 Autotest to catch up.
17251 * tests/regression.at (Broken Closure): Adjust to the new table
17252 frames.
17253 Move to...
17254 * tests/sets.at: here.
17255
cb581495
AD
172562001-12-13 Akim Demaille <akim@epita.fr>
17257
17258 * src/closure.c (closure): Use nrules instead of playing tricks
17259 with BITS_PER_WORD.
17260
2e729273
AD
172612001-12-13 Akim Demaille <akim@epita.fr>
17262
17263 * src/print.c (print_actions): Output the handling of `$' as the
17264 traces do: shifting the token EOF. Before EOF was treated as a
17265 nonterminal.
17266 * tests/regression.at: Adjust some tests.
17267 * src/print_graph.c (print_core): Complete the set of items via
17268 closure. The next-to-final and final states are still unsatisfying,
17269 but that's to be addressed elsewhere.
17270 No longer output the rule numbers, but do output the state number.
17271 A single loop for the shifts + gotos is enough, but picked a
17272 distinct color for each.
17273 (print_graph): Initialize and finalize closure.
17274
107f7dfb
AD
172752001-12-13 Akim Demaille <akim@epita.fr>
17276
17277 * src/reader.c (readgram): Remove dead code, an strip useless
17278 braces.
17279 (get_type): Remove, unused.
17280
9b53a24f
AD
172812001-12-12 Akim Demaille <akim@epita.fr>
17282
17283 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17284 on that of lib/error.c.
17285
dbfb6dcd
AD
172862001-12-12 Akim Demaille <akim@epita.fr>
17287
17288 Some hosts don't like `/' in includes.
17289
17290 * src/system.h: Include libgettext.h without qualifying the path.
17291 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17292 $(top_srcdir).
17293
c25fb648
MA
172942001-12-11 Marc Autret <autret_m@epita.fr>
17295
17296 * src/output.c (output_parser): Remove useless muscle.
17297
710ddc4f
MA
172982001-12-11 Marc Autret <autret_m@epita.fr>
17299
17300 * src/bison.simple: Remove #line just before %%epilogue. It
17301 is now handled in ...
17302 * src/reader.c (read_additionnal_code): Add the output of a
17303 #line for the epilogue.
17304
e83d80b8
MA
173052001-12-10 Marc Autret <autret_m@epita.fr>
17306
927c1557 17307 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
17308 replace precedent remove.
17309 * src/bison.simple: Remove #line before %%prologue because
17310 %%input-line is wrong at this time.
17311
971d5158
MA
173122001-12-10 Marc Autret <autret_m@epita.fr>
17313
17314 * src/reader.c (symbols_output): Clean up.
927c1557 17315 * src/output.c (output_gram, output): Clean up.
971d5158 17316
5edafffd
AD
173172001-12-10 Akim Demaille <akim@epita.fr>
17318
17319 * src/lalr.c (initialize_lookaheads): New. Extracted from...
17320 * src/LR0.c (set_state_table): here.
17321 * src/lalr.c (lalr): Call it.
17322
0279f8e9
AD
173232001-12-10 Akim Demaille <akim@epita.fr>
17324
17325 * src/state.h (shifts): Remove the `number' member: shifts are
17326 attached to state, hence no longer need to be labelled with a
17327 state number.
17328
190c4f5f
AD
173292001-12-10 Akim Demaille <akim@epita.fr>
17330
17331 Now that states have a complete set of members, the linked list of
17332 shifts is useless: just fill directly the state's shifts member.
17333
17334 * src/state.h (shifts): Remove the `next' member.
17335 * src/LR0.c (first_state, last_state): Remove.
17336 Adjust the callers.
17337 (augment_automaton): Don't look for the shifts that must be added
17338 a shift on EOF: it is those of the state we looked for! But now,
17339 since shifts are attached, it is no longer needed to looking
17340 merely by its id: its number.
17341
2a73b93d
AD
173422001-12-10 Akim Demaille <akim@epita.fr>
17343
17344 * src/LR0.c (augment_automaton): Better variable locality.
17345 Remove an impossible branch: if there is a state corresponding to
17346 the start symbol being shifted, then there is shift for the start
17347 symbol from the initial state.
17348
74392f6a
AD
173492001-12-10 Akim Demaille <akim@epita.fr>
17350
17351 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
17352 only when appropriate: when insert_start_shifting_state' is not
17353 invoked.
17354 * tests/regression.at (Rule Line Numbers): Adjust.
17355
37c82725
AD
173562001-12-10 Akim Demaille <akim@epita.fr>
17357
17358 * src/LR0.c (augment_automaton): Now that all states have shifts,
17359 merge the two cases addition shifts to the initial state.
17360
6a164e0c
AD
173612001-12-10 Akim Demaille <akim@epita.fr>
17362
17363 * src/lalr.c (set_state_table): Move to...
17364 * src/LR0.c: here.
17365 * src/lalr.c (lalr): Don't call it...
17366 * src/LR0.c (generate_states): do it.
17367 * src/LR0.h (first_state): Remove, only the table is used.
17368
7215de24
AD
173692001-12-10 Akim Demaille <akim@epita.fr>
17370
17371 * src/LR0.h (first_shift, first_reduction): Remove.
17372 * src/lalr.c: Don't use first_shift: find shifts through the
17373 states.
17374
80e25d4d
AD
173752001-12-10 Akim Demaille <akim@epita.fr>
17376
17377 * src/LR0.c: Attach shifts to states as soon as they are
17378 computed.
17379 * src/lalr.c (set_state_table): Instead of assigning shifts to
17380 state, just assert that the mapping was properly done.
17381
0ab3728b
AD
173822001-12-10 Akim Demaille <akim@epita.fr>
17383
17384 * src/LR0.c (insert_start_shift): Rename as...
17385 (insert_start_shifting_state): this.
17386 (insert_eof_shifting_state, insert_accepting_state): New.
17387 (augment_automaton): Adjust.
17388 Better locality of the variables.
17389 When looking if the start_symbol is shifted from the initial
17390 state, using `while (... symbol != start_symbol ...)' sounds
17391 better than `while (... symbol < start_symbol ...)': If fail
17392 to see how the order between symbols could be relevant!
17393
78af9bbc
AD
173942001-12-10 Akim Demaille <akim@epita.fr>
17395
17396 * src/getargs.h: Don't declare `spec_name_prefix' and
17397 `spec_file_prefix', declared by src/files.h.
17398 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
17399 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
17400 * src/output.c (prepare): Adjust.
17401 * src/reader.c (symbols_output): Likewise.
17402 * src/vmsgetargs.c: Vaguely adjust, but who cares?
17403
bdef2a41
AD
174042001-12-10 Akim Demaille <akim@epita.fr>
17405
17406 * src/muscle_tab.c (muscle_init): NULL is a better default than
17407 `"0"'.
17408
3735969c
AD
174092001-12-10 Akim Demaille <akim@epita.fr>
17410
17411 * src/reader.c (reader): Calling symbols_output once is enough.
17412
49701457
AD
174132001-12-10 Akim Demaille <akim@epita.fr>
17414
17415 Now that states have a complete set of members, the linked list of
17416 reductions is useless: just fill directly the state's reductions
17417 member.
17418
17419 * src/state.h (struct reductions): Remove member `number' and
17420 `next'.
17421 * src/LR0.c (first_reduction, last_reduction): Remove.
17422 (save_reductions): Don't link the new reductions, store them in
17423 this_state.
17424 * src/lalr.c (set_state_table): No need to attach reductions to
17425 states, it's already done.
17426 * src/output.c (output_actions): No longer free the shifts, then
17427 the reductions, then the states: free all the states and their
17428 members.
17429
0edad749
AD
174302001-12-10 Akim Demaille <akim@epita.fr>
17431
17432 * src/options.c (OPTN, DRTV, BOTH): New.
17433 (option_table): Use them.
17434
0edad749
AD
17435 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
17436 the job of system.h.
17437 * src/options.c: Don't include stdio.h and xalloc.h for the same
17438 reasons.
17439
5449dd0f
AD
174402001-12-10 Akim Demaille <akim@epita.fr>
17441
17442 * src/output.c (output, prepare): Make sure the values of the
17443 muscles `action' and `prologue' are 0-terminated.
17444
a870c567
AD
174452001-12-10 Akim Demaille <akim@epita.fr>
17446
17447 Clean up GCC warnings.
17448
17449 * src/reader.c (copy_action): `buf' is not used.
17450 (parse_skel_decl): Be static.
17451 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
17452 * src/options.h (create_long_option_table): Have a real prototype.
17453 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
17454 (hash_delete_at): Return const void *.
17455 Adjust casts to preserve the const.
17456
80df8768
AD
174572001-12-10 Akim Demaille <akim@epita.fr>
17458
17459 * configure.in: Require 2.52g.
17460 M4 is not needed, but AUTOM4TE is.
17461 * m4/m4.m4: Remove.
17462 * tests/Makefile.am: Adjust.
17463
f693ad14
AD
174642001-12-10 Akim Demaille <akim@epita.fr>
17465
17466 One structure for states is enough, even though theoretically
17467 there are LR(0) states and LALR(1) states.
17468
17469 * src/lalr.h (state_t): Remove.
17470 (state_table): Be state_t **, not state_t *.
17471 * src/state.h (core, CORE_ALLOC): Rename as...
17472 (state_t, STATE_ALLOC): this.
17473 Add the LALR(1) members: shifts, reductions, errs.
17474 * src/LR0.c (state_table): Rename as...
17475 (state_hash): this, to avoid name clashes with the global
17476 `state_table'.
17477 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
17478 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
17479
74ffbcb6
AD
174802001-12-10 Akim Demaille <akim@epita.fr>
17481
17482 Bison dumps core on bash.y.
17483 Reported by Pascal Bart.
17484
17485 * src/warshall.c (bitmatrix_print): New.
17486 (TC): Use it.
ba0fe3c7 17487 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
17488 j must be the outer loop.
17489 * tests/regression.at (Broken Closure): New.
17490
07708e19
AD
174912001-12-05 Akim Demaille <akim@epita.fr>
17492
17493 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
17494 its argument.
ba1ecc07 17495 Reported by Peter Hamorsky.
07708e19 17496
92b16366
AD
174972001-12-05 Akim Demaille <akim@epita.fr>
17498
17499 * src/conflicts.c (err_table): Remove.
17500 (resolve_sr_conflict): Adjust.
17501 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
17502 Rename as...
17503 (state_t.reductions, state_t.shifts): this.
17504
076ab033
AD
175052001-12-05 Akim Demaille <akim@epita.fr>
17506
17507 * src/reduce.c (reduce_grammar_tables): No longer disable the
17508 removal of useless rules via CPP but via `if (0)', so that the
17509 compiler still check the code is valid.
17510 For instance, it should have noticed `rline' no longer exists: use
17511 the `line' member of rule_t.
17512 * src/gram.c (dummy, rline): Remove, unused.
17513
3843c413
AD
175142001-12-05 Akim Demaille <akim@epita.fr>
17515
17516 * src/output.c (pack_vector): Use assert, not berror.
17517 * src/main.c (berror): Remove, unused.
17518
43168960
AD
175192001-12-05 Akim Demaille <akim@epita.fr>
17520
17521 New experimental feature: if --verbose --trace output all the
17522 items of a state, not only its kernel.
17523
17524 * src/print.c (print_core): If `trace_flag', then invoke closure
17525 before outputting the items of the state (print_core is no longer
17526 a correct name them).
17527 (print_results): Invoke new_closure/free_closure if needed.
17528
b2872512
AD
175292001-12-05 Akim Demaille <akim@epita.fr>
17530
17531 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
17532 * src/closure.c, src/closure.h (itemsetsize): Rename as...
17533 (nitemset): for consistency with the rest of the project.
17534
23cbcc6c
AD
175352001-12-05 Akim Demaille <akim@epita.fr>
17536
17537 * src/closure.c (print_closure): Improve.
17538 (closure): Use it for printing input and output.
17539
03ec521c
AD
175402001-12-05 Akim Demaille <akim@epita.fr>
17541
17542 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
17543 indexed by nonterminals.
17544
3a7456dd
AD
175452001-12-05 Akim Demaille <akim@epita.fr>
17546
17547 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
17548 what it was!).
17549 * src/warshall.h: Remove accidental duplication of the content.
17550
1cbcf2e7
AD
175512001-12-05 Akim Demaille <akim@epita.fr>
17552
17553 * src/closure.c (set_fderives): De-obfuscate.
17554
84182270
AD
175552001-12-05 Akim Demaille <akim@epita.fr>
17556
17557 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
17558
3f6f053c
AD
175592001-12-05 Akim Demaille <akim@epita.fr>
17560
17561 * src/closure.c (set_firsts): De-obfuscate.
17562
7a5350ba
AD
175632001-12-05 Akim Demaille <akim@epita.fr>
17564
17565 * src/output.c (action_row): De-obfuscate
17566 using the good o' techniques: arrays not pointers, variable
17567 locality, BITISSET, RESETBIT etc.
17568
d954473d
AD
175692001-12-05 Akim Demaille <akim@epita.fr>
17570
17571 Pessimize the code to simplify it: from now on, all the states
17572 have a valid SHIFTS, which NSHIFTS is possibly 0.
17573
17574 * src/LR0.c (shifts_new): Be global and move to..
17575 * src/state.c, src/state.h: here.
17576 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
17577 * src/print_graph: Adjust.
17578
9839bbe5
AD
175792001-12-05 Akim Demaille <akim@epita.fr>
17580
17581 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
17582 * src/conflicts.c: Use it.
17583 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
17584 incorrectly ``simplified''.
17585
9f136c07
AD
175862001-12-05 Akim Demaille <akim@epita.fr>
17587
17588 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
17589 using the good o' techniques: arrays not pointers, variable
17590 locality, BITISSET, RESETBIT etc.
17591
b608206e
AD
175922001-12-05 Akim Demaille <akim@epita.fr>
17593
17594 * src/state.h (SHIFT_SYMBOL): New.
17595 * src/conflicts.c: Use it to deobfuscate.
17596
52afa962
AD
175972001-12-05 Akim Demaille <akim@epita.fr>
17598
17599 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
17600 (print_reductions): De-obfuscate using the good o' techniques:
17601 arrays not pointers, variable locality, BITISSET.
17602
e74dc321
AD
176032001-12-05 Akim Demaille <akim@epita.fr>
17604
17605 * src/conflicts.c (print_reductions): Arrays, not pointers.
17606 Use BITISSET.
17607
768fca83
AD
176082001-12-05 Akim Demaille <akim@epita.fr>
17609
17610 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17611
a17e599f
AD
176122001-12-05 Akim Demaille <akim@epita.fr>
17613
17614 * src/conflicts.c (print_reductions): Improve variable locality.
17615
a04bc341
AD
176162001-12-05 Akim Demaille <akim@epita.fr>
17617
17618 * src/conflicts.c (print_reductions): Pessimize, but clarify.
17619
c8ea038e
AD
176202001-12-05 Akim Demaille <akim@epita.fr>
17621
17622 * src/conflicts.c (print_reductions): Improve variable locality.
17623
aa2aab3c
AD
176242001-12-05 Akim Demaille <akim@epita.fr>
17625
17626 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
17627 * src/lalr.c: Use them.
17628
b178c8cc
AD
176292001-12-05 Akim Demaille <akim@epita.fr>
17630
17631 * src/LR0.c (augment_automaton): Formatting changes.
17632 Better variable locality.
17633
f67d13aa
AD
176342001-12-05 Akim Demaille <akim@epita.fr>
17635
17636 * src/lalr.c (matrix_print): New.
17637 (transpose): Use it.
17638 Use arrays instead of pointers.
17639
c2713865
AD
176402001-12-05 Akim Demaille <akim@epita.fr>
17641
17642 * src/lalr.c (maxrhs): Move to...
17643 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
17644 * src/lalr.c (build_relations): Adjust.
17645
9887c18a
AD
176462001-12-05 Akim Demaille <akim@epita.fr>
17647
17648 * src/lalr.c (transpose): Free the memory allocated to the
17649 argument, as it is replaced by the results by the unique caller.
17650 (build_relations): Merely invoke transpose: it handles the memory
17651 deallocation.
17652 Improve variable locality.
17653 Avoid variables used as mere abbreviations.
17654 (compute_lookaheads): Use arrays instead of pointers.
17655
4d4f699c
AD
176562001-12-05 Akim Demaille <akim@epita.fr>
17657
17658 * src/lalr.c (initialize_F): Improve variable locality.
17659 Avoid variables used as mere abbreviations.
17660
80a69750
AD
176612001-12-05 Akim Demaille <akim@epita.fr>
17662
17663 * src/derives.c (print_derives): Display the ruleno.
17664 * src/lalr.c (initialize_F, transpose): Better variable locality
17665 to improve readability.
17666 Avoid variables used as mere abbreviations.
17667
fe961097
AD
176682001-12-05 Akim Demaille <akim@epita.fr>
17669
17670 * src/lalr.c (traverse): Use arrays instead of pointers.
17671
e3e4e814
AD
176722001-12-05 Akim Demaille <akim@epita.fr>
17673
17674 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
17675 the handling of squeue.
17676 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17677
630e182b
AD
176782001-12-05 Akim Demaille <akim@epita.fr>
17679
17680 Because useless nonterminals are now kept alive (instead of being
17681 `destroyed'), we now sometimes examine them, and store information
17682 related to them. Hence we need to know their number, and adjust
17683 memory allocations.
17684
17685 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
17686 static.
17687 * src/LR0.c (allocate_itemsets): The memory allocated to
17688 `symbol_count' was used for two different purpose: once to count
17689 the number of occurrences of each symbol, and later reassigned to
17690 `shift_symbol', containing the symbol that can be shifted from a
17691 given state.
17692 Deobfuscate, i.e., allocate, use and free `symbol_count' here
17693 only, and...
17694 (new_itemsets): Allocate `shift_symbol' here.
17695 (allocate_itemsets): symbol_count includes useless nonterminals.
17696 Make room for them.
17697 (free_storage): Use `free', not `XFREE', for pointers that cannot
17698 be null.
17699
81b51460
AD
177002001-12-05 Akim Demaille <akim@epita.fr>
17701
17702 * src/nullable.c (set_nullable): Deobfuscate the handling of
17703 ritem.
17704 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
17705
3067fbef
AD
177062001-12-05 Akim Demaille <akim@epita.fr>
17707
17708 * src/gram.c, src/gram.h (ritem_print): New.
17709 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
17710 (This useless function was defined only to work around VMS linkers
17711 that can't handle compilation units with variables only).
17712 * src/reduce.c (dump_grammar): Use it to trace the construction of
17713 ritem.
17714
c2bea5f9
PE
177152001-12-04 Paul Eggert <eggert@twinsun.com>
17716
7d27c823
PE
17717 * src/bison.simple (union yyalloc): Change member names
17718 to be the same as the stack names.
17719 (yyparse): yyptr is now union yyalloc *, not char *.
17720 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
17721 and may generate better code on some machines.
c2bea5f9
PE
17722 (yystpcpy): Use prototype if __STDC__ is defined, not just
17723 if __cplusplus is defined.
35687a9d 17724
2c8a9dfa
AD
177252001-11-30 Akim Demaille <akim@epita.fr>
17726
17727 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
17728 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
17729 Gettext doesn't compile cleanly, and dies with -Werror.
17730 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
17731 Include WARNING_CFLAGS here.
17732 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
17733 before being defined.
17734
f4e421e6
AD
177352001-11-27 Paul Eggert <eggert@twinsun.com>
17736
17737 * lib/quotearg.h (quotearg_n, quotearg_n_style):
17738 First arg is int, not unsigned.
17739 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
17740 (SIZE_MAX, UINT_MAX): New macros.
17741 (quotearg_n_options): Abort if N is negative.
17742 Avoid overflow check on hosts where size_t is 64 bits and int
17743 is 32 bits, as overflow is impossible there.
17744 Fix off-by-one typo that caused unnecessary reallocation.
17745
7093d0f5
AD
177462001-11-29 Paul Eggert <eggert@twinsun.com>
17747
17748 Name space cleanup in generated parser.
17749
17750 * doc/bison.texinfo (Bison Parser): Discuss system headers
17751 and their effect on the user name space.
17752
17753 * src/bison.simple:
17754 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
17755 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
17756 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
17757
17758 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
17759 on user names when possible.
17760
17761 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
17762 Simplify test for whather <alloca.h> exists.
17763
17764 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
17765
17766 (<stdio.h>): Include if YYDEBUG.
17767
17768 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
17769 ! defined (yyoverflow) && ! defined (yymemcpy).
17770
17771 (yymemcpy, yyparse): Rename local variables as needed so that
17772 they all begin with 'yy'.
17773
17774 (yystrlen, yystpcpy): New functions.
17775
17776 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
17777 All uses changed.
17778
17779 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
17780 instead of relying on string.h functions. Use YYSTACK_ALLOC
17781 and YYSTACK_FREE instead of malloc and free.
17782
fd51e5ff
AD
177832001-11-30 Akim Demaille <akim@epita.fr>
17784
17785 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
17786 before their first uses.
17787 (YYBISON, YYPURE): Move to the top of the output.
17788
7d13ff5f
AD
177892001-11-30 Akim Demaille <akim@epita.fr>
17790
17791 * tests/reduce.at (Useless Nonterminals): Fix.
17792
892a3995
AD
177932001-11-30 Akim Demaille <akim@epita.fr>
17794
17795 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
17796 if body instead of `;' to pacify GCC's warnings.
17797
68f1e3ed
AD
177982001-11-30 Akim Demaille <akim@epita.fr>
17799
17800 Instead of mapping the LHS of unused rules to -1, keep the LHS
17801 valid, but flag the rules as invalid.
17802
17803 * src/gram.h (rule_t): `useful' is a new member.
17804 * src/print.c (print_grammar): Adjust.
17805 * src/derives.c (set_derives): Likewise.
17806 * src/reader.c (packgram, reduce_output): Likewise.
17807 * src/reduce.c (reduce_grammar_tables): Likewise.
17808 * tests/reduce.at (Underivable Rules, Useless Rules): New.
17809
d2d1b42b
AD
178102001-11-30 Akim Demaille <akim@epita.fr>
17811
17812 * src/reduce.c (reduce_output): Formatting changes.
17813 * src/print.c (print_results, print_grammar): Likewise.
17814 * tests/regression.at (Rule Line Numbers)
17815 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
17816
760b53a8
AD
178172001-11-30 Akim Demaille <akim@epita.fr>
17818
17819 * src/reduce.c (nonterminals_reduce): Instead of throwing away
17820 useless nonterminals, move them at the end of the symbol arrays.
17821 (reduce_output): Adjust.
17822 * tests/reduce.at (Useless Nonterminals): Adjust.
17823
00238958
AD
178242001-11-30 Akim Demaille <akim@epita.fr>
17825
17826 * src/reduce.c: Various comment/formatting changes.
17827 (nonterminals_reduce): New, extracted from...
17828 (reduce_grammar_tables): here.
17829 (reduce_grammar): Call nonterminals_reduce.
17830
396452de
PE
178312001-11-29 Paul Eggert <eggert@twinsun.com>
17832
17833 * src/bison.simple (YYSTACK_REALLOC): Remove.
17834 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
17835 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
17836 New macros.
17837 (union yyalloc): New type.
17838 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
17839 an arbitrary restriction on hosts where size_t is wider than int.
17840
17841 (yyparse): Don't dump core if alloca or malloc fails; instead, report
17842 a parser stack overflow. Allocate just one block of memory for all
17843 three stacks, instead of allocating three blocks; this typically is
17844 faster and reduces fragmentation.
17845
17846 Do not limit the number of items in the stack to a value that fits
17847 in 'int', as this is an arbitrary limit on hosts with 64-bit
17848 size_t and 32-bit int.
17849
147e184c
MA
178502001-11-29 Marc Autret <autret_m@epita.fr>
17851
17852 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
17853 of defining YYERROR_VERBOSE.
17854 [AT_DATA]: $4 is now out of C declarations in the prologue.
17855
426cf563
MA
178562001-11-28 Marc Autret <autret_m@epita.fr>
17857
17858 * src/reader.c (parse_dquoted_param): New.
17859 (parse_skel_decl): Use it.
17860 * src/lex.h: Add its prototype.
17861 * src/lex.c (literalchar): Become not static.
17862
c7925b99
MA
178632001-11-28 Marc Autret <autret_m@epita.fr>
17864
17865 * src/output.h: And put its extern declaration here.
17866 * src/output.c (error_verbose): Define here.
17867 (prepare): Echo name modification.
17868 * src/getargs.h: Clean its extern declaration.
17869 * src/getargs.c (error_verbose_flag): Remove.
17870 (getargs): Remove case 'e'.
17871 * src/options.c (option_table): 'error-verbose' is now seen as simple
17872 percent option.
17873 Include output.h.
17874
17875 * src/reader.c (read_declarations): Remove case tok_include.
17876 (parse_include_decl): Remove.
17877 * src/lex.h (token_t): Remove tok_include.
17878 * src/options.c (option_table): 'include' is now a simple command line
17879 option.
17880
5b5d1929
MA
178812001-11-28 Marc Autret <autret_m@epita.fr>
17882
17883 * src/bison.simple: Adjust muscle names.
17884 * src/muscle_tab.c (muscle_init): Also rename the muscles.
17885 * src/output.c (prepare): s/_/-/ for the muscles names.
17886 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
17887
8850be4b
MA
178882001-11-28 Marc Autret <autret_m@epita.fr>
17889
17890 * src/bison.simple: Fix debug.
17891 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
17892
4a38e613
AD
178932001-11-28 Akim Demaille <akim@epita.fr>
17894
17895 * src/LR0.c (shifts_new): New.
17896 (save_shifts, insert_start_shift, augment_automaton): Use it.
17897
4b35e1c1
AD
178982001-11-28 Akim Demaille <akim@epita.fr>
17899
17900 * src/closure.c (closure): `b' and `ruleno' denote the same value:
17901 keep ruleno only.
17902
d2b04478
AD
179032001-11-28 Akim Demaille <akim@epita.fr>
17904
17905 * src/closure.c (closure): Instead of looping over word in array
17906 then bits in words, loop over bits in array.
17907
2c4c30aa
AD
179082001-11-28 Akim Demaille <akim@epita.fr>
17909
17910 * src/closure.c (closure): No longer optimize the special case
17911 where all the bits of `ruleset[r]' are set to 0, to make the code
17912 clearer.
17913
576890b7
AD
179142001-11-28 Akim Demaille <akim@epita.fr>
17915
17916 * src/closure.c (closure): `r' and `c' are new variables, used to
17917 de-obfuscate accesses to RULESET and CORE.
17918
cb487d7d
AD
179192001-11-28 Akim Demaille <akim@epita.fr>
17920
17921 * src/reduce.c (reduce_print): Use ngettext.
17922 (dump_grammar): Improve the trace accuracy.
17923
6013d43f
AD
179242001-11-28 Akim Demaille <akim@epita.fr>
17925
17926 * src/reduce.c (dump_grammar): Don't translate trace messages.
17927
cb4956ee
AD
179282001-11-28 Akim Demaille <akim@epita.fr>
17929
17930 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
17931 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
17932 as all tags are free'ed afterwards.
17933 From Enrico Scholz.
17934
648185ab
PE
179352001-11-27 Paul Eggert <eggert@twinsun.com>
17936
17937 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
17938 use alloca when we didn't want to, and vice versa.
17939
68254a03
MA
179402001-11-27 Marc Autret <autret_m@epita.fr>
17941
9113b58f
AD
17942 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
17943 initialization.
68254a03
MA
17944 * src/output.c (prepare): Remove its update.
17945
04d843a2
MA
179462001-11-27 Marc Autret <autret_m@epita.fr>
17947
17948 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
17949 Use %error-verbose.
17950
d2079671 179512001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
17952
17953 * src/bison.simple: Remove YYERROR_VERBOSE using.
17954 Use %%error_verbose.
17955 (yyparse): Likewise.
17956 * src/output.c (prepare): Give its final value.
17957 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
17958 * src/getargs.h: Add its extern declaration.
17959 * src/getargs.c (error_verbose_flag): New int.
17960 (getargs): Update to catch new case.
17961 * src/options.c (option_table): 'error-verbose' is a new option.
17962 (shortopts): Update.
17963
e0327bc8
AD
179642001-11-27 Akim Demaille <akim@epita.fr>
17965
17966 * src/system.h: Use intl/libgettext.h.
17967 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
17968
000f1a3c
AD
179692001-11-27 Akim Demaille <akim@epita.fr>
17970
17971 * tests/torture.at (Exploding the Stack Size with Malloc):
17972 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
17973
26cfe0be
AD
179742001-11-27 Akim Demaille <akim@epita.fr>
17975
17976 * src/files.c: Include error.h.
17977 Reported by Hans Aberg.
17978
f6bd5427
MA
179792001-11-26 Marc Autret <autret_m@epita.fr>
17980
d2079671 17981 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
17982 (read_declarations): Add case tok_include.
17983 * src/getargs.h (include): Add its extern definition.
17984 * src/getargs.c (include): New const char *.
17985 (getargs): Add case '-I'.
17986 * src/options.c (option_table): Add include as command line and
17987 percent option.
17988 * src/lex.h (token_t): Add tok_include.
17989
2ca209c1
AD
179902001-11-26 Akim Demaille <akim@epita.fr>
17991
17992 * src/reader.c (readgram): Make sure rules for mid-rule actions
17993 have a lineno equal to that of their host rule.
17994 Reported by Hans Aberg.
17995 * tests/regression.at (Rule Line Numbers): New.
17996
0e41b407
AD
179972001-11-26 Akim Demaille <akim@epita.fr>
17998
17999 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18000 size_ts.
18001
180022001-11-26 Akim Demaille <akim@epita.fr>
18003
18004 * src/complain.c, src/complain.h (error): Remove, provided by
18005 lib/error.[ch].
18006
e0c40012
AD
180072001-11-26 Akim Demaille <akim@epita.fr>
18008
18009 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18010 issue an error message.
18011 * tests/regression.at (Invalid %directive): New.
18012 Reported by Hans Aberg.
18013
5e147124
AD
180142001-11-26 Akim Demaille <akim@epita.fr>
18015
18016 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18017 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18018
a034c8b8
AD
180192001-11-26 Akim Demaille <akim@epita.fr>
18020
18021 * src/conflicts.c (conflicts_print): Don't complain at all when
18022 there are no reduce/reduce conflicts, and as many shift/reduce
18023 conflicts as expected.
18024 * tests/regression.at (%expect right): Adjust.
18025
c64a20f3
AD
180262001-11-23 Akim Demaille <akim@epita.fr>
18027
18028 * lib/alloca.c: Update, from fileutils.
18029
5b0d29bb
AD
180302001-11-23 Akim Demaille <akim@epita.fr>
18031
18032 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18033
722c4bfe
AD
180342001-11-23 Akim Demaille <akim@epita.fr>
18035
18036 * src/system.h: Include alloca.h.
18037 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18038
6255b435
AD
180392001-11-23 Akim Demaille <akim@epita.fr>
18040
18041 * src/print_graph.c (print_actions): Remove `rule', unused.
18042 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18043 pacify GCC's signed < unsigned warnings.
18044 * src/closure.c (itemsetsize): Likewise.
18045 * src/reader.c (symbol_list_new): Static.
18046
b29b2ed5
AD
180472001-11-23 Akim Demaille <akim@epita.fr>
18048
18049 Attaching lineno to buckets is stupid, since only one copy of each
18050 symbol is kept, only the line of the first occurrence is kept too.
18051
18052 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18053 * src/reader.c (rline_allocated): Remove, unused.
18054 (symbol_list): Have a `line' member.
18055 (symbol_list_new): New.
18056 (readgram): Use it.
18057 * src/print.c (print_grammar): Output the rule line numbers.
18058 * tests/regression.at (Solved SR Conflicts)
18059 (Unresolved SR Conflicts): Adjust.
18060 Reported by Hans Aberg.
18061
a81b1d4a
MA
180622001-11-22 Marc Autret <autret_m@epita.fr>
18063
18064 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18065
c1ecb3c1
MA
180662001-11-22 Marc Autret <autret_m@epita.fr>
18067
18068 * src/muscle_tab.c (muscle_init): Remove initialization of
18069 skeleton muscle.
18070 * src/output.c (output_master_parser): Do it here.
18071
fbe01355
AD
180722001-11-20 Akim Demaille <akim@epita.fr>
18073
18074 * po/sv.po: New.
18075 * configure.in (ALL_LINGUAS): Adjust.
18076 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18077 longer contains strings to translate.
18078
81e895c0
AD
180792001-11-19 Akim Demaille <akim@epita.fr>
18080
18081 * src/conflicts.c (conflicts_print): Add a missing \n.
18082
6bb1878b
AD
180832001-11-19 Akim Demaille <akim@epita.fr>
18084
18085 * src/nullable.c (nullable_print): New.
18086 (set_nullable): Call it when tracing.
18087 Better locality of variables.
18088
d9ec2d07
AD
180892001-11-19 Akim Demaille <akim@epita.fr>
18090
18091 * src/print.c (print_actions): Better locality of variables.
18092
720e5c1b
AD
180932001-11-19 Akim Demaille <akim@epita.fr>
18094
18095 * src/derives.c (print_derives): Fix and enrich.
18096 * src/closure.c (print_fderives): Likewise.
18097
fb908786
AD
180982001-11-19 Akim Demaille <akim@epita.fr>
18099
18100 * src/closure.c (itemsetend): Remove, replaced with...
18101 (itemsetsize): new.
18102
125ecb56
AD
181032001-11-19 Akim Demaille <akim@epita.fr>
18104
18105 * src/LR0.c (kernel_end): Remove, replaced with...
18106 (kernel_size): new.
18107
d8cf039f
AD
181082001-11-19 Akim Demaille <akim@epita.fr>
18109
18110 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18111 to clarify.
18112
7bec0760
AD
181132001-11-19 Akim Demaille <akim@epita.fr>
18114
18115 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18116
c87d4863
AD
181172001-11-19 Akim Demaille <akim@epita.fr>
18118
18119 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18120 trace messages.
18121 * src/LR0.c: Likewise.
18122 (allocate_itemsets): Use arrays instead of pointers to clarify.
18123
9bfe901c
AD
181242001-11-19 Akim Demaille <akim@epita.fr>
18125
18126 * src/getargs.c (statistics_flag): Replace with...
18127 (trace_flag): New.
18128 (longopts): Accept --trace instead of --statistics.
18129 * src/getargs.h, src/options.c: Adjust.
18130 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18131 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18132
97db7bd4
AD
181332001-11-19 Akim Demaille <akim@epita.fr>
18134
cc72668c 18135 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
18136 pointers to clarify the code.
18137 (save_reductions, save_shifts): Factor common parts of alternatives.
18138
2c5f66ed
AD
181392001-11-19 Akim Demaille <akim@epita.fr>
18140
18141 * src/LR0.c (new_state, get_state): Complete TRACE code.
18142 * src/closure.c: Include `reader.h' to get `tags', needed by the
18143 trace code.
18144 Rename the conditional DEBUG as TRACE.
18145 Output consistently TRACEs to stderr, not stdout.
18146 * src/derives.c: Likewise.
18147 * src/reduce.c: (inaccessable_symbols): Using if is better style
18148 than goto.
18149 Use `#if TRACE' instead of `#if 0' for tracing code.
18150
300f275f
AD
181512001-11-19 Akim Demaille <akim@epita.fr>
18152
18153 * src/system.h (LIST_FREE, shortcpy): New.
18154 * src/LR0.c: Use them.
18155 * src/output.c (free_itemsets, free_reductions, free_shifts):
18156 Remove, replaced by LIST_FREE.
18157
f59c437a
AD
181582001-11-19 Akim Demaille <akim@epita.fr>
18159
18160 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18161 (REDUCTIONS_ALLOC): New.
18162 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18163 allocation.
18164
6986fd9e
AD
181652001-11-19 Akim Demaille <akim@epita.fr>
18166
18167 * src/LR0.c (new_state): Complete trace code.
18168 * src/nullable.c (set_nullable): Don't translate traces.
18169
4bc30f78
AD
181702001-11-19 Akim Demaille <akim@epita.fr>
18171
18172 * src/print_graph.c (print_core): Better locality of variables.
18173 * src/print.c (print_core): Likewise.
18174
08a946e0
AD
181752001-11-19 Akim Demaille <akim@epita.fr>
18176
18177 * src/vcg.c: You do the output, so you are responsible of the
18178 handling of VCG syntax, in particular: use quotearg.
18179 * src/print_graph.c: Don't.
18180 (print_actions): Don't output the actions as part of the nodes,
18181 since that's the job of the edges.
18182 (print_state): Don't output by hand: fill the node description,
9bfe901c 18183 and ask for its output.
08a946e0 18184
f0473484
AD
181852001-11-19 Akim Demaille <akim@epita.fr>
18186
cc72668c
AD
18187 * src/bison.simple (yyparse): When verbosely reporting an error,
18188 no longer put additional quotes around token names.
f0473484
AD
18189 * tests/calc.at: Adjust.
18190
e41dc700
AD
181912001-11-19 Akim Demaille <akim@epita.fr>
18192
18193 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18194 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18195 * src/output.c: Adjust.
18196
652a871c
AD
181972001-11-19 Akim Demaille <akim@epita.fr>
18198
18199 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18200 (rule_t): this.
18201 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18202
b2ed6e58
AD
182032001-11-19 Akim Demaille <akim@epita.fr>
18204
18205 * src/gram.h (rule_t): New.
18206 (rule_table): New.
18207 (rrhs, rlhs): Remove, part of state_t.
18208 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18209 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18210 * src/reader.c, src/reduce.c: Adjust.
18211
edad7067
AD
182122001-11-19 Akim Demaille <akim@epita.fr>
18213
18214 * src/reader.c (symbols_output): New, extracted from...
18215 (packsymbols): Here.
18216 (reader): Call it.
18217
3feec034
AD
182182001-11-19 Akim Demaille <akim@epita.fr>
18219
18220 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18221 (maxrhs): this new function.
18222
ddcd5fdf
AD
182232001-11-19 Akim Demaille <akim@epita.fr>
18224
cc72668c 18225 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
18226 Adjust.
18227
bb527fc2
AD
182282001-11-19 Akim Demaille <akim@epita.fr>
18229
cc72668c 18230 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
18231 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18232 * src/lalr.c: Adjust.
18233
a845a697
AD
182342001-11-19 Akim Demaille <akim@epita.fr>
18235
18236 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18237 (set_state_table): handle the `lookaheads' members.
18238
f004bf6a
AD
182392001-11-19 Akim Demaille <akim@epita.fr>
18240
cc72668c
AD
18241 * src/lalr.h (lookaheads): Removed array, whose contents is now
18242 a member of...
f004bf6a
AD
18243 (state_t): this structure.
18244 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18245 Adjust.
18246
de326cc0
AD
182472001-11-19 Akim Demaille <akim@epita.fr>
18248
cc72668c
AD
18249 * src/lalr.h (consistent): Removed array, whose contents is now
18250 a member of...
de326cc0
AD
18251 (state_t): this structure.
18252 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18253 Adjust.
18254
90b4416b
AD
182552001-11-19 Akim Demaille <akim@epita.fr>
18256
cc72668c
AD
18257 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18258 contents are now members of...
90b4416b
AD
18259 (state_t): this structure.
18260 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18261 Adjust.
18262
9703cc49
AD
182632001-11-19 Akim Demaille <akim@epita.fr>
18264
18265 * src/lalr.h (state_t): New.
18266 (state_table): Be a state_t * instead of a core **.
18267 (accessing_symbol): Remove, part of state_t.
18268 * src/lalr.c: Adjust.
18269 (set_accessing_symbol): Merge into...
18270 (set_state_table): this.
18271 * src/print_graph.c, src/conflicts.c: Adjust.
18272
d803322e
AD
182732001-11-14 Akim Demaille <akim@epita.fr>
18274
18275 * tests/calc.at, tests/output.at, tests/regression.at,
18276 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18277 now the tests are run in private dirs, therefore AC_CLEANUP and
18278 family can be simplified to 0-ary.
18279 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18280 use abs. path to find config.h.
18281 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18282 stderr, there can be way too much random noise.
18283 Instead pass -Werror to GCC and rely on the exit status.
18284 Reported by Wolfram Wagner.
18285
3d76b07d
AD
182862001-11-14 Akim Demaille <akim@epita.fr>
18287
18288 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18289 defined only if yyoverflow is defined, to avoid `warning: unused
18290 variable `yyvs1''.
18291 Reported by The Test Suite.
18292
09b503c8
AD
182932001-11-14 Akim Demaille <akim@epita.fr>
18294
18295 * src/print.c: Include reduce.h.
18296 Reported by Hans Aberg.
18297
182982001-11-14 Akim Demaille <akim@epita.fr>
18299
18300 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
18301 Revert a previous patch: these are really const.
18302 * src/conflicts.c (conflict_report): Additional useless pair of
18303 braces to pacify GCC's warnings for `if () if () {} else {}'.
18304 * src/lex.c (parse_percent_token): Replace equal_offset with
18305 arg_offset.
18306 arg is const.
18307 Be sure to strdup `arg' when used, since there is no reason for
18308 token_buffer not to change.
18309
0f37a994
AD
183102001-11-14 Akim Demaille <akim@epita.fr>
18311
18312 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
18313 definition.
18314 * src/main.c (main): Use them.
18315 Suggested by Hans Aberg.
18316
d39d93b8
AD
183172001-11-12 Akim Demaille <akim@epita.fr>
18318
18319 * src/system.h (ngettext): Now that we use ngettext, be sure to
18320 provide a default definition when NLS are not used.
18321
9edcd895
AD
183222001-11-12 Akim Demaille <akim@epita.fr>
18323
18324 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
18325 Use @kbd to denote user input.
18326 (Language and Grammar): ANSIfy the example.
18327 Adjust its layout for info/notinfo.
18328 (Location Tracking Calc): Output error messages to stderr.
18329 Output locations in a more GNUtically correct way.
18330 Fix a couple of Englishos.
18331 Adjust @group/@end group pairs.
18332
7da99ede
AD
183332001-11-12 Akim Demaille <akim@epita.fr>
18334
e3aa65c5 18335 %expect was not functioning at all.
7da99ede
AD
18336
18337 * src/conflicts.c (expected_conflicts): Set to -1.
18338 (conflict_report): Use ngettext.
18339 (conflicts_print): Check %expect and make its violation an error.
18340 * doc/bison.texinfo (Expect Decl): Adjust.
18341 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
18342 * tests/regression.at (%expect not enough, %expect right)
18343 (%expect too much): New.
18344
ba9dda1a
AD
183452001-11-12 Akim Demaille <akim@epita.fr>
18346
18347 * tests/regression.at (Conflicts): Rename as...
18348 (Unresolved SR Conflicts): this.
18349 (Solved SR Conflicts): New.
18350
337c5bd1
AD
183512001-11-12 Akim Demaille <akim@epita.fr>
18352
18353 * src/reduce.c (print_results): Rename as...
18354 (reduce_output): This.
18355 Output to OUT, passed as argument, instead of output_obstack.
18356 (dump_grammar): Likewise.
18357 (reduce_free): New.
18358 Also free V1.
18359 (reduce_grammar): No longer call reduce_output, since...
18360 * src/print.c (print_results): do it.
18361 * src/main.c (main): Call reduce_free;
18362
c73a41af
AD
183632001-11-12 Akim Demaille <akim@epita.fr>
18364
18365 * src/conflicts.c (print_reductions): Accept OUT as argument.
18366 Output to it, not to output_obstack.
18367 * src/print.c (print_actions): Adjust.
18368
0df87bb6
AD
183692001-11-12 Akim Demaille <akim@epita.fr>
18370
18371 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
18372 the result instead of using...
18373 (src_total, rrc_total, src_count, rrc_count): Remove.
18374 (any_conflicts): Remove.
18375 (print_conflicts): Split into...
18376 (conflicts_print, conflicts_output): New.
18377 * src/conflicts.h: Adjust.
18378 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 18379 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
18380 * tests/regression.at (Conflicts): New.
18381 Reported by Tom Lane.
18382
e4d3d4de
AD
183832001-11-12 Akim Demaille <akim@epita.fr>
18384
18385 * tests/regression.at (Invalid input): Remove, duplicate with
18386 ``Invalid input: 1''.
18387
6d7d248e
AD
183882001-11-12 Akim Demaille <akim@epita.fr>
18389
18390 * tests/torture.at (AT_DATA_STACK_TORTURE)
18391 (Exploding the Stack Size with Alloca)
18392 (Exploding the Stack Size with Malloc): New.
18393
e9e4c321
AD
183942001-11-12 Akim Demaille <akim@epita.fr>
18395
18396 * src/bison.simple (YYSTACK_REALLOC): New.
18397 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 18398 Reported by Per Allansson.
e9e4c321 18399
5f7e0832
AD
184002001-11-12 Pascal Bart <pascal.bart@epita.fr>
18401
18402 * src/bison.simple: Define type yystype instead of YYSTYPE, and
18403 define CPP macro, which substitute YYSTYPE by yystype.
18404 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
18405 with yyltype/YYLTYPE. This allows inclusion of the generated
18406 header within the parser if the compiler, such as GGC, accepts
18407 multiple equivalent #defines.
18408 From Akim.
18409
e3f1699f
AD
184102001-11-05 Akim Demaille <akim@epita.fr>
18411
18412 * src/reader.c (symbols_output): New, extracted from...
18413 (packsymbols): here.
18414 (reader): Adjust.
18415
65be0866
AD
184162001-11-05 Akim Demaille <akim@epita.fr>
18417
18418 * src/lex.c (parse_percent_token): s/quotearg/quote/.
18419
e4d910bf
AD
184202001-11-05 Akim Demaille <akim@epita.fr>
18421
18422 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
18423 pattern.
18424
951366c1
AD
184252001-11-05 Akim Demaille <akim@epita.fr>
18426
18427 * src/options.h (struct option_table_struct): set_flags is void*.
18428 * src/options.c (longopts): Support `--output' and `%output'.
18429 (usage): Adjust.
18430 * src/lex.h (tok_setopt): Remove, replaced with...
18431 (tok_intopt, tok_stropt): these new guys.
18432 * src/lex.c (getopt.h): Not needed.
18433 (token_buffer, unlexed_token_buffer): Not const.
18434 (percent_table): Promote `-' over `_' in directive names.
18435 Active `%name-prefix', `file-prefix', and `output'.
18436 (parse_percent_token): Accept possible arguments to directives.
18437 Promote `-' over `_' in directive names.
18438
d8988b2f
AD
184392001-11-04 Akim Demaille <akim@epita.fr>
18440
18441 * doc/bison.texinfo (Decl Summary): Split the list into
18442 `directives for grammars' and `directives for bison'.
18443 Sort'em.
18444 Add description of `%name-prefix', `file-prefix', and `output'.
18445 Promote `-' over `_' in directive names.
18446 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
18447 Simplify the description of `--name-prefix'.
18448 Promote `-' over `_' in directive names.
18449 Promote `--output' over `--output-file'.
18450 Fix the description of `--defines'.
18451 * tests/output.at: Exercise %file-prefix and %output.
18452
6468d18e
AD
184532001-11-02 Akim Demaille <akim@epita.fr>
18454
18455 * doc/refcard.tex: Update.
18456
6b7e85b9
AD
184572001-11-02 Akim Demaille <akim@epita.fr>
18458
18459 * src/symtab.h (SUNDEF): New.
18460 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
18461 stand for `uninitialized', instead of 0.
18462 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
18463 * src/lex.c (lex): Adjust.
18464
18465 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
18466 Number it 0.
18467 Let yylex return it instead of a plain 0.
18468 Reported by Dick Streefland.
18469
cd5aafcf
AD
184702001-11-02 Akim Demaille <akim@epita.fr>
18471
18472 * tests/regression.at (Mixing %token styles): New test.
18473
037ca2f1
AD
184742001-11-02 Akim Demaille <akim@epita.fr>
18475
18476 * src/reader.c (parse_thong_decl): Formatting changes.
18477 (token_translations_init): New, extracted from...
18478 (packsymbols): Here.
18479 Adjust.
18480
270a173c
AD
184812001-11-01 Akim Demaille <akim@epita.fr>
18482
18483 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
18484 Check that `9foo.y' produces correct cpp guards.
18485 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
18486 guards.
18487 Reported by Wwp.
18488
561f9a30
AD
184892001-11-01 Akim Demaille <akim@epita.fr>
18490
18491 * tests/regression.at (Invalid input: 2): New.
18492 * src/lex.c (unlexed_token_buffer): New.
18493 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
18494 too.
18495 Reported by Wwp.
18496
f987e9d2
AD
184972001-11-01 Akim Demaille <akim@epita.fr>
18498
18499 * tests/calc.at: Catch up with 1.30.
18500 * configure.in: Bump to 1.49a.
18501 Adjust to newer Autotest.
18502
0846f581
PB
185032001-10-19 Pascal Bart <pascal.bart@epita.fr>
18504
18505 * src/conflicts.c: Move global variables rrc_total and src_total ...
18506 (print_conflicts): here.
18507 * src/output.c (output): Free global variable user_toknums.
18508 * src/lex.c (token_obstack): Become static.
18509
3c1a79b3
AD
185102001-10-18 Akim Demaille <akim@epita.fr>
18511
18512 * tests/atlocal.in (GCC): Add.
18513 * tests/calc.at: s/m4_match/m4_bmatch/.
18514 s/m4_patsubst/m4_bpatsubst/.
18515 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
18516 * configure.in: AC_SUBST(GCC).
18517
5d52e7d0
MA
185182001-10-14 Marc Autret <autret_m@epita.fr>
18519
18520 * src/options.c (create_long_option_table): Fix.
18521
631aa1d3
AD
185222001-10-10 Akim Demaille <akim@epita.fr>
18523
18524 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
18525
f6ec6d13
AD
185262001-10-04 Akim Demaille <akim@epita.fr>
18527
18528 * src/reader.c (parse_union_decl): Push the caracters in
18529 union_obstack, not attrs_obstack.
18530
342b8b6e
AD
185312001-10-04 Akim Demaille <akim@epita.fr>
18532
18533 Merge in the branch 1.29.
18534
18535 * src/reader.c (packsymbols): Use a temporary obstack for
18536 `%%tokendef', since output_stack is already used elsewhere.
18537
18538 2001-10-02 Akim Demaille <akim@epita.fr>
18539
18540 Bump 1.29d.
18541
18542 2001-10-02 Akim Demaille <akim@epita.fr>
18543
18544 Version 1.29c.
18545
18546 2001-10-02 Akim Demaille <akim@epita.fr>
18547
18548 * tests/regression.at (Invalid CPP headers): New.
18549 From Alexander Belopolsky.
18550 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
18551
18552 2001-10-02 Akim Demaille <akim@epita.fr>
18553
18554 * tests/regression.at (Invalid input): New.
18555 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
18556 Reported by Shura.
18557
18558 2001-10-02 Akim Demaille <akim@epita.fr>
18559
18560 * tests/calc.at: Now that --debug works, the tests must be adjusted.
18561
18562 2001-10-02 Akim Demaille <akim@epita.fr>
18563
18564 * src/output.c (output_parser): Assert `skeleton'.
18565 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
18566 systems.
18567 From Shura.
18568
18569 2001-10-01 Marc Autret <autret_m@epita.fr>
18570
18571 * src/lex.h: Echo modifications.
18572 * src/lex.c (unlex): Parameter is now token_t.
18573 From Hans Aberg.
18574
18575 2001-10-01 Marc Autret <autret_m@epita.fr>
18576
18577 * src/main.c: Include lex.h.
18578 From Hans Aberg.
18579
18580 2001-09-29 Akim Demaille <akim@epita.fr>
18581
18582 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
18583
18584 2001-09-28 Akim Demaille <akim@epita.fr>
18585
18586 * tests/testsuite.at: Update to newer Autotest.
18587 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
18588
18589 2001-09-27 Akim Demaille <akim@epita.fr>
18590
18591 Position independent wrapper.
18592
18593 * tests/bison: Remove.
18594 * tests/bison.in: New.
18595 * configure.in: Adjust.
18596
18597 2001-09-27 Paul Eggert <eggert@twinsun.com>
18598
18599 Port quotearg fixes from tar 1.13.24.
18600
18601 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
18602 tm to be declared.
18603 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
18604 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
18605
18606 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
18607 * m4/mbrtowc.m4: New file.
18608 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
18609 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
18610
18611 2001-09-27 Akim Demaille <akim@epita.fr>
18612
18613 Bump to 1.29c.
18614
18615 2001-09-27 Akim Demaille <akim@epita.fr>
18616
18617 Version 1.29b.
18618
18619 2001-09-25 Akim Demaille <akim@epita.fr>
18620
18621 * src/system.h: Include `xalloc.h'.
18622 Remove it from the C files.
18623 * src/files.c (output_files): Free the obstacks.
18624 * src/lex.c (init_lex): Rename as...
18625 (lex_init): this.
18626 (lex_free): New.
18627 * src/main.c (main): Use it.
18628
18629 2001-09-24 Marc Autret <autret_m@epita.fr>
18630
18631 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
18632 to output informations in fout (FILE*).
18633 (open_graph, close_graph): Likewise.
18634 (output_graph, output_edge, output_node): Likewise.
18635 * src/vcg.h: Update function prototypes.
18636 * src/print_graph.c (print_graph): Open output graph file.
18637 (print_actions): Adjust.
18638 * src/files.h: Remove extern declaration.
18639 * src/files.c: Remove graph_obstack declaration.
18640 (open_files): Remove graph_obstack initialization.
18641 (output_files): Remove graph_obstack saving.
18642
18643 2001-09-24 Marc Autret <autret_m@epita.fr>
18644
18645 * src/files.c (compute_output_file_names): Fix.
18646
18647 2001-09-24 Marc Autret <autret_m@epita.fr>,
18648 Akim Demaille <akim@epita.fr>
18649
18650 * src/reader.c (reader): Remove call to free_symtab ().
18651 * src/main.c (main): Call it here.
18652 Include symtab.h.
18653 * src/conflicts.c (initialize_conflicts): Rename as...
18654 (solve_conflicts): this.
18655 * src/print.c (print_core, print_actions, print_state)
18656 (print_grammar): Dump to a file instead a `output_obstack'.
18657 (print_results): Dump `output_obstack', and then proceed with the
18658 FILE *.
18659 * src/files.c (compute_output_file_names, close_files): New.
18660 (output_files): Adjust.
18661 * src/main.c (main): Adjust.
18662
18663 2001-09-23 Marc Autret <autret_m@epita.fr>
18664
18665 * src/files.c (compute_header_macro): Computes header macro name
18666 from spec_defines_file when given.
18667
18668 2001-09-23 Marc Autret <autret_m@epita.fr>
18669
18670 * src/files.c (output_files): Add default extensions.
18671
18672 2001-09-22 Akim Demaille <akim@epita.fr>
18673
18674 * src/conflicts.c (finalize_conflicts): Rename as...
18675 (free_conflicts): this.
18676
18677 2001-09-22 Akim Demaille <akim@epita.fr>
18678
18679 * src/gram.c (gram_free): Rename back as...
18680 (dummy): this.
18681 (output_token_translations): Free `token_translations'.
18682 * src/symtab.c (free_symtab): Free the tag field.
18683
18684 2001-09-22 Akim Demaille <akim@epita.fr>
18685
18686 Remove `translations' as it is always set to true.
18687
18688 * src/gram.h: Adjust.
18689 * src/reader.c (packsymbols, parse_token_decl): Adjust
18690 * src/print.c (print_grammar): Adjust.
18691 * src/output.c (output_token_translations): Adjust.
18692 * src/lex.c (lex): Adjust.
18693 * src/gram.c: Be sure the set pointers to NULL.
18694 (dummy): Rename as...
18695 (gram_free): this.
18696
18697 2001-09-22 Akim Demaille <akim@epita.fr>
18698
18699 * configure.in: Invoke AM_LIB_DMALLOC.
18700 * src/system.h: Use dmalloc.
18701 * src/LR0.c: Be sure to have pointers initialized to NULL.
18702 (allocate_itemsets): Allocate kernel_items only if needed.
18703
18704 2001-09-22 Akim Demaille <akim@epita.fr>
18705
18706 * configure.in: Bump to 1.29b.
18707 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
18708 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
18709 need xmalloc.c in calc.y.
18710 From Pascal Bart.
18711
18712 2001-09-21 Akim Demaille <akim@epita.fr>
18713
18714 Version 1.29a.
18715 * Makefile.maint, config/config.guess, config/config.sub,
18716 * config/missing: Update from masters.
18717 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
18718 upon package.m4.
18719 * configure.in (ALL_LINGUAS): Add `tr'.
18720
18721 2001-09-21 Akim Demaille <akim@epita.fr>
18722
18723 * tests/Makefile.am (package.m4): Move to...
18724 ($(srcdir)/$(TESTSUITE)): here.
18725
18726 2001-09-20 Akim Demaille <akim@epita.fr>
18727
18728 * src/complain.c: No longer try to be standalone: use system.h.
18729 Don't assume __STDC__ is defined to 1. Just test if it is defined.
18730 * src/complain.h: Likewise.
18731 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
18732 Remove the unused variable `n'.
18733 From Albert Chin-A-Young.
18734
18735 2001-09-18 Marc Autret <autret_m@epita.fr>
18736
18737 * doc/bison.1: Update.
18738 * doc/bison.texinfo (Bison Options): Update --defines and --graph
18739 descriptions.
18740 (Option Cross Key): Update.
18741 Add --graph.
18742
18743 2001-09-18 Marc Autret <autret_m@epita.fr>
18744
18745 * tests/regression.at: New test (comment in %union).
18746
18747 2001-09-18 Marc Autret <autret_m@epita.fr>
18748
18749 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
18750 do that.
18751 Reported by Keith Browne.
18752
18753 2001-09-18 Marc Autret <autret_m@epita.fr>
18754
18755 * tests/output.at: Add tests for --defines and --graph.
18756
18757 2001-09-18 Marc Autret <autret_m@epita.fr>
18758
18759 * tests/output.at: Removes tests of %{header,src}_extension features.
18760
18761 2001-09-18 Akim Demaille <akim@epita.fr>
18762
18763 * tests/Makefile.am (package.m4): New.
18764 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
18765 (_AT_CHECK_CALC_ERROR): Likewise.
18766 Factor the `, ' part of verbose error messages.
18767
18768 2001-09-18 Marc Autret <autret_m@epita.fr>
18769
18770 * src/getargs.c (longopts): Declare --defines and --graph as options
18771 with optional arguments.
18772 * src/files.h: Add extern declarations.
18773 * src/files.c (spec_graph_file, spec_defines_file): New.
18774 (output_files): Update.
18775 Remove CPP-outed code.
18776
18777 2001-09-18 Marc Autret <autret_m@epita.fr>
18778
18779 Turn off %{source,header}_extension feature.
18780
18781 * src/files.c (compute_exts_from_gf): Update.
18782 (compute_exts_from_src): Update.
18783 (output_files): CPP-out useless code.
18784 * src/files.h: Remove {header,source}_extension extern declarations.
18785 * src/reader.c (parse_dquoted_param): CPP-out.
18786 (parse_header_extension_decl): Remove.
18787 (parse_source_extension_decl): Remove.
18788 (read_declarations): Remove cases tok_{hdrext,srcext}.
18789 * src/lex.c (percent_table): Remove {header,source}_extension entries.
18790 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
18791
18792 2001-09-10 Akim Demaille <akim@epita.fr>
18793
18794 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
18795 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
18796 (AT_CHECK_OUTPUT): this.
18797 Merely check ls' exit status, its output is useless.
18798
18799 2001-09-10 Akim Demaille <akim@epita.fr>
18800
18801 * tests/calc.at: Use m4_match.
18802 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
18803
18804 2001-09-10 Marc Autret <autret_m@epita.fr>,
18805 Akim Demaille <akim@epita.fr>
18806
18807 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
18808 enum color_e.
18809 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
18810 to `normal'.
18811 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
18812 * src/lex.h: Adjust prototype.
18813 (token_t): Add `tok_undef'.
18814 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
18815 (parse_percent_token): Now returns token_t.
18816 Add default statement in switch.
18817 (lex): Separate `c' as an input variable, from the token_t result
18818 part.
18819 (unlexed): Is a token_t.
18820
18821 2001-09-10 Akim Demaille <akim@epita.fr>
18822
18823 * configure.in: Bump to 1.29a.
18824
18825 2001-09-07 Akim Demaille <akim@epita.fr>
18826
18827 Version 1.29.
18828
18829 2001-08-30 Akim Demaille <akim@epita.fr>
18830
18831 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
18832 * m4/atconfig.m4: Remove.
18833 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
18834 * tests/bison: New.
18835 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
18836 m4_if, m4_patsubst, and m4_regexp.
18837 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
18838 `input' file instead of echo.
18839
18840 2001-08-29 Akim Demaille <akim@epita.fr>
18841
18842 Bump to 1.28e.
18843
18844 2001-08-29 Akim Demaille <akim@epita.fr>
18845
18846 Version 1.28d.
18847
18848 2001-08-29 Paul Eggert <eggert@twinsun.com>
18849
18850 * src/bison.simple (yyparse): Don't take the address of an
18851 item before the start of an array, as that doesn't conform to
18852 the C Standard.
18853
18854 2001-08-29 Robert Anisko <anisko_r@epita.fr>
18855
18856 * doc/bison.texinfo (Location Tracking Calc): New node.
18857
18858 2001-08-29 Paul Eggert <eggert@twinsun.com>
18859
18860 * src/output.c (output): Do not define const, as this now
18861 causes more problems than it cures.
18862
18863 2001-08-29 Akim Demaille <akim@epita.fr>
18864
18865 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
18866 the nodes.
18867 Be sure to tag the `detailmenu'.
18868
18869 2001-08-29 Akim Demaille <akim@epita.fr>
18870
18871 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
18872 download in a tmp dir.
18873
18874 2001-08-28 Marc Autret <autret_m@epita.fr>
18875
18876 * config/depcomp: New file.
18877
18878 2001-08-28 Marc Autret <autret_m@epita.fr>
18879
18880 * doc/bison.1 (mandoc): Adjust.
18881 From Juan Manuel Guerrero.
18882
18883 2001-08-28 Marc Autret <autret_m@epita.fr>
18884
18885 * src/print_graph.c (print_state): Fix.
18886
18887 2001-08-27 Marc Autret <autret_m@epita.fr>
18888
18889 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
18890 char * members.
18891 Echo modifications to the functions prototypes.
18892 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
18893
18894 2001-08-27 Marc Autret <autret_m@epita.fr>
18895
18896 * src/vcg.c: Include `xalloc.h'.
18897 (add_colorentry): New.
18898 (add_classname): New.
18899 (add_infoname): New.
18900 * src/vcg.h: Add new prototypes.
18901
18902 2001-08-27 Akim Demaille <akim@epita.fr>
18903
18904 * Makefile.maint: Sync. again with CVS Autoconf.
18905
18906 2001-08-27 Akim Demaille <akim@epita.fr>
18907
18908 * Makefile.maint: Formatting changes.
18909 (po-update, cvs-update, update): New targets.
18910 (AMTAR): Remove.
18911
18912 2001-08-27 Akim Demaille <akim@epita.fr>
18913
18914 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18915 * Makefile.maint: Sync. with CVS Autoconf.
18916
18917 2001-08-27 Marc Autret <autret_m@epita.fr>
18918
18919 * src/vcg.h (struct infoname_s): New.
18920 (struct colorentry_s): New.
18921 (graph_s): New fields {vertical,horizontal}_order in structure.
18922 Add `infoname' field.
18923 Add `colorentry' field;
18924 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
18925 (G_HORIZONTAL_ORDER): New.
18926 (G_INFONAME): New.
18927 (G_COLORENTRY): New.
18928 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
18929 Add output of `infoname'.
18930 Add output of `colorentry'.
18931
18932 2001-08-27 Marc Autret <autret_m@epita.fr>
18933
18934 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
18935 This one shadowed a global parameter.
18936
18937 2001-08-24 Marc Autret <autret_m@epita.fr>
18938
18939 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
18940 instead of `unsigned'.
18941 (print_state): Do not call obstack_object_size () in obstack_grow ()
18942 to avoid macro variables shadowing.
18943
18944 2001-08-23 Marc Autret <autret_m@epita.fr>
18945
18946 * src/lex.c (percent_table): Typo: s/naem/name/.
18947 Add graph option.
18948 Normalize new options declarations.
18949
18950 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
18951
18952 * tests/suite.at: Exercise %header_extension and %source_extension.
18953
18954 2001-08-16 Marc Autret <autret_m@epita.fr>
18955
18956 * src/reader.c (parse_dquoted_param): New.
18957 (parse_header_extension_decl): Use it.
18958 (parse_source_extension_decl): Likewise.
18959
18960 2001-08-16 Marc Autret <autret_m@epita.fr>
18961
18962 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
18963 (get_xxxx_str): Use assert () instead of complain ().
18964 Remove return invokations in default cases.
18965 (get_decision_str): Modify default behaviour. Remove second argument.
18966 Echo modifications on calls.
18967 (output_graph): Fix.
18968
18969 2001-08-16 Marc Autret <autret_m@epita.fr>
18970
18971 * src/getargs.c (usage): Update with ``-g, --graph''.
18972
18973 2001-08-16 Marc Autret <autret_m@epita.fr>
18974
18975 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
18976 (Option Cross Key): Likewise.
18977 * doc/bison.1: Update.
18978
1c8c2190
PB
189792001-09-25 Pascal Bart <pascal.bart@epita.fr>
18980
18981 * src/output.c (output_master_parser): Don't finish action_obstack.
18982 (output_parser): Don't care about the muscle action, here.
18983 (prepare): Copy the action_obstack in the action muscle.
18984 (output): Free action_obstack.
18985
180d45ba
PB
189862001-09-23 Pascal Bart <pascal.bart@epita.fr>
18987
18988 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
18989 will contain `%union' declaration.
18990 (parse_union_decl): Delete #line directive output.
18991 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
18992 informations about %union.
18993 (parse_union_decl): Copy the union_obstack in the muscle stype.
18994 * src/bison.simple: Add new #line directive.
18995 Add typdef %%stype YYSTYPE.
18996
c51d1a19
PB
189972001-09-23 Pascal Bart <pascal.bart@epita.fr>
18998
18999 * src/bison.simple: Add new `#line' directive.
19000
6f9344da
PB
190012001-09-22 Pascal Bart <pascal.bart@epita.fr>
19002
19003 * src/bison.simple: New `#line' directive.
19004 * src/output.c (output_parser): Support new dynamic muscle input_line.
19005
652def80
MA
190062001-09-22 Marc Autret <autret_m@epita.fr>
19007
19008 * src/output.c (output_master_parser): New.
19009 (output_parser): Be more re-entrant.
19010
25b222fa
MA
190112001-09-21 Marc Autret <autret_m@epita.fr>
19012
19013 * src/reader.c (copy_definition, parse_union_decl): Update and use
19014 `linef' muscle.
19015 (copy_action): Likewise.
19016 Use obstack_1grow ().
19017 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19018
6bc35ae5
MA
190192001-09-21 Marc Autret <autret_m@epita.fr>
19020
19021 * src/options.c (option_table): Adjust.
19022 * src/lex.c (parse_percent_token): Fix.
19023
c0629aa1
PB
190242001-09-20 Pascal Bart <pascal.bart@epita.fr>
19025
19026 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 19027
82b6d266
PB
190282001-09-20 Pascal Bart <pascal.bart@epita.fr>
19029
19030 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19031 is now an option_table_struct*.
19032 (option_strcmp): New function option_strcmp.
19033 (parse_percent_token): Call option_strcmp.
19034 * src/getargs.c (xalloc.h, options.h): Include it.
19035 (getargs): Call create_long_option_table.
19036 (getargs): Free longopts at the end of the function.
19037 (shortopts): Move in options.c.
19038 * src/options.c (create_long_option_table): New function. Convert
19039 information from option_table to option structure.
19040 * src/reader.c (options.h): Include it.
19041
19042 * src/Makefile.am: Adjust.
19043 * src/options.c (option_table): Create from longopts and percent_table.
19044 * src/getargs.c (longopts): Delete.
19045 * src/lex.c (struct percent_table_struct): Delete.
19046 (percent_table): Delete.
19047 (options.h): Include it.
19048 * src/options.c: Create.
19049 * src/options.h: Create.
19050 Declare enum opt_access_e.
19051 Define struct option_table_struct.
19052
75f5aaea
MA
190532001-09-20 Marc Autret <autret_m@epita.fr>
19054
19055 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19056 sections of Bison.
19057
f508cb0a
PB
190582001-09-19 Pascal Bart <pascal.bart@epita.fr>
19059
19060 * src/bison.simple: s/%%filename/%%skeleton.
19061 * src/muscle_tab.c (getargs.h): Include it.
19062 (muscle_init): Insert new muscle skeleton.
19063
13105fc1
PB
190642001-09-18 Pascal Bart <pascal.bart@epita.fr>
19065
19066 * src/output.c (output_parser): Delete unused variable actions_dumped.
19067
b0c4483e
PB
190682001-09-07 Pascal Bart <pascal.bart@epita.fr>
19069
19070 * src/output.c (output): Delete call to reader_output_yylsp.
19071 * src/reader.c (reader): Likewise.
ba0fe3c7 19072 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 19073
11d82f03
MA
190742001-09-02 Marc Autret <autret_m@epita.fr>
19075
19076 * src/reader.c: Include muscle_tab.h.
19077 (parse_union_decl): Update.
19078 (parse_macro_decl): Rename parse_muscle_decl.
19079 Update to use renamed functions and variable.
19080 (read_declarations, copy_action, read_additionnal_code, : Updated
19081 with correct variables and functions names.
19082 (packsymbols, reader): Likewise.
342b8b6e 19083
11d82f03 19084 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 19085
11d82f03
MA
19086 * src/output.c: Include muscle_tab.h
19087 In all functions using macro_insert, change by using muscle_insert ().
19088 (macro_obstack): Rename muscle_obstack.
19089 Echo modifications in the whole file.
19090 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19091 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19092 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19093
19094 * src/muscle_tab.h: Update double inclusion macros.
19095 (macro_entry_s): Rename muscle_entry_s.
19096 Update prototypes.
342b8b6e 19097
11d82f03
MA
19098 * src/muscle_tab.c: Include muscle_tab.h.
19099 Rename macro_tabble to muscle_table.
19100 (mhash1, mhash2, mcmp): Use muscle_entry.
19101 (macro_init): Rename muscle_init. Update.
19102 (macro_insert): Rename muscle_insert. Update.
19103 (macro_find): Rename muscle_find. Update.
19104
19105 * src/main.c: Include muscle_tab.h.
19106 (main): Call muscle_init ().
19107 * src/Makefile.am (bison_SOURCES): Echo modifications.
19108
93a37297
MA
191092001-09-02 Marc Autret <autret_m@epita.fr>
19110
f753cd62 19111 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 19112
f753cd62
MA
19113 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19114
191152001-09-02 Marc Autret <autret_m@epita.fr>
19116
19117 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 19118
682d48cd
PB
191192001-09-01 Pascal Bart <pascal.bart@epita.fr>
19120
342b8b6e 19121 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
19122 filename.
19123
087c8fda
MA
191242001-09-01 Marc Autret <autret_m@epita.fr>
19125
19126 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19127 to an explicit value to activate the feature. We do it here.
19128
dda680cb
PB
191292001-08-31 Pascal Bart <pascal.bart@epita.fr>
19130
19131 * src/output.c (prepare): Delete the `filename' muscule insertion.
19132 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19133 (parse_union_decl): Likewise.
19134 * src/macrotab.c (macro_init): Initialize filename by infile.
19135
9e644e64
MA
191362001-08-31 Marc Autret <autret_m@epita.fr>
19137
19138 * src/bison.simple (YYLSP_NEEDED): New definition.
19139 * src/output.c (prepare): Add macro insertion of `locations_flag'
19140
17da6427
PB
191412001-08-31 Pascal Bart <pascal.bart@epita.fr>
19142
19143 * src/output.c (prepare): Delete insertion of previous muscles,
19144 and insert the `prefix' muscles.
19145 * src/macrotab.c (macro_init): Likewise.
19146 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 19147 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
19148 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19149 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 19150 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
19151 name_prefix.
19152
e8cb70b9
PB
191532001-08-31 Pascal Bart <pascal.bart@epita.fr>
19154
19155 * src/main.c (main): Standardize.
19156 * src/output.c (output_table_data, output_parser): Likewise.
19157 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19158
63c2d5de
MA
191592001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19160
342b8b6e 19161 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
19162 %%epilogue.
19163 * src/output.c (output): Rename %%declarations to %%prologue.
19164 * src/bison.simple: Echo modifications.
342b8b6e 19165
d8cb5183
MA
191662001-08-31 Marc Autret <autret_m@epita.fr>
19167
19168 * src/reader.c (readgram): CleanUp.
19169 (output_token_defines): Likewise.
19170 (packsymbols): Likewise.
19171 (reader): Likewise.
19172 * src/output.c (output): CPP-out useless code.
19173
6c686258
PB
191742001-08-31 Pascal Bart <pascal.bart@epita.fr>
19175
342b8b6e 19176 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
19177 output_trailers and output_headers.
19178 * src/output.h: Remove obsolete functions prototypes of output_headers
19179 and output_trailers.
19180
8f451ef7
PB
191812001-08-30 Pascal Bart <pascal.bart@epita.fr>
19182
19183 * src/main.c: Include macrotab.h.
342b8b6e 19184 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
19185 Adjust functions prototypes.
19186 * src/macrotab.c (macro_insert): Constify key and value.
19187 (macro_find): Constify key.
19188 (macro_insert): Include 'xalloc.h'
19189 (macro_insert): Use XMALLOC.
19190 (macro_find): Constify return value.
19191 * src/output.c (output_table_data): Rename table to table_data.
19192 (output_parser): Constify macro_key, macro_value.
19193
997b6fd0 191942001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
19195
19196 * src/reader.c (parse_skel_decl): New.
342b8b6e 19197 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
19198 * src/lex.h (token_t): New token `tok_skel'.
19199 * src/lex.c (percent_table): Add skeleton option entry.
19200 Standardize.
19201
ff48177d
MA
192022001-08-29 Marc Autret <autret_m@epita.fr>
19203
19204 * src/bison.simple: Add %%user_code directive at the end.
19205 * src/reader.c (read_additionnal_code): New.
19206 (reader): Use it.
19207 * src/output.c (output_program): Remove.
19208 (output): Update.
19209
b33160bf
MA
192102001-08-28 Marc Autret <autret_m@epita.fr>
19211
19212 * src/output.c (output_actions): Clean up.
4e5caae2 19213 (output_gram): CPP-out useless code.
b33160bf
MA
19214 * src/reader.c (reader): Clean up, CPP-out useless code.
19215
d1a2daf7
PB
192162001-08-28 Pascal Bart <pascal.bart@epita.fr>
19217
342b8b6e 19218 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 19219 directive.
d1a2daf7
PB
19220 * src/bison.simple: Add `%%definitions'.
19221
2b763dfe
MA
192222001-08-28 Marc Autret <autret_m@epita.fr>
19223
19224 * config/depcomp: New file.
19225
f1a87ef6
PE
192262001-08-27 Paul Eggert <eggert@twinsun.com>
19227
19228 * src/bison.simple (yyparse): Don't take the address of an
19229 item before the start of an array, as that doesn't conform to
19230 the C Standard.
19231
82e236e2
RA
192322001-08-27 Robert Anisko <robert.anisko@epita.fr>
19233
f1a87ef6 19234 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
19235 obstack. It was done too late here.
19236
19237 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19238 completely wrong.
19239 (reader): Initialize the macro obstack here, since we need it to grow
19240 '%define' directives.
19241
19242 * src/reader.h: Declare the macro obstack as extern.
19243
b0cfa28a
RA
192442001-08-27 Robert Anisko <robert.anisko@epita.fr>
19245
19246 * src/output.c (output_parser): Fix. Store single '%' characters in
19247 the output obstack instead of throwing them away.
19248
6fc74234
AD
192492001-08-27 Akim Demaille <akim@epita.fr>
19250
19251 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19252
9c76d118
RA
192532001-08-25 Robert Anisko <robert.anisko@epita.fr>
19254
19255 * lib/Makefile.am: Adjust.
19256
a8289c62
RA
192572001-08-25 Robert Anisko <robert.anisko@epita.fr>
19258
19259 * src/bison.simple: Update and add '%%' directives.
19260
b6610515
RA
192612001-08-25 Robert Anisko <robert.anisko@epita.fr>
19262
19263 * src/reader.c (reader): Remove calls to 'output_headers' and
19264 'output_trailers'. Remove some C output.
19265 (readgram): Disable a piece of code that was writing a default
19266 definition for 'YYSTYPE'.
19267 (reader_output_yylsp): Remove.
19268 (packsymbols): Output token defintions to a macro.
19269 (copy_definition): Disable C output.
6fc74234 19270
b6610515
RA
19271 * src/reader.c (parse_macro_decl): New function used to parse macro
19272 declarations.
19273 (copy_string2): Put the body of copy_string into this new function.
19274 Add a parameter to let the caller choose whether he wants to copy the
19275 string delimiters or not.
19276 (copy_string): Be a simple call to copy_string2 with the last argument
19277 bound to true.
19278 (read_declarations): Add case for macro definition.
19279 (copy_identifier): New.
6fc74234 19280 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
19281 rather than lex.
19282
26f609ff
RA
192832001-08-25 Robert Anisko <robert.anisko@epita.fr>
19284
19285 * src/output.c (prepare): Add prefixed names.
19286 (output_parser): Output semantic actions.
19287 (output_parser): Fix bug on '%%line' directives.
6fc74234 19288
26f609ff
RA
19289 * src/output.c (output_headers): Remove. The C code printed by this
19290 function should now be in the skeletons.
19291 (output_trailers): Remove.
19292 (output): Disable call to 'reader_output_yylsp'.
19293 (output_rule_data): Do not output tables to the table obstack.
19294
19295 * src/output.c: Remove some C dedicated output.
19296 Improve the use of macro and output obstacks.
19297 (output_defines): Remove.
6fc74234 19298
26f609ff
RA
19299 * src/output.c (output_token_translations): Associate 'translate'
19300 table with a macro. No output to the table obstack.
19301 (output_gram): Same for 'rhs' and 'prhs'.
19302 (output_stos): Same for 'stos'.
19303 (output_rule_data): Same for 'r1' and 'r2'.
19304 (token_actions): Same for 'defact'.
19305 (goto_actions): Same for 'defgoto'.
19306 (output_base): Same for 'pact' and 'pgoto'.
19307 (output_table): Same for 'table'.
19308 (output_check): Same for 'check'.
6fc74234 19309
26f609ff
RA
19310 * src/output.c (output_table_data): New function.
19311 (output_short_table): Remove.
19312 (output_short_or_char_table): Remove.
6fc74234 19313
26f609ff
RA
19314 * src/output.c (output_parser): Replace most of the skeleton copy code
19315 with something new. Skeletons are now processed character by character
19316 rather than line by line, and Bison looks for '%%' macros. This is the
19317 first step in making Bison's output process (a lot) more flexible.
19318 (output_parser): Use the macro table.
19319
6f43b113
RA
193202001-08-25 Robert Anisko <robert.anisko@epita.fr>
19321
19322 * src/main.c (main): Initialize the macro table.
19323
dd3127cf
RA
193242001-08-25 Robert Anisko <robert.anisko@epita.fr>
19325
19326 * src/lex.c (percent_table): Add tok_define.
19327 * src/lex.h: Add tok_define.
19328
aa321494
RA
193292001-08-25 Robert Anisko <robert.anisko@epita.fr>
19330
19331 * src/macrotab.c: New file.
19332 * src/macrotab.h: New file.
19333 * src/Makefile.am: Update.
19334
68bd3b6b
RA
193352001-08-25 Robert Anisko <robert.anisko@epita.fr>
19336
19337 * lib/hash.c: New file.
19338 * lib/hash.h: New file.
19339 * lib/Makefile.am: Update.
19340
45f8dd1e
AD
193412001-08-15 Akim Demaille <akim@epita.fr>
19342
19343 Version 1.28c.
19344
40a64a7a 193452001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
19346
19347 * src/reader.c (readgram): Indent output macro YYSTYPE.
19348 (packsymbols): Likewise.
19349 (output_token_defines): Likewise.
19350 * src/files.c: Standardize.
19351 (compute_header_macro): New.
19352 (defines_obstack_save): New. Use compute_header_macro.
19353 (output_files): Update. Use defines_obstack_save.
19354
f9a8293a
AD
193552001-08-15 Akim Demaille <akim@epita.fr>
19356
19357 * doc/bison.texinfo (Table of Symbols): Document
19358 YYSTACK_USE_ALLOCA.
19359
150ca7a7
AD
193602001-08-15 Akim Demaille <akim@epita.fr>
19361
19362 * missing: Update from CVS Automake.
19363 * config/config.guess, config/config.sub, config/texinfo.tex:
19364 Update from gnu.org.
19365
69b5cec4
AD
193662001-08-15 Akim Demaille <akim@epita.fr>
19367
19368 * Makefile.maint: Sync with CVS Autoconf.
19369
f2b5126e
PB
193702001-08-14 Pascal Bart <pascal.bart@epita.fr>
19371
69b5cec4 19372 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
19373 `fdl.texi'.
19374 * doc/fdl.texi: Add to package.
19375
4ecbf796
MA
193762001-08-14 Marc Autret <autret_m@epita.fr>
19377
19378 Turn on %{source,header}_extension features.
19379
69b5cec4 19380 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
19381 source_extension.
19382 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 19383 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
19384 between options.
19385
95fb5662
MA
193862001-08-14 Marc Autret <autret_m@epita.fr>
19387
19388 * src/files.c (compute_base_names): Add extensions computing when
19389 `--file-prefix' used.
19390 Standardize function calls.
19391
78d09da9
MA
193922001-08-13 Marc Autret <autret_m@epita.fr>
19393
69b5cec4 19394 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
19395 defining it (defined but null disables alloca).
19396
5a009f2c
MA
193972001-08-13 Marc Autret <autret_m@epita.fr>
19398
19399 * src/bison.simple (_yy_memcpy): CPP reformat.
19400
1e41465a
PB
194012001-08-13 Pascal Bart <pascal.bart@epita.fr>
19402
19403 * tests/atconfig.in (CPPFLAGS): Fix.
19404
c67a198d
PB
194052001-08-10 Pascal Bart <pascal.bart@epita.fr>
19406
79282c6c 19407 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
19408 `gpl.texi'.
19409 * doc/gpl.texi: Add to package.
19410
09a6de7e
MA
194112001-08-10 Marc Autret <autret_m@epita.fr>
19412
19413 * src/print_graph.h: Fix.
19414 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
19415
b77b9ee0
AD
194162001-08-10 Akim Demaille <akim@epita.fr>
19417
19418 * src/system.h: Provide default declarations for stpcpy, strndup,
19419 and strnlen.
19420
3e259915
MA
194212001-08-10 Robert Anisko <anisko_r@epita.fr>
19422
19423 * doc/bison.texinfo (Locations): Update @$ stuff.
19424
ca96bc2d
MA
194252001-08-09 Robert Anisko <anisko_r@epita.fr>
19426
19427 * src/bison.simple (YYLLOC_DEFAULT): Update.
19428 (yyparse): Adjust.
19429
fdc6758b
MA
194302001-08-08 Marc Autret <autret_m@epita.fr>
19431
b77b9ee0 19432 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
19433 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
19434 Reported by Fabrice Bauzac.
957d4dbf 19435
600cad3b
MA
194362001-08-08 Marc Autret <autret_m@epita.fr>
19437
19438 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
19439 * src/vcg.c (output_node): Fix.
19440 * src/vcg.h: Cleanup.
19441 * src/print_graph.c: Add comments.
b77b9ee0 19442 (node_output_size): New global variable. Simplify the formatting of
600cad3b 19443 the VCG graph output.
b77b9ee0 19444 (print_actions): Unused code is now used. It notifies the final state
600cad3b 19445 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 19446 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
19447 blue.
19448 Get the current node name and node_obstack by argument.
19449 (node_obstack): New variable.
19450 (print_state): Manage node_obstack.
19451 (print_core): Use node_obstack given by argument.
19452 A node is not only computed here but in print_actions also.
19453 (print_graph): CPP out useless code instead of commenting it.
19454
976e528f
AD
194552001-08-07 Pascal Bart <pascal.bart@epita.fr>
19456
19457 * tests/atconfig.in (CPPFLAGS): Fix.
19458
20e8e5ca
AD
194592001-08-07 Akim Demaille <akim@epita.fr>
19460
19461 * src/print_graph.c (quote): New.
19462 (print_core): Use it.
19463
957d4dbf 194642001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 19465
3e3da797
AD
19466 * src/vcg.c (complain.h): Include it.
19467 Unepitaize `return' invocations.
c4b66126 19468 [NDEBUG] (main): Remove.
79282c6c 19469 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
19470 * src/files.c (open_files): Initialize graph_obstack.
19471 * src/print_graph.c (print_actions): CPP out useless code.
19472 (print_core): Don't output the last `\n' in labels.
19473 Use `quote'.
19474 * src/files.c (output_files): Output the VCG file.
19475 * src/main.c (main): Invoke print_graph ();
3e3da797 19476
957d4dbf 194772001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
19478
19479 Automaton VCG graph output.
19480 Using option ``-g'' or long option ``--graph'', you can generate
19481 a gram_filename.vcg file containing a VCG description of the LALR (1)
19482 automaton of your grammar.
19483
19484 * src/main.c: Call to print_graph() function.
19485 * src/getargs.h: Update.
19486 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
19487 (graph_flag): New flag.
19488 (longopts): Update.
19489 (getargs): Add case `g'.
19490 * src/files.c (graph_obstack): New obstack struct.
19491 (open_files): Initialize new obstack.
19492 (output_files): Saves graph_obstack if required.
19493 * src/files.h (graph_obstack): New extern declaration.
19494 * src/Makefile.am: Add new source files.
19495
927c1557 194962001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
19497
19498 * src/print_graph.c, src/print_graph.h (graph): New.
19499 * src/vcg.h: New file.
19500 * src/vcg.c: New file, VCG graph handling.
19501
7333d403
AD
195022001-08-06 Marc Autret <autret_m@epita.fr>
19503
19504 Add of %source_extension and %header_extension which specify
19505 the source or/and the header output file extension.
19506
19507 * src/files.c (compute_base_names): Remove initialisation of
19508 src_extension and header_extension.
19509 (compute_exts_from_gf): Update.
19510 (compute_exts_from_src): Update.
19511 (output_files): Update.
19512 * src/reader.c (parse_header_extension_decl): New.
19513 (parse_source_extension_decl): New.
19514 (read_declarations): New case statements for the new tokens.
19515 * src/lex.c (percent_table): Add entries for %source_extension
19516 and %header_extension.
19517 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
19518
84163231
AD
195192001-08-06 Marc Autret <autret_m@epita.fr>
19520
19521 * configure.in: Bump to 1.28c.
19522 * doc/bison.texinfo: Texinfo thingies.
19523
8303fc42
AD
195242001-08-04 Pascal Bart <pascal.bart@epita.fr>
19525
19526 * tests/atconfig.in (CPPFLAGS): Add.
19527 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
19528
70a84437
AD
195292001-08-03 Akim Demaille <akim@epita.fr>
19530
19531 Version 1.28b.
19532
2ce10144
AD
195332001-08-03 Akim Demaille <akim@epita.fr>
19534
19535 * tests/Makefile.am (check-local): Ship testsuite.
19536 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
19537 Include `string.h'.
19538
1e3e4bc1
AD
195392001-08-03 Akim Demaille <akim@epita.fr>
19540
19541 * configure.in: Try using -Wformat when compiling.
19542
42b45b7f
AD
195432001-08-03 Akim Demaille <akim@epita.fr>
19544
19545 * configure.in: Bump to 1.28b.
19546
8f13fe33
AD
195472001-08-03 Akim Demaille <akim@epita.fr>
19548
19549 * src/complain.c: Adjust strerror_r portability issues.
19550
b37ba92c
AD
195512001-08-03 Akim Demaille <akim@epita.fr>
19552
19553 Version 1.28a.
19554
b0ce6046
AD
195552001-08-03 Akim Demaille <akim@epita.fr>
19556
19557 * src/getargs.c, src/getarg.h (skeleton)): Constify.
19558 * src/lex.c (literalchar): Avoid name clashes on `buf'.
19559 * src/getargs.c: Include complain.h.
19560 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
19561 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
19562
d01c415b
AD
195632001-08-03 Akim Demaille <akim@epita.fr>
19564
19565 * src/reader.c (readgram): Display hidden chars in error messages.
19566
459dd1a6
AD
195672001-08-03 Akim Demaille <akim@epita.fr>
19568
19569 Update to gettext 0.10.39.
19570
53b74c0c
AD
195712001-08-03 Akim Demaille <akim@epita.fr>
19572
19573 * lib/strspn.c: New.
19574
234a3be3
AD
195752001-08-01 Marc Autret <autret_m@epita.fr>
19576
19577 * doc/bison.texinfo: Update.
19578 * doc/bison.1 (mandoc): Update.
19579 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
19580 * src/files.c: Support output files extensions computing.
19581 (src_extension): New static variable.
19582 (header_extension): New static variable.
19583 (tr): New function.
19584 (get_extension_index): New function, gets the index of an extension
19585 filename in a string.
19586 (compute_exts_from_gf): New function, computes extensions from the
19587 grammar file extension.
19588 (compute_exts_from_src): New functions, computes extensions from the
19589 C source file extension, file given by ``-o'' option.
19590 (compute_base_names): Update.
19591 (output_files): Update.
19592
847bf1f5
AD
195932001-08-01 Robert Anisko <anisko_r@epita.fr>
19594
d995fee7 19595 * doc/bison.texi: Document @$.
847bf1f5
AD
19596 (Locations): New section.
19597
d074a105
AD
195982001-07-18 Akim Demaille <akim@epita.fr>
19599
19600 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
19601 * config/prev-version.txt, config/move-if-change: New.
19602 * Makefile.am: Adjust.
19603
3419715d
AD
196042001-07-08 Pascal Bart <pascal.bart@epita.fr>
19605
19606 * src/bison.simple (yyparse): Suppress warning `comparaison
19607 between signed and unsigned'.
19608
62ab6972
AD
196092001-07-05 Pascal Bart <pascal.bart@epita.fr>
19610
19611 * src/getargs.h (raw_flag): Remove.
19612 * src/getargs.c: Die on `-r'/`--raw'.
19613 * src/lex.c (parse_percent_token): Die on `%raw'.
19614 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
19615 * tests/calc.at: Suppress test with option `--raw'.
19616
1e24cc5b
AD
196172001-07-14 Akim Demaille <akim@epita.fr>
19618
19619 * config/: New.
19620 * configure.in: Require Autoconf 2.50.
19621 Update to gettext 0.10.38.
19622
32dfccf8
AD
196232001-03-16 Akim Demaille <akim@epita.fr>
19624
19625 * doc/bison.texinfo: ANSIfy the examples.
19626
cd5bd6ac
AD
196272001-03-16 Akim Demaille <akim@epita.fr>
19628
19629 * getargs.c (skeleton): New variable.
19630 (longopts): --skeleton is a new option.
19631 (shortopts, getargs): -S is a new option.
19632 * getargs.h: Declare skeleton.
19633 * output.c (output_parser): Use it.
19634
5141b016
AD
196352001-03-16 Akim Demaille <akim@epita.fr>
19636
19637 * m4/strerror_r.m4: New.
19638 * m4/error.m4: Run AC_FUNC_STRERROR_R.
19639 * lib/error.h, lib/error.c: Update.
19640
447992b9
AD
196412001-03-16 Akim Demaille <akim@epita.fr>
19642
19643 * src/getargs.c (longopts): Clean up.
19644
274d42ce
AD
196452001-02-21 Akim Demaille <akim@epita.fr>
19646
19647 * src/reader.c (gensym): `gensym_count' is your own.
19648 Use a static buf to create the symbol name, as token_buffer is no
19649 longer a buffer.
19650
22c821f3
AD
196512001-02-08 Akim Demaille <akim@epita.fr>
19652
19653 * src/conflicts.c (conflict_report): Be sure not to append to res
19654 between two calls, which could happen if both first sprintf were
19655 skipped, but not the first cp += strlen.
19656
18569462
AD
196572001-02-08 Akim Demaille <akim@epita.fr>
19658
19659 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
19660 New, from fileutils 4.0.37.
19661 * configure.in: Require Autoconf 2.49c. I took some time before
19662 making this decision. This is the only way out for portability
19663 issues in Bison, it would mean way too much duplicate effort to
19664 import in Bison features implemented in 2.49c since 2.13.
19665 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
19666
0d8f3c8a
AD
196672001-02-02 Akim Demaille <akim@epita.fr>
19668
19669 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 19670 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 19671
f17bcd1f
AD
196722001-01-19 Akim Demaille <akim@epita.fr>
19673
19674 Get rid of the ad hoc handling of token_buffer in the scanner: use
19675 the obstacks.
19676
19677 * src/lex.c (token_obstack): New.
19678 (init_lex): Initialize it. No longer call...
19679 (grow_token_buffer): this. Remove it.
19680 Adjust all the places which used it to use the obstack.
19681
511e79b3
AD
196822001-01-19 Akim Demaille <akim@epita.fr>
19683
19684 * src/lex.h: Rename all the tokens:
19685 s/\bENDFILE\b/tok_eof/g;
19686 s/\bIDENTIFIER\b/tok_identifier/g;
19687 etc.
19688 Let them be enums, not #define, to ease debugging.
19689 Adjust all the code.
19690
0d6508ef
AD
196912001-01-18 Akim Demaille <akim@epita.fr>
19692
19693 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
19694 * src/lex.c (maxtoken, grow_token_buffer): Static.
19695
6deb4447
AD
196962001-01-18 Akim Demaille <akim@epita.fr>
19697
19698 Since we now use obstacks, more % directives can be enabled.
19699
19700 * src/lex.c (percent_table): Also accept `%yacc',
19701 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
19702 `%debug'.
19703 Handle the actions for `%semantic_parser' and `%pure_parser' here,
19704 instead of returning a token.
19705 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
19706 * src/reader.c (read_declarations): Adjust.
19707 * src/files.c (open_files): Don't call `compute_base_names', don't
19708 compute `attrsfile' since they depend upon data which might be
19709 *in* the input file now.
19710 (output_files): Do it here.
19711 * src/output.c (output_headers): Document the fact that this patch
19712 introduces a guaranteed SEGV for semantic parsers.
19713 * doc/bison.texinfo: Document them.
19714 * tests/suite.at: Exercise these %options.
19715
ff4423cc
AD
197162000-12-20 Akim Demaille <akim@epita.fr>
19717
19718 Also handle the output file (--verbose) with obstacks.
19719
19720 * files.c (foutput): Remove.
19721 (output_obstack): New.
19722 Adjust all dependencies.
19723 * src/conflicts.c: Return a string.
19724 * src/system.h (obstack_grow_string): Rename as...
19725 (obstack_sgrow): this. Be ready to work with non literals.
19726 (obstack_fgrow4): New.
19727
956dba3a
AD
197282000-12-20 Akim Demaille <akim@epita.fr>
19729
19730 * src/files.c (open_files): Fix the computation of short_base_name
19731 in the case of `-o foo.tab.c'.
19732
337bab46
AD
197332000-12-20 Akim Demaille <akim@epita.fr>
19734
19735 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
19736 (copy_dollar): Now that everything uses obstacks, get rid of the
19737 FILE * parameters.
19738
5d3214b8
AD
197392000-12-20 Akim Demaille <akim@epita.fr>
19740
19741 * src/files.c (open_files): Actually the `.output' file is based
19742 on the short_base_name, not base_name.
19743 * tests/suite.at (Checking output file names): Adjust.
19744
29092a57
AD
197452000-12-20 Akim Demaille <akim@epita.fr>
19746
19747 * src/bison.s1: Remove, we now use directly...
19748 * src/bison.simple: this.
19749 * src/Makefile.am: Use pkgdata instead of data.
19750
ea5607fd
AD
197512000-12-20 Akim Demaille <akim@epita.fr>
19752
19753 * src/files.c (guard_obstack): New.
19754 (open_files): Initialize it.
19755 (output_files): Dump it...
19756 * src/files.h: Export it.
19757 * src/reader.c (copy_guard): Use it.
19758
27110317
AD
197592000-12-19 Akim Demaille <akim@epita.fr>
19760
19761 * src/files.c (outfile, defsfile, actfile): Removed as global
19762 vars.
19763 (open_files): Don't compute them.
19764 (output_files): Adjust.
19765 (base_name, short_base_name): Be global.
19766 Adjust dependencies.
19767
19c50364
AD
197682000-12-19 Akim Demaille <akim@epita.fr>
19769
19770 * src/files.c (strsuffix): New.
19771 (stringappend): Be just like strcat but allocate.
19772 (base_names): Eve out from open_files.
19773 Try to simplify the rather hairy computation of base_name and
19774 short_base_name.
19775 (open_files): Use it.
19776 * tests/suite.at (Checking output file names): New test.
19777
573c1d9f
AD
197782000-12-19 Akim Demaille <akim@epita.fr>
19779
19780 * src/system.h (obstack_grow_literal_string): Rename as...
19781 (obstack_grow_string): this.
19782 * src/output.c (output_parser): Recognize `%% actions' instead of
19783 `$'.
19784 * src/bison.s1: s/$/%% actions/.
19785 * src/bison.hairy: Likewise.
19786
ef7ddedd
AD
197872000-12-19 Akim Demaille <akim@epita.fr>
19788
19789 * src/output.c (output_parser): Compute the `#line' lines when
19790 there are.
19791 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
19792 Suggested by Hans Aberg.
19793
ff61dabd
AD
197942000-12-19 Akim Demaille <akim@epita.fr>
19795
19796 Let the handling of the skeleton files be local to the procedures
19797 that use it.
19798
19799 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
19800 longer static.
19801 (fparser, open_extra_files): Remove.
19802 (open_files, output_files): Don't take care of fparser.
19803 * src/files.h: Adjust.
19804 * src/output.c (output_parser): Open and close the file to the
19805 skeleton.
19806 * src/reader.c (read_declarations): When %semantic_parser, open
19807 fguard.
19808
55b96341
AD
198092000-12-19 Akim Demaille <akim@epita.fr>
19810
19811 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
19812 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
19813
358c15b7
AD
198142000-12-19 Akim Demaille <akim@epita.fr>
19815
19816 * src/files.c (open_files): Yipee! We no longer need all the code
19817 looking for `/tmp' since we have no tmp file.
19818
7de3329e
AD
198192000-12-19 Akim Demaille <akim@epita.fr>
19820
19821 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
19822 New macros.
19823 * src/files.c (open_files): Less dependency on MSDOS etc.
19824
3abcd459
AD
198252000-12-14 Akim Demaille <akim@epita.fr>
19826
19827 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
19828 Provide a default definition.
19829 Use it when executing the default @ action.
19830 * src/reader.c (reader_output_yylsp): No longer include
19831 `timestamp' and `text' in the default YYLTYPE.
19832
2a91a95e
AD
198332000-12-12 Akim Demaille <akim@epita.fr>
19834
19835 * src/reader.c (copy_definition, parse_union_decl, copy_action)
19836 (copy_guard): Quote the file names.
19837 Reported by Laurent Mascherpa.
19838
14d3eb9b
AD
198392000-12-12 Akim Demaille <akim@epita.fr>
19840
19841 * src/output.c (output_headers, output_program, output): Be sure
19842 to escape special characters when outputting filenames.
19843 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
19844 (output_headers): Don't depend on them, Use ACTSTR.
19845
d7045ec6
AD
198462000-11-17 Akim Demaille <akim@epita.fr>
19847
19848 * lib/obstack.h: Formatting changes.
19849 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
19850 prevents type checking.
19851 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
19852 cast the value to (void *): assigning a `foo *' to a `void *'
19853 variable is valid.
19854 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
19855 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
19856 append characters.
19857
6fd54b73
AD
198582000-11-17 Akim Demaille <akim@epita.fr>
19859
19860 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
19861 as...
19862 (suite.m4, regression.m4, calc.m4): these.
19863 * tests/atgeneral.m4: Update from CVS Autoconf.
19864
4c50eae6
AD
198652000-11-17 Akim Demaille <akim@epita.fr>
19866
19867 * tests/regression.m4 (%union and --defines): New test,
19868 demonstrating a current bug in the obstack implementation.
19869
a35f64ea
AD
198702000-11-17 Akim Demaille <akim@epita.fr>
19871
19872 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
19873 macros.
19874 Use them to declare the variables which are global or local to
19875 `yyparse'.
19876
7de23534
AD
198772000-11-17 Akim Demaille <akim@epita.fr>
19878
19879 * acconfig.h: Remove, no longer used.
19880
aa7815f5
AD
198812000-11-07 Akim Demaille <akim@epita.fr>
19882
19883 * src: s/Copyright (C)/Copyright/g.
19884
5af1f549
AD
198852000-11-07 Akim Demaille <akim@epita.fr>
19886
19887 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
19888 defining.
19889 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
19890
553e2b22
AD
198912000-11-07 Akim Demaille <akim@epita.fr>
19892
19893 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
19894 Merge in a single CPP if/else.
19895
8a4f41d6
AD
198962000-11-07 Akim Demaille <akim@epita.fr>
19897
19898 * src/output.c (output): Remove useless variables.
19899 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
19900 argument `data' for consistency with the prototypes.
19901 Qualify it `const'.
19902 (obstack_copy, obstack_copy0): Rename the second argument as
19903 `address' for consistency. Qualify it `const'.
19904 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
19905 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
19906 `const' their input argument (`data' or `address').
19907 Adjust the corresponding macros to include `const' in casts.
19908
095a3fb5
AD
199092000-11-03 Akim Demaille <akim@epita.fr>
19910
19911 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
19912 s/PFILE1/BISON_HAIRY/.
19913 Adjust dependencies.
19914
d1cdce7c
AD
199152000-11-03 Akim Demaille <akim@epita.fr>
19916
090c5ebf 19917 For some reason, this was not applied.
d1cdce7c
AD
19918
19919 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19920 `unlink': it's no longer used.
19921
9311529b
AD
199222000-11-03 Akim Demaille <akim@epita.fr>
19923
19924 * src/files.c (skeleton_find): New function, eved out of...
19925 (open_files, open_extra_files): here.
19926
d8880f69
AD
199272000-11-03 Akim Demaille <akim@epita.fr>
19928
19929 Don't use `atexit'.
19930
19931 * src/files.c (obstack_save): New function.
19932 (done): Rename as...
19933 (output_files): this.
19934 Use `obstack_save'.
19935 * src/main.c (main): Don't use `atexit' to register `done', since
19936 it no longer has to remove tmp files, just call `output_files'
19937 when there are no errors.
19938
0dbb648e
AD
199392000-11-02 Akim Demaille <akim@epita.fr>
19940
19941 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
19942 `unlink': it's no longer used.
19943 * src/files.h: Formatting changes.
19944
896fe5c1
AD
199452000-11-02 Akim Demaille <akim@epita.fr>
19946
19947 Remove the last uses of mktemp and unlink/delete.
19948
19949 * src/files.c (fdefines, ftable): Removed.
19950 (defines_ostack, table_obstack): New.
19951 Adjust dependencies of the former into uses of the latter.
19952 * src/output.c (output_short_or_char_table, output_short_table):
19953 Convert to using obstacks.
19954 * src/reader.c (copy_comment2): Accept one FILE * and two
19955 obstacks.
19956 (output_token_defines, reader_output_yylsp): Use obstacks.
19957 * src/system.h (obstack_fgrow3): New.
1f65350a 19958 * po/POTFILES.in: Adjust.
896fe5c1 19959
dd60faec
AD
199602000-11-01 Akim Demaille <akim@epita.fr>
19961
19962 Change each use of `fattrs' into a use of `attrs_obstack'.
19963
19964 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
19965 * src/files.c (fattrs): Remove.
19966 (attrs_obstack): New.
19967 Adjust all dependencies.
19968 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
19969
8c7ebe49
AD
199702000-11-01 Akim Demaille <akim@epita.fr>
19971
19972 Introduce obstacks.
19973 Change each use of `faction' into a use of `action_obstack'.
19974
19975 * lib/obstack.h, lib/obstack.c: New files.
19976 * src/files.c (faction): Remove.
19977 (action_obstack): New.
19978 Adjust all dependencies.
19979
77aee789
AD
199802000-10-20 Akim Demaille <akim@epita.fr>
19981
19982 * lib/quote.h (PARAMS): New macro. Use it.
19983
43591cec
AD
199842000-10-16 Akim Demaille <akim@epita.fr>
19985
19986 * src/output.c (output_short_or_char_table): New function.
19987 (output_short_table, output_token_translations): Use it.
19988 (goto_actions): Use output_short_table.
19989
1e9798d5
AD
199902000-10-16 Akim Demaille <akim@epita.fr>
19991
19992 * src/symtab.c (bucket_new): New function.
19993 (getsym): Use it.
19994
19995 * src/output.c (output_short_table): New argument to display the
19996 comment associated with the table.
19997 Adjust dependencies.
19998 (output_gram): Use it.
19999 (output_rule_data): Nicer output layout for YYTNAME.
20000
f282676b
AD
200012000-10-16 Akim Demaille <akim@epita.fr>
20002
20003 * src/lex.c (read_typename): New function.
20004 (lex): Use it.
20005 * src/reader.c (copy_dollar): Likewise.
20006
550a72a3
AD
200072000-10-16 Akim Demaille <akim@epita.fr>
20008
20009 * src/reader.c (copy_comment2): Expect the input stream to be on
20010 the `/' which is suspected to open a comment, instead of being
20011 called after `//' or `/*' was read.
20012 (copy_comment, copy_definition, parse_union_decl, copy_action)
20013 (copy_guard): Adjust.
20014
131e2fef
AD
200152000-10-16 Akim Demaille <akim@epita.fr>
20016
20017 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20018 `read_signed_integer'.
20019
79282c5a
AD
200202000-10-16 Akim Demaille <akim@epita.fr>
20021
20022 * src/reader.c (copy_dollar): New function.
20023 (copy_guard, copy_action): Use it.
20024
ff4a34be
AD
200252000-10-16 Akim Demaille <akim@epita.fr>
20026
20027 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20028 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20029 New files, from Fileutils 4.0.27.
20030 * src/main.c (printable_version): Remove.
20031 * src/lex.c, src/reader.c: Use `quote'.
20032
200332000-10-04 Akim Demaille <akim@epita.fr>
20034
20035 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20036
14ded682
AD
200372000-10-04 Akim Demaille <akim@epita.fr>
20038
20039 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20040
8e03724b
AD
200412000-10-04 Akim Demaille <akim@epita.fr>
20042
20043 When a literal string is used to define two different tokens,
20044 `bison -v' segfaults.
20045 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20046
20047 * tests/regression.m4: New file.
20048 Include the core of the sample provided by Piotr Gackiewicz.
20049 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20050 properly.
20051
a9e64249
AD
200522000-10-04 Akim Demaille <akim@epita.fr>
20053
20054 * src/reader.c (parse_expect_decl): Keep `count' within the size
20055 of `buffer'.
20056 From Neil Booth.
20057
da9abf43
AD
200582000-10-02 Paul Eggert <eggert@twinsun.com>
20059
20060 * bison.s1 (yyparse): Assign the default value
20061 unconditionally, to avoid a GCC warning and make the parser a
20062 tad smaller.
20063
c33638bb
AD
200642000-10-02 Akim Demaille <akim@epita.fr>
20065
20066 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20067 options.
20068
444c570a
AD
200692000-10-02 Akim Demaille <akim@epita.fr>
20070
20071 * src/derives.c, src/print.c, src/reduce.c: To ease the
20072 translation, move some `\n' out of the translated strings.
20073
89cab50d
AD
200742000-10-02 Akim Demaille <akim@epita.fr>
20075
20076 The location tracking mechanism is precious for parse error
20077 messages. Nevertheless, it is enabled only when `@n' is used in
20078 the grammar, which is a different issue (you can use it in error
20079 message, but not in the grammar per se). Therefore, there should
20080 be another means to enable it.
20081
20082 * src/getargs.c (getargs): Support `--locations'.
20083 (usage): Report it.
20084 * src/getargs.h (locationsflag): Export it.
20085 * src/lex.c (percent_table): Support `%locations'.
20086 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20087 with `locationsflag'.
20088 * doc/bison.texinfo: Document `--locations' and `%locations'.
20089 Sort the options.
20090 * tests/calc.m4: Test it.
20091
20092 For regularity of the names, replace each
20093 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20094 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20095 In addition replace each `flag' with `_flag'.
20096
d6c2cba0
AD
200972000-10-02 Akim Demaille <akim@epita.fr>
20098
20099 Also test parse error messages, including with YYERROR_VERBOSE.
20100
20101 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20102 associative).
20103 Use it to check the computations.
20104 Use it to check `nonassoc' is honored.
20105 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20106 `--yyerror-verbose'.
20107 (_AT_CHECK_CALC): Adjust to this option.
20108 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20109
5a35a6cb
AD
201102000-10-02 Akim Demaille <akim@epita.fr>
20111
20112 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20113 the latter demonstrates a flaw in the handling of non debugging
20114 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20115 was used in order to simplify:
20116
20117 #if YYDEBUG
20118 if (yydebug)
20119 {
20120 ...
20121 }
20122 #endif
20123
20124 into
20125
20126 if (yydebug)
20127 {
20128 ...
20129 }
20130
20131 unfortunately this leads to a CPP conflict when
20132 `--name-prefix=foo' is used since it produces `#define yydebug
20133 foodebug'.
20134
20135 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20136 (YYDPRINTF): New macro.
20137 Spread its use.
20138 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20139 the bison options.
20140 Also test `--verbose', `--defines' and `--name-prefix'.
20141
71da9eea
AD
201422000-10-02 Akim Demaille <akim@epita.fr>
20143
20144 Improve the readability of the produced parsers.
20145
20146 * src/bison.s1: Formatting changes.
20147 Improve the comment related to the `$' mark.
20148 (yydefault): Don't fall through to `yyresume': `goto' there.
20149 * src/output.c (output_parser): When the `$' is met, skip the end
20150 of its line.
20151 New variable, `number_of_dollar_signs', to check there's exactly
20152 one `$' in the parser skeleton.
20153
95e36146
AD
201542000-10-02 Akim Demaille <akim@epita.fr>
20155
20156 * lib/xstrdup.c: New file, from the fileutils.
20157 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20158 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20159 instead of strlen + xmalloc + strcpy.
20160 * src/symtab.c (copys): Remove, use xstrdup instead.
20161
d7020c20
AD
201622000-10-02 Akim Demaille <akim@epita.fr>
20163
20164 * src/gram.h (associativity): New enum type which replaces the
20165 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20166 `right_assoc', `left_assoc' and `non_assoc'.
20167 Adjust all dependencies.
20168 * src/reader.c: Formatting changes.
20169 (LTYPESTR): Don't define it, use it as a literal in
20170 `reader_output_yylsp'.
20171 * src/symtab.h (symbol_class): New enum type which replaces the
20172 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20173 `sunknown', `stoken and `snterm'.
20174
1916f98e
AD
201752000-10-02 Akim Demaille <akim@epita.fr>
20176
20177 * src/getargs.c (fixed_outfiles): Rename as...
20178 (yaccflag): for consistency and accuracy.
20179 Adjust dependencies.
20180
d7913476
AD
201812000-10-02 Akim Demaille <akim@epita.fr>
20182
20183 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20184 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20185 difficult and introduced a lot of core dump. It turns out that
20186 Bison used an implementation of `xmalloc' based on `calloc', and
20187 at various places it does depend upon the initialization to 0. I
20188 have not tried to isolate the pertinent places, and all the former
20189 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20190 someone should address this issue.
20191
20192 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20193 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20194 files.
20195 Adjust dependencies.
20196 * src/warshall.h: New file.
20197 Propagate.
20198
340ef489
AD
201992000-10-02 Akim Demaille <akim@epita.fr>
20200
20201 Various anti-`extern in *.c' changes.
20202
20203 * src/system.h: Include `assert.h'.
20204
b2ca4022
AD
202052000-10-02 Akim Demaille <akim@epita.fr>
20206
20207 * src/state.h (nstates, final_state, first_state, first_shift)
20208 (first_reduction): Move their exportation from here...
20209 * src/LR0.h: to here.
20210 Adjust dependencies.
20211 * src/getargs.c (statisticsflag): New variable.
20212 Add support for `--statistics'.
20213 Adjust dependencies.
20214
20215 Remove a lot of now useless `extern' statements in most files.
20216
403b315b
AD
202172000-10-02 Akim Demaille <akim@epita.fr>
20218
20219 * src/LR0.h: New file.
20220 Propagate its use.
20221
07a58c13
AD
202222000-10-02 Akim Demaille <akim@epita.fr>
20223
20224 * src/print.h: New file.
20225 Propagate its use.
20226 * src/print.c: Formatting and ordering changes.
20227 (verbose, terse): Replace with...
20228 (print_results): this new function.
20229 Adjust dependencies.
20230
0619caf0
AD
202312000-10-02 Akim Demaille <akim@epita.fr>
20232
20233 * src/conflicts.c (conflict_report): New function.
20234 (conflict_log, verbose_conflict_log): Replace with...
20235 (print_conflicts): this function.
20236 Adjust dependencies.
20237 * src/conflicts.h: New file.
20238 Propagate its inclusion.
20239
3519ec76
AD
202402000-10-02 Akim Demaille <akim@epita.fr>
20241
20242 * src/nullable.h: New file.
20243 Propagate its inclusion.
20244 * src/nullable.c: Formatting changes.
20245
015acc48
AD
202462000-10-02 Akim Demaille <akim@epita.fr>
20247
20248 * src/reduce.h: New file.
20249 Propagate its inclusion.
20250 * src/reduce.c: Topological sort and other formatting changes.
20251 (bool, TRUE, FALSE): Move their definition to...
20252 * src/system.h: here.
20253
8963a27b
AD
202542000-10-02 Akim Demaille <akim@epita.fr>
20255
20256 * src/files.c: Formatting changes.
20257 (tryopen, tryclose, openfiles): Rename as...
20258 (xfopen, xfclose, open_files): this.
20259 (stringappend): static.
20260 * src/files.h: Complete the list of exported symbols.
20261 Propagate its use.
20262
a70083a3
AD
202632000-10-02 Akim Demaille <akim@epita.fr>
20264
20265 * src/reader.h: New file.
20266 Propagate its use instead of tedious list of `extern' and
20267 prototypes.
20268 * src/reader.c: Formatting changes, topological sort,
20269 s/register//.
20270
abadc117
AD
202712000-10-02 Akim Demaille <akim@epita.fr>
20272
20273 * src/lex.h: Prototype `lex.c' exported functions.
20274 * src/reader.c: Adjust.
20275 * src/lex.c: Formatting changes.
20276 (safegetc): Rename as...
20277 (xgetc): this.
20278
720d742f
AD
202792000-10-02 Akim Demaille <akim@epita.fr>
20280
20281 * src/lalr.h: New file.
20282 Propagate its inclusion instead of prototypes and `extern'.
20283 * src/lalr.c: Formatting changes, topological sorting etc.
20284
f2acea59
AD
202852000-10-02 Akim Demaille <akim@epita.fr>
20286
20287 * src/output.c (token_actions): Introduce a temporary array,
20288 YYDEFACT, that makes it possible for this function to use
20289 output_short_table.
20290
d019d655
AD
202912000-10-02 Akim Demaille <akim@epita.fr>
20292
20293 `user_toknums' is output as a `short[]' in `output.c', while it is
20294 defined as a `int[]' in `reader.c'. For consistency with the
20295 other output tables, `user_toknums' is now defined as a table of
20296 shorts.
20297
20298 * src/reader.c (user_toknums): Be a short table instead of an int
20299 table.
20300 Adjust dependencies.
20301
20302 Factor the short table outputs.
20303
20304 * src/output.c (output_short_table): New function.
20305 * src/output.c (output_gram, output_stos, output_rule_data)
20306 (output_base, output_table, output_check): Use it.
20307
6c89f1c1
AD
203082000-10-02 Akim Demaille <akim@epita.fr>
20309
20310 * src/output.c (output): Topological sort of the functions, in
20311 order to get rid of the `static' prototypes.
20312 No longer use `register'.
20313 * src/output.h: New file.
20314 Propagate its inclusion in files explicitly prototyping functions
20315 from output.c.
20316
d9efd181
AD
203172000-09-21 Akim Demaille <akim@epita.fr>
20318
20319 * src/atgeneral.m4: Update from Autoconf.
20320
c29240e7 203212000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
20322
20323 * src/closure.h: New file.
20324 * src/closure.c: Formatting changes, topological sort over the
20325 functions, use of closure.h.
20326 (initialize_closure, finalize_closure): Rename as...
20327 (new_closure, free_closure): these. Adjust dependencies.
20328 * src/LR0.c: Formatting changes, topological sort, use of
20329 cloture.h.
20330 (initialize_states): Rename as...
20331 (new_states): this.
20332 * src/Makefile.am (noinst_HEADERS): Adjust.
20333
499daa50
AD
203342000-09-20 Akim Demaille <akim@epita.fr>
20335
20336 * src/acconfig.h: Don't protect config.h against multiple
20337 inclusion.
20338 Don't define PARAMS.
20339 * src/system.h: Define PARAMS.
20340 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
20341 purpose of config.h. system.h must not try to fix wrong
20342 definitions in config.h.
20343
cc84fd5d
AD
203442000-09-20 Akim Demaille <akim@epita.fr>
20345
20346 * src/derives.h: New file.
20347 * src/main.c, src/derives.h: Use it.
20348 Formatting changes.
20349 * src/Makefile.am (noinst_HEADERS): Adjust.
20350
db5b3a89
AD
203512000-09-20 Akim Demaille <akim@epita.fr>
20352
20353 * tests/atgeneral.m4: Update from Autoconf.
20354 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
20355 (AT_CHECK_CALC): New macros.
20356 Use these macros to test bison with options `', `--raw',
20357 `--debug', `--yacc', `--yacc --debug'.
20358
ceed8467
AD
203592000-09-19 Akim Demaille <akim@epita.fr>
20360
20361 * src/output.c: Formatting changes.
20362 * src/machine.h: Remove, leaving its contents in...
20363 * src/system.h: here.
20364 Include stdio.h.
20365 Adjust all dependencies on stdio.h and machine.h.
20366 * src/getargs.h: New file.
20367 Let all `extern' declarations about getargs.c be replaced with
20368 inclusion of `getargs.h'.
20369 * src/Makefile.am (noinst_HEADERS): Adjust.
20370
20371 * tests/calc.m4 (yyin): Be initialized in main, not on the global
20372 scope.
20373 (yyerror): Returns void, not int.
20374 * doc/bison.texinfo: Formatting changes.
20375
05a1d24b
AD
203762000-09-19 Akim Demaille <akim@epita.fr>
20377
20378 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
20379 portable.
20380
cbd25751
AD
203812000-09-18 Akim Demaille <akim@epita.fr>
20382
20383 * configure.in: Append WARNING_CFLAGS to CFLAGS.
20384 * src/Makefile.am (INCLUDES): Don't.
20385 Be ready to fetch headers in lib/.
20386
13863333
AD
203872000-09-18 Akim Demaille <akim@epita.fr>
20388
20389 * doc/bison.texinfo: Update the copyright.
20390 ANSIfy and GNUify the examples.
20391 Remove the old menu.
20392
0d533154
AD
203932000-09-18 Akim Demaille <akim@epita.fr>
20394
20395 First set of tests: use the `calc' example from the documentation.
20396
20397 * src/bison.s1 (yyparse): Condition the code using `yytname' which
20398 is defined only when YYDEBUG is.
20399 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
20400 * src/files.c (tryopen, tryclose): Formatting changes.
20401 Move to the top and be static.
20402 * src/reader.c (read_signed_integer): Likewise.
20403 * tests/calc.m4: New file.
20404 * Makefile.am, suite.m4: Adjust.
20405 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
20406
e79137ac
AD
204072000-09-18 Akim Demaille <akim@epita.fr>
20408
20409 Add support for an Autotest test suite for Bison.
20410
20411 * m4/m4.m4, m4/atconfig.m4: New files.
20412 * m4/Makefile.am (EXTRA_DIST): Adjust.
20413 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
20414 files.
20415 * src/getargs.c: Display a more standard --version message.
20416 * src/reader.c (reader): Formatting changes.
20417 No longer depend upon VERSION_STRING.
20418 * configure.in: No longer use `dnl'.
20419 Set up the test suite and the new directory `tests/.
20420 (VERSION_STRING): Remove.
20421
27821bff
AD
204222000-04-14 Akim Demaille <akim@epita.fr>
20423
20424 * src/reader.c (copy_comment2): New function, same as former
20425 `copy_comment', but outputs into two FILE *.
20426 (copy_comment): Use it.
20427 (parse_union_decl): Use it.
20428 (get_type, parse_start_decl): Use the same `invalid' message.
20429 (parse_start_decl, parse_union_decl): Use the same `multiple'
20430 message.
20431 (parse_union_decl, copy_guard, copy_action): Use the same
20432 `unmatched' message.
20433 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
20434
cfe5fbc0
AD
204352000-03-31 Akim Demaille <akim@epita.fr>
20436
20437 * src/files.c (tryopen, tryclose): Move to the top.
20438 Be static.
20439
cb7db13e
AD
204402000-03-31 Akim Demaille <akim@epita.fr>
20441
20442 * src/main.c (main): Don't call `done', exit does it.
20443
a0f6b076
AD
204442000-03-31 Akim Demaille <akim@epita.fr>
20445
36281465
AD
20446 * allocate.c: s/return (foo)/return foo/.
20447 * lalr.c: Likewise.
20448 * LR0.c: Likewise.
20449 * output.c: Likewise.
20450 * reader.c: Likewise.
20451 * symtab.c: Likewise.
20452 * vmsgetargs.c: Likewise.
20453
204542000-03-31 Akim Demaille <akim@epita.fr>
20455
20456 Clean up the error reporting functions.
a0f6b076
AD
20457
20458 * src/report.c: New file.
20459 * src/report.h: Likewise.
20460 * src/Makefile.am: Adjust.
20461 * m4/error.m4: New file.
20462 * m4/Makefile.am: Adjust.
20463 * configure.in (jm_PREREQ_ERROR): Call it.
20464 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
20465 Remove.
20466 (fatal, fatals): Remove. All callers use complain.c::fatal.
20467 (warn, warni, warns, warnss, warnss): Remove. All callers use
20468 complain.c::complain.
20469 (toomany): Remove, use fatal instead.
20470 * src/files.c (done): No argument, use complain_message_count.
20471 * src/main.c (main): Register `done' to `atexit'.
20472
20473 * src/getargs.c (usage): More `fputs', less `fprintf'.
20474
18539825
AD
204752000-03-28 Akim Demaille <akim@epita.fr>
20476
20477 * lib/: New directory.
20478 * Makefile.am (SUBDIRS): Adjust.
20479 * configure.in: Adjust.
20480 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
20481 useless.
20482 * src/alloca.c: Moved to lib/.
20483 * src/getopt.c: Likewise.
20484 * src/getopt1.c: Likewise.
20485 * src/getopt.h: Likewise.
20486 * src/ansi2knr.c: Likewise.
20487 * src/ansi2knr.1: Likewise.
20488 * src/Makefile.am: Adjust.
20489 * lib/Makefile.am: New file.
20490
9f306f2a
AD
204912000-03-28 Akim Demaille <akim@epita.fr>
20492
20493 * src/getargs.c (usage): Refresh the help message.
20494
0ba347b6
AD
204952000-03-17 Akim Demaille <akim@epita.fr>
20496
20497 * src/getopt1.c: Updated from textutils 2.0e
20498 * src/getopt.c: Likewise.
20499 * src/getopt.h: Likewise.
20500
dbe7f271
AD
205012000-03-17 Akim Demaille <akim@epita.fr>
20502
20503 * src/Makefile.am (bison.simple): Fix the awk program: quote only
20504 the file name, not the whole `#line LINE FILE'.
20505
75bbe78d
AD
205062000-03-17 Akim Demaille <akim@epita.fr>
20507
20508 On syntax errors, report the token on which we choked.
20509
aa5fd0ee
AD
20510 * src/bison.s1 (yyparse): In the label yyerrlab, when
20511 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 20512
7b306f52
AD
205132000-03-17 Akim Demaille <akim@epita.fr>
20514
aa5fd0ee 20515 * src/reader.c (copy_at): New function.
7b306f52
AD
20516 (copy_guard): Use it.
20517 (copy_action): Use it.
20518
e87b5700
AD
205192000-03-17 Akim Demaille <akim@epita.fr>
20520
20521 Be kind to translators, save some useless translations.
20522
aa5fd0ee 20523 * src/main.c (banner): New function.
e87b5700
AD
20524 (fatal_banner): Use it.
20525 (warn_banner): Use it.
20526
ae3c3164
AD
205272000-03-17 Akim Demaille <akim@epita.fr>
20528
aa5fd0ee
AD
20529 * src/reader.c (copy_definition): Use copy_string and
20530 copy_comment. Removed now unused `match', `ended',
20531 `cplus_comment'.
ae3c3164
AD
20532 (copy_comment, copy_string): Moved, to be visible from
20533 copy_definition.
20534
4dc58e7c
AD
205352000-03-17 Akim Demaille <akim@epita.fr>
20536
aa5fd0ee
AD
20537 * src/reader.c (copy_string): Declare `static inline'. No
20538 problems with inline, since it is checked by configure.
4dc58e7c
AD
20539 (copy_comment): Likewise.
20540
0a6384c4
AD
205412000-03-17 Akim Demaille <akim@epita.fr>
20542
aa5fd0ee 20543 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 20544
3cef001a
AD
205452000-03-17 Akim Demaille <akim@epita.fr>
20546
aa5fd0ee 20547 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
20548 (copy_action): Use it. Removed now unused `match', `ended',
20549 `cplus_comment'.
20550 (copy_guard): Likewise.
20551
ca36d2ef
AD
205522000-03-17 Akim Demaille <akim@epita.fr>
20553
aa5fd0ee 20554 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
20555 (copy_action): Use it.
20556 (copy_guard): Likewise.
20557
6666f98f
AD
205582000-03-17 Akim Demaille <akim@epita.fr>
20559
20560 Change the handling of @s so that they behave exactly like $s.
20561 There is now a pseudo variable @$ (readble and writable), location
20562 of the lhs of the rule (by default ranging from the location of
20563 the first symbol of the rhs, to the location of the last symbol,
20564 or, if the rhs is empty, YYLLOC).
20565
20566 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
20567 yyval.
20568 (yyparse): When providing a default semantic action, provide a
20569 default location action.
20570 (after the $): No longer change `*YYLSP', just stack YYLOC the
20571 same way you stack YYVAL.
20572 * src/reader.c (read_declarations): Use warns.
20573 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
20574 (copy_action, case '@'): Likewise.
20575 Use a standard error message, to save useless work from
20576 translators.
20577
41aca2e0
AD
205782000-03-17 Akim Demaille <akim@epita.fr>
20579
aa5fd0ee
AD
20580 * src/bison.s1: Formatting and cosmetics changes.
20581 * src/reader.c: Likewise.
41aca2e0
AD
20582 Update the Copyright notice.
20583
dc08c1d5
AD
205842000-03-17 Akim Demaille <akim@epita.fr>
20585
aa5fd0ee
AD
20586 * src/bison.s1 (#line): All set to `#line' only, since the
20587 Makefile now handles them.
dc08c1d5 20588
9ee3c97b
AD
205892000-03-16 Akim Demaille <akim@epita.fr>
20590
20591 * src/output.c (output_rule_data): Output the documentation of
20592 some of the tables.
20593 (Copyright notice): Update.
20594 Formatting changes.
20595
0de741ca
AD
205962000-03-16 Akim Demaille <akim@epita.fr>
20597
20598 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
20599 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
20600 One `#if YYDEBUG' remains, since it uses variables which are
20601 defined only if `YYDEBUG != 0'.
20602
bb10be54
AD
206032000-03-16 Akim Demaille <akim@epita.fr>
20604
20605 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
20606 and related variables so that the similarities are highlighted.
20607
b07b484a
AD
206082000-03-16 Akim Demaille <akim@epita.fr>
20609
20610 * src/bison.s1: Properly indent CPP directives.
20611
361f60b3
AD
206122000-03-16 Akim Demaille <akim@epita.fr>
20613
20614 * src/bison.s1: Properly indent the `alloca' CPP section.
20615
8c44d3ec
AD
206162000-03-16 Akim Demaille <akim@epita.fr>
20617
20618 Do not hard code values of directories in `configure.in'.
20619 Update the `configure' tool chain.
20620
20621 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
20622 src/makefile.am.
20623 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
20624 (AC_OUTPUT): Add m4/Makefile.
20625 Bump to bison 1.28a, 1.29 has never been released.
20626 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
20627 handled via src/Makefile.am.
20628 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
20629 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
20630 autoheader.
20631 * Makefile.am (SUBDIRS): Add m4.
20632 (ACLOCAL_AM_FLAGS): New variable.
20633 (AUTOMAKE_OPTIONS): Add check-news.
20634 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
20635 the proper line number and file name.
20636 (DEFS): Propagate the location of bison library files and of the
20637 locale files.
20638 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
20639 builddir.
20640 * acinclude.m4: Remove, replaced by the directory m4.
20641 * m4/Makefile.am (EXTRA_DIST): New variable.
20642 * m4/gettext.m4: New file, from the fileutils.
20643 * m4/lcmessage.m4: Likewise
20644 * m4/progtest.m4: Likewise.
20645 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
20646
f95997e7
AD
206472000-03-10 Akim Demaille <akim@epita.fr>
20648
20649 * src/closure.c:
20650 Formatting changes of various comments.
20651 Respect the GNU coding standards at various places.
20652 Don't use `_()' when no translation is needed.
20653
206541999-12-13 Jesse Thilo <jthilo@gnu.org>
20655
20656 * src/files.c:
20657 OS/2 honors TMPDIR environment variable.
20658
206591999-12-13 Jesse Thilo <jthilo@gnu.org>
20660
20661 * doc/bison.texinfo: Tweaked spelling and grammar.
20662 Updated ISBN.
20663 Removed reference to price of printed copy.
20664 Mention BISON_SIMPLE and BISON_HAIRY.
20665
206661999-12-13 Jesse Thilo <jthilo@gnu.org>
20667
20668 * configure.in, NEWS:
20669 Bison 1.29 released.
20670
206711999-10-27 Jesse Thilo <jthilo@gnu.org>
20672
20673 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
20674 Added reference card.
20675
206761999-07-26 Jesse Thilo <jthilo@gnu.org>
20677
20678 * po/ru.po: Added Russian translation.
20679
206801999-07-26 Jesse Thilo <jthilo@gnu.org>
20681
20682 * configure.in: Added Russian translation.
20683
206841999-07-06 Jesse Thilo <jthilo@gnu.org>
20685
20686 * configure.in, NEWS, README:
20687 Released version 1.28.
20688
206891999-06-14 Jesse Thilo <jthilo@gnu.org>
20690
20691 * src/system.h:
20692 Squashed redefinition warning on some systems.
20693
20694 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
20695 Have configure build version string instead of relying on ANSI string
20696 concatentation.
20697
206981999-06-14 Jesse Thilo <jthilo@gnu.org>
20699
20700 * po/POTFILES.in: Got rid of version.c.
20701
207021999-06-14 Jesse Thilo <jthilo@gnu.org>
20703
20704 * acconfig.h, configure.in:
20705 Have configure build version string instead of relying on ANSI string
20706 concatentation.
20707
207081999-06-08 Jesse Thilo <jthilo@gnu.org>
20709
20710 * doc/bison.1:
20711 Dropped mention of `+' for long-named options.
20712
207131999-05-30 Jesse Thilo <jthilo@gnu.org>
20714
20715 * src/files.c: Added <unistd.h> for unlink().
20716
20717 * src/Makefile.am, src/system.h:
20718 I18n fixes.
20719
207201999-05-30 Jesse Thilo <jthilo@gnu.org>
20721
20722 * README: Added a FAQ list.
20723
20724 * configure.in, acconfig.h:
20725 I18n fixes.
20726
207271999-05-30 Jesse Thilo <jthilo@gnu.org>
20728
20729 * doc/FAQ, doc/Makefile.am:
20730 Added a FAQ list.
20731
207321999-05-19 Jesse Thilo <jthilo@gnu.org>
20733
20734 * src/alloc.h, src/symtab.h, src/version.c:
20735 Protected inclusion of "config.h" with HAVE_CONFIG_H.
20736
207371999-04-18 Jesse Thilo <jthilo@gnu.org>
20738
20739 * src/.cvsignore, src/Makefile.am:
20740 Reorganized: sources in `src', documentation in `doc'.
20741
20742 * src/lex.c (literalchar):
20743 fixed the code for escaping double quotes (thanks
20744 Jonathan Czisny.)
20745
207461999-04-18 Jesse Thilo <jthilo@gnu.org>
20747
20748 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
20749 Adjusted paths to reflect directory reorganization.
20750
207511999-04-18 Jesse Thilo <jthilo@gnu.org>
20752
20753 * doc/.cvsignore, doc/Makefile.am:
20754 Reorganized: sources in `src', documentation in `doc'.
20755
207561999-04-18 Jesse Thilo <jthilo@gnu.org>
20757
20758 * configure.in:
20759 Updated AC_INIT file to reflect directory reorganization.
20760
20761 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
20762 Reorganized: sources in `src', documentation in `doc'.
20763
207641999-04-13 Jesse Thilo <jthilo@gnu.org>
20765
20766 * src/allocate.c:
20767 Don't declare calloc() and realloc() if not necessary.
20768
207691999-04-13 Jesse Thilo <jthilo@gnu.org>
20770
20771 * configure.in, acconfig.h, acinclude.m4:
20772 Don't declare calloc() and realloc() if not necessary.
20773
207741999-03-23 Jesse Thilo <jthilo@gnu.org>
20775
20776 * po/.cvsignore: Added i18n support.
20777
207781999-03-23 Jesse Thilo <jthilo@gnu.org>
20779
20780 * acconfig.h, configure.in, Makefile.am:
20781 Added i18n support.
20782
207831999-03-22 Jesse Thilo <jthilo@gnu.org>
20784
20785 * src/bison.s1: Fixed #line numbers.
20786
207871999-03-15 Jesse Thilo <jthilo@gnu.org>
20788
20789 * po/es.po, po/fr.po, po/nl.po, po/de.po:
20790 Added PO files from Translation Project.
20791
207921999-03-03 Jesse Thilo <jthilo@gnu.org>
20793
20794 * Makefile.am:
20795 Added support for non-ANSI compilers (ansi2knr).
20796
207971999-02-16 Jesse Thilo <jthilo@gnu.org>
20798
20799 * configure.in: Bumped version number to 1.27.
20800
20801 * Makefile.am:
20802 Added `bison.simple' to list of files removed by `make distclean'.
20803
208041999-02-12 Jesse Thilo <jthilo@gnu.org>
20805
20806 * src/files.c, src/files.h:
20807 Defined locations of parser files in config.h instead of Makefile.
20808
208091999-02-12 Jesse Thilo <jthilo@gnu.org>
20810
20811 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
20812 Defined locations of parser files in config.h instead of Makefile.
20813
208141999-02-09 Jesse Thilo <jthilo@gnu.org>
20815
20816 * Makefile.am:
20817 Removed inappropriate use of $< macro.
20818
208191999-02-05 Jesse Thilo <jthilo@gnu.org>
20820
20821 * po/Makefile.in.in, po/POTFILES.in:
20822 Add `po' directory skeleton.
20823
208241999-01-27 Jesse Thilo <jthilo@gnu.org>
20825
20826 * README: Document help-bison list.
20827
20828 * configure.in: Add check for mkstemp().
20829
208301999-01-20 Jesse Thilo <jthilo@gnu.org>
20831
20832 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
20833 Hush a few compiler warnings.
20834
20835 * src/files.c:
20836 Add tryclose(), which verifies that fclose was successful.
20837 Hush a couple of compiler warnings.
20838
208391999-01-20 Jesse Thilo <jthilo@gnu.org>
20840
20841 * Makefile.am, OChangeLog:
20842 ChangeLog is now automatically generated. Include the old version as
20843 OChangeLog.
20844
208451999-01-14 Jesse Thilo <jthilo@gnu.org>
20846
20847 * 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:
20848 Update FSF address.
20849
208501999-01-14 Jesse Thilo <jthilo@gnu.org>
20851
20852 * doc/bison.texinfo: Fix formatting glitch.
20853
20854 * doc/bison.texinfo: Update FSF address.
20855
208561999-01-14 Jesse Thilo <jthilo@gnu.org>
20857
20858 * acconfig.h: Update FSF address.
20859
208601999-01-08 Jesse Thilo <jthilo@gnu.org>
20861
20862 * src/system.h:
20863 Don't define PACKAGE here, since config.h defines it.
20864
208651998-12-30 Jesse Thilo <jthilo@gnu.org>
20866
20867 * src/reader.c: Update copyright date.
20868
20869 * src/main.c:
20870 Ditch sprintf to statically-sized buffers in fatal/warn functions in
20871 favor of output directly to stderr (avoids buffer overruns).
20872
20873 * src/reader.c: Some checks for premature EOF.
20874
20875 * 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:
20876 Use prototypes if the compiler understands them.
20877
20878 * src/files.c: Honor TMPDIR on Unix hosts.
20879 Use prototypes if the compiler understands them.
20880
20881 * src/reader.c:
20882 Fix a couple of buffer overrun bugs.
20883 Use prototypes if the compiler understands them.
20884
20885 * src/system.h: Include unistd.h and ctype.h.
20886 Use #ifdef instead of #if for NLS symbols.
20887
208881998-12-30 Jesse Thilo <jthilo@gnu.org>
20889
20890 * doc/bison.texinfo:
20891 Delete comment "consider using @set for edition number, etc..." since
20892 we now are doing so.
20893
208941998-12-30 Jesse Thilo <jthilo@gnu.org>
20895
20896 * configure.in:
20897 Use prototypes if the compiler understands them.
20898
20899 * NEWS: Document 1.26 highlights.
20900
20901 * Makefile.am: Require Automake 1.3 or later.
20902
20903 * acconfig.h:
20904 Use prototypes if the compiler understands them.
20905
209061998-12-29 Jesse Thilo <jthilo@gnu.org>
20907
20908 * src/version.c:
20909 Use VERSION symbol from automake for version number.
20910
209111998-12-29 Jesse Thilo <jthilo@gnu.org>
20912
20913 * acconfig.h, configure.in, version.cin:
20914 Use VERSION symbol from automake for version number.
20915
209161998-11-28 Jesse Thilo <jthilo@gnu.org>
20917
20918 * Makefile.am:
20919 Distribute original version of simple parser (bison.s1), not built
20920 version (bison.simple).
20921
209221998-11-28 Jesse Thilo <jthilo@gnu.org>
20923
20924 * doc/bison.texinfo: Add info dir entry.
20925
20926 * doc/bison.texinfo:
20927 Let automake put version number into documentation.
20928
209291998-11-26 Jesse Thilo <jthilo@gnu.org>
20930
20931 * src/bison.cld, src/build.com, src/vmshlp.mar:
20932 Add non-RCS files from /gd/gnu/bison.
20933
209341998-11-26 Jesse Thilo <jthilo@gnu.org>
20935
20936 * doc/bison.1:
20937 Document the BISON_HAIRY and BISON_SIMPLE variables.
20938
209391998-11-25 Jesse Thilo <jthilo@gnu.org>
20940
20941 * src/version.c: Build version.c automatically.
20942
20943 * src/reader.c:
20944 Fix token numbering (used to start at 258, not 257).
20945
20946 * src/system.h: Include config.h.
20947
20948 * src/getargs.c: Update bug report address.
20949
20950 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
20951 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
20952
209531998-11-25 Jesse Thilo <jthilo@gnu.org>
20954
20955 * Makefile.am:
20956 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20957
20958 * configure.in, version.cin:
20959 Build version.c automatically.
20960
20961 * AUTHORS: Add AUTHORS file.
20962
20963 * README: Update bug report address.
20964
20965 * bison.simple:
20966 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
20967
20968 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
20969 Add automake stuff.
20970
209711998-11-25 Jesse Thilo <jthilo@gnu.org>
20972
20973 * doc/bison.texinfo: Clean up some formatting.
20974
209751998-05-05 Richard Stallman <rms@gnu.org>
20976
20977 * doc/bison.texinfo:
20978 Explain better why to make a pure parser.
20979
209801998-01-05 Richard Stallman <rms@gnu.org>
20981
20982 * src/files.c (openfiles):
20983 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
20984 find a temporary directory, if possible. Do not unlink files while
20985 they are open.
20986
209871997-08-25 Richard Stallman <rms@gnu.org>
20988
20989 * src/reader.c (stack_offset;):
20990 Change some warni to warns.
20991
20992 * src/lex.c (literalchar): Use warns, not warni.
20993
209941997-06-28 Richard Stallman <rms@gnu.org>
20995
20996 * src/bison.s1: Add a Bison version comment.
20997
20998 * src/main.c (fatal, warn, berror):
20999 Use program_name.
21000
210011997-06-28 Richard Stallman <rms@gnu.org>
21002
21003 * Makefile.in (bison_version): New variable.
21004 (dist): Use that variable.
21005 (bison.s1): Substitute the Bison version into bison.simple.
21006
21007 * bison.simple: Add a Bison version comment.
21008
210091997-06-18 Richard Stallman <rms@gnu.org>
21010
21011 * src/main.c (fatal, warn, berror):
21012 Make error messages standard.
21013 (toomany): Improve error message text.
21014
21015 * 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:
21016 new.h renamed to alloc.h.
21017
210181997-06-18 Richard Stallman <rms@gnu.org>
21019
21020 * Makefile.in: new.h renamed to alloc.h.
21021
210221997-05-24 Richard Stallman <rms@gnu.org>
21023
21024 * src/lex.c (literalchar):
21025 Fix the code for escaping \, " and '.
21026
21027 (lex): Avoid trouble when there are many chars
21028 to discard in a char literal with just several chars in it.
21029
210301997-05-17 Richard Stallman <rms@gnu.org>
21031
21032 * src/bison.s1:
21033 Use malloc, if using alloca is troublesome.
21034 (YYSTACK_USE_ALLOCA): New flag macro.
21035 Define it for some systems and compilers.
21036 (YYSTACK_ALLOC): New macro.
21037 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21038 If it was malloc'd, free it.
21039
210401997-05-17 Richard Stallman <rms@gnu.org>
21041
21042 * bison.simple:
21043 Use malloc, if using alloca is troublesome.
21044 (YYSTACK_USE_ALLOCA): New flag macro.
21045 Define it for some systems and compilers.
21046 (YYSTACK_ALLOC): New macro.
21047 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21048 If it was malloc'd, free it.
21049
210501997-04-23 Richard Stallman <rms@gnu.org>
21051
21052 * src/bison.s1:
21053 (alloca) [__hpux]: Always define as __builtin_alloca.
21054
210551997-04-23 Richard Stallman <rms@gnu.org>
21056
21057 * bison.simple:
21058 (alloca) [__hpux]: Always define as __builtin_alloca.
21059
210601997-04-22 Richard Stallman <rms@gnu.org>
21061
21062 * src/bison.s1:
21063 [__hpux]: Include alloca.h (right for HPUX 10)
21064 instead of declaring alloca (right for HPUX 9).
21065
21066 * src/bison.s1 (__yy_memcpy):
21067 Declare arg `count' as unsigned int.
21068 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21069
210701997-04-22 Richard Stallman <rms@gnu.org>
21071
21072 * bison.simple:
21073 [__hpux]: Include alloca.h (right for HPUX 10)
21074 instead of declaring alloca (right for HPUX 9).
21075
21076 * bison.simple (__yy_memcpy):
21077 Declare arg `count' as unsigned int.
21078 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21079
210801997-01-03 Richard Stallman <rms@gnu.org>
21081
21082 * src/allocate.c: [__STDC__ or _MSC_VER]:
21083 Declare calloc and realloc to return void *.
21084
210851997-01-02 Richard Stallman <rms@gnu.org>
21086
21087 * src/system.h:
21088 [_MSC_VER]: Include stdlib.h and process.h.
21089 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21090
21091 * src/main.c (main): Return FAILURE as a value.
21092 (printable_version): Declare arg as int, not char.
21093
210941997-01-02 Richard Stallman <rms@gnu.org>
21095
21096 * Makefile.in (dist):
21097 Explicitly check for symlinks, and copy them.
21098
210991996-12-19 Richard Stallman <rms@gnu.org>
21100
21101 * src/files.c:
21102 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21103
211041996-12-18 Paul Eggert <eggert@gnu.org>
21105
21106 * src/bison.s1 (yyparse):
21107 If __GNUC__ and YYPARSE_PARAM are both defined,
21108 declare yyparse to have a void * argument.
21109
211101996-12-18 Paul Eggert <eggert@gnu.org>
21111
21112 * bison.simple (yyparse):
21113 If __GNUC__ and YYPARSE_PARAM are both defined,
21114 declare yyparse to have a void * argument.
21115
211161996-12-17 Richard Stallman <rms@gnu.org>
21117
21118 * src/reduce.c (nbits): Add some casts.
21119
211201996-08-12 Richard Stallman <rms@gnu.org>
21121
21122 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21123
211241996-08-12 Richard Stallman <rms@gnu.org>
21125
21126 * bison.simple: Test _MSDOS as well as _MSDOS_.
21127
211281996-07-31 Richard Stallman <rms@gnu.org>
21129
21130 * src/bison.s1:
21131 [__sun && __i386]: Include alloca.h.
21132
211331996-07-31 Richard Stallman <rms@gnu.org>
21134
21135 * bison.simple:
21136 [__sun && __i386]: Include alloca.h.
21137
211381996-07-30 Richard Stallman <rms@gnu.org>
21139
21140 * src/bison.s1: Comment change.
21141
21142 * src/bison.s1: Test _MSDOS_, not MSDOS.
21143
211441996-07-30 Richard Stallman <rms@gnu.org>
21145
21146 * bison.simple: Comment change.
21147
21148 * bison.simple: Test _MSDOS_, not MSDOS.
21149
211501996-06-01 Richard Stallman <rms@gnu.org>
21151
21152 * 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:
21153 Insert `_' macro around many string constants.
21154
21155 * src/main.c:
21156 Insert `_' macro around many string constants.
21157
21158 (main): Call setlocale, bindtextdomain and textdomain.
21159
21160 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21161 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21162 [ENABLE_NLS]: Include libintl.h.
21163 [ENABLE_NLS] (gettext): Define.
21164 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21165 (N_, PACKAGE, LOCALEDIR): New macros.
21166
211671996-06-01 Richard Stallman <rms@gnu.org>
21168
21169 * POTFILES.in: New file.
21170
21171 * Makefile.in (allocate.o):
21172 Define target explicitly.
21173
21174 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21175 (LDFLAGS): Set to @LDFLAGS@.
21176 (configure): Run autoconf only if preceding `cd' succeeds.
21177 (bison.s1): Redirect output to temporary file then move the
21178 temporary to the target, rather than redirecting directly to bison.s1.
21179 (clean): Remove config.status and config.log.
21180 (distclean): Don't remove config.status here.
21181
211821996-05-12 Richard Stallman <rms@gnu.org>
21183
21184 * src/bison.s1:
21185 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21186
211871996-05-12 Richard Stallman <rms@gnu.org>
21188
21189 * bison.simple:
21190 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21191
211921996-05-11 Richard Stallman <rms@gnu.org>
21193
21194 * src/bison.s1 (__yy_memcpy):
21195 Really reorder the args, as was supposedly done on Feb 14 1995.
21196 (yyparse): Calls changed accordingly.
21197
211981996-05-11 Richard Stallman <rms@gnu.org>
21199
21200 * Makefile.in (dist): Don't use $(srcdir).
21201
21202 * bison.simple (__yy_memcpy):
21203 Really reorder the args, as was supposedly done on Feb 14 1995.
21204 (yyparse): Calls changed accordingly.
21205
212061996-01-27 Richard Stallman <rms@gnu.org>
21207
21208 * src/output.c (output_rule_data):
21209 Test YYERROR_VERBOSE in the conditional
21210 around the definition of ttyname.
21211
212121995-12-29 Richard Stallman <rms@gnu.org>
21213
21214 * src/bison.s1:
21215 Fix line numbers in #line commands.
21216
212171995-12-29 Richard Stallman <rms@gnu.org>
21218
21219 * bison.simple:
21220 Fix line numbers in #line commands.
21221
212221995-12-27 Richard Stallman <rms@gnu.org>
21223
21224 * src/bison.s1 (YYPARSE_PARAM_DECL):
21225 In C++, make it always null.
21226 (YYPARSE_PARAM_ARG): New macro.
21227 (yyparse): Use YYPARSE_PARAM_ARG.
21228
212291995-12-27 Richard Stallman <rms@gnu.org>
21230
21231 * bison.simple (YYPARSE_PARAM_DECL):
21232 In C++, make it always null.
21233 (YYPARSE_PARAM_ARG): New macro.
21234 (yyparse): Use YYPARSE_PARAM_ARG.
21235
212361995-11-29 Richard Stallman <rms@gnu.org>
21237
21238 * doc/bison.texinfo:
21239 Describe literal string tokens, %raw, %no_lines, %token_table.
21240
212411995-11-29 Daniel Hagerty <hag@gnu.org>
21242
21243 * doc/bison.texinfo: Fixed update date
21244
212451995-10-16 Richard Stallman <rms@gnu.org>
21246
21247 * src/version.c: Version 1.25.
21248
212491995-10-16 Richard Stallman <rms@gnu.org>
21250
21251 * NEWS: *** empty log message ***
21252
212531995-10-16 Richard Stallman <rms@gnu.org>
21254
21255 * doc/bison.1, doc/bison.rnh:
21256 Add new options.
21257
212581995-10-15 Richard Stallman <rms@gnu.org>
21259
21260 * src/vmsgetargs.c, src/getargs.c:
21261 Added -n, -k, and -raw switches.
21262 (noparserflag, toknumflag, rawtoknumflag): New variables.
21263
21264 * src/symtab.h (SALIAS):
21265 New #define for adding aliases to %token.
21266 (struct bucket): Added `alias' field.
21267
21268 * src/reduce.c (reduce_grammar):
21269 Revise error message.
21270 (print_notices): Remove final `.' from error message.
21271
21272 * src/reader.c (reader_output_yylsp):
21273 New function.
21274 (readgram): Use `#if 0' around code that accepted %command
21275 inside grammar rules: The documentation doesn't allow it,
21276 and it will fail since the %command processors scan for the next %.
21277 (parse_token_decl): Extended the %token
21278 declaration to allow a multi-character symbol as an alias.
21279 (parse_thong_decl): New function.
21280 (read_declarations): Added %thong declarations.
21281 (read_declarations): Handle NOOP to deal with allowing
21282 % declarations as another means to specify the flags.
21283 (readgram): Allow %prec prior to semantics embedded in a rule.
21284 (skip_to_char, read_declarations, copy_definition)
21285 (parse_token_decl, parse_start_decl, parse_type_decl)
21286 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21287 (get_type_name, copy_guard, copy_action, readgram)
21288 (get_type, packsymbols): Revised most error messages.
21289 Changed `fatal' to `warnxxx' to avoid aborting for error.
21290 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21291 (read_declarations): Improve the error message for
21292 an invalid character. Do not abort.
21293 (read_declarations, copy_guard, copy_action): Use
21294 printable_version to avoid unprintable characters in printed output.
21295 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
21296 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
21297 Allow the type of a non-terminal can be given
21298 more than once, as long as all specifications give the same type.
21299
21300 * src/output.c:
21301 (output_headers, output_trailers, output, output_gram)
21302 (output_rule_data): Implement noparserflag variable.
21303 Implement toknumflag variable.
21304 (output): Call reader_output_yylsp to output LTYPESTR.
21305
21306 * src/main.c (main):
21307 If reader sees an error, don't process the grammar.
21308 (fatals): Updated to not use VARARGS1.
21309 (printable_version, int_to_string, warn, warni, warns, warnss)
21310 (warnsss): New error reporting functions. Avoid abort for error.
21311
21312 * src/lex.h:
21313 Added THONG and NOOP for alias processing.
21314 Added SETOPT for the new code that allows setting options with %flags.
21315
21316 * src/lex.c:
21317 Include getopt.h. Add some extern decls.
21318 (safegetc): New function to deal with EOF gracefully.
21319 (literalchar); new function to deal with reading \ escapes.
21320 (lex): Use literalchar.
21321 (lex): Implemented "..." tokens.
21322 (literalchar, lex, parse_percent_token): Made tokenbuffer
21323 always contain the token. This includes growing the token
21324 buffer while reading an integer.
21325 (parse_percent_token): Replaced if-else statement with percent_table.
21326 (parse_percent_token): Added % declarations as another
21327 way to specify the flags -n, -l, and -r. Also added hooks for
21328 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
21329 major changes to files.c.
21330 (lex) Retain in the incoming stream a character following
21331 an incorrect '/'.
21332 (skip_white_space, lex): Revised most error messages
21333 and changed fatal to warn to avoid aborting.
21334 (percent_table): Added %thong declarations.
21335
21336 * src/gram.h: Comment changes.
21337
21338 * src/files.c (openfiles, open_extra_files, done):
21339 Add faction flag
21340 and actfile file. Handle noparserflag. Both for -n switch.
21341
21342 * src/conflicts.c (resolve_sr_conflict):
21343 Remove use of alloca.
21344
213451995-06-01 Jim Meyering <meyering@gnu.org>
21346
21347 * doc/bison.texinfo: *** empty log message ***
21348
213491995-05-06 Richard Stallman <rms@gnu.org>
21350
21351 * src/bison.s1: Comment change.
21352
213531995-05-06 Richard Stallman <rms@gnu.org>
21354
21355 * bison.simple: Comment change.
21356
213571995-05-03 Richard Stallman <rms@gnu.org>
21358
21359 * src/version.c: Version now 1.24.
21360
21361 * src/bison.s1: Change distribution terms.
21362
21363 * src/version.c: Version now 1.23.
21364
213651995-05-03 Richard Stallman <rms@gnu.org>
21366
21367 * doc/bison.texinfo:
21368 Rewrite "Conditions for Using Bison".
21369 Update version to 1.24.
21370
213711995-05-03 Richard Stallman <rms@gnu.org>
21372
21373 * bison.simple: Change distribution terms.
21374
213751995-02-23 Richard Stallman <rms@gnu.org>
21376
21377 * src/files.c: Test __VMS_POSIX as well as VMS.
21378
213791995-02-14 Jim Meyering <meyering@gnu.org>
21380
21381 * src/bison.s1 (__yy_memcpy):
21382 Renamed from __yy_bcopy to avoid
21383 confusion. Reverse FROM and TO arguments to be consistent with
21384 those of memcpy.
21385
213861995-02-14 Jim Meyering <meyering@gnu.org>
21387
21388 * bison.simple (__yy_memcpy):
21389 Renamed from __yy_bcopy to avoid
21390 confusion. Reverse FROM and TO arguments to be consistent with
21391 those of memcpy.
21392
213931994-11-10 David J. MacKenzie <djm@gnu.org>
21394
21395 * NEWS: reformat
21396
21397 * NEWS: New file.
21398
21399 * Makefile.in (DISTFILES): Include NEWS.
21400
21401 * Makefile.in (DISTFILES):
21402 Include install-sh, not install.sh.
21403
21404 * configure.in: Update to Autoconf v2 macro names.
21405
214061994-10-05 David J. MacKenzie <djm@gnu.org>
21407
21408 * Makefile.in: fix typo
21409
21410 * Makefile.in (prefix, exec_prefix):
21411 Let configure set them.
21412
214131994-09-28 David J. MacKenzie <djm@gnu.org>
21414
21415 * Makefile.in: Set datadir to $(prefix)/share.
21416
214171994-09-15 Richard Stallman <rms@gnu.org>
21418
21419 * src/bison.s1:
21420 Update copyright notice and GPL version.
21421
214221994-09-15 Richard Stallman <rms@gnu.org>
21423
21424 * bison.simple:
21425 Update copyright notice and GPL version.
21426
214271994-07-12 Richard Stallman <rms@gnu.org>
21428
21429 * src/reduce.c, src/reader.c:
21430 entered into RCS
21431
214321994-05-05 David J. MacKenzie <djm@gnu.org>
21433
21434 * Makefile.in: entered into RCS
21435
214361994-03-26 Richard Stallman <rms@gnu.org>
21437
21438 * src/bison.s1: entered into RCS
21439
214401994-03-26 Richard Stallman <rms@gnu.org>
21441
21442 * bison.simple: entered into RCS
21443
214441994-03-25 Richard Stallman <rms@gnu.org>
21445
21446 * src/main.c: entered into RCS
21447
214481994-03-24 Richard Stallman <rms@gnu.org>
21449
21450 * src/conflicts.c: entered into RCS
21451
214521994-01-02 Richard Stallman <rms@gnu.org>
21453
21454 * Makefile.in: *** empty log message ***
21455
214561993-11-21 Richard Stallman <rms@gnu.org>
21457
21458 * src/bison.s1: *** empty log message ***
21459
214601993-11-21 Richard Stallman <rms@gnu.org>
21461
21462 * doc/bison.texinfo: entered into RCS
21463
21464 * doc/bison.texinfo: *** empty log message ***
21465
214661993-11-21 Richard Stallman <rms@gnu.org>
21467
21468 * bison.simple: *** empty log message ***
21469
214701993-10-25 David J. MacKenzie <djm@gnu.org>
21471
21472 * doc/bison.texinfo: *** empty log message ***
21473
214741993-10-19 Richard Stallman <rms@gnu.org>
21475
21476 * src/bison.s1: *** empty log message ***
21477
214781993-10-19 Richard Stallman <rms@gnu.org>
21479
21480 * bison.simple: *** empty log message ***
21481
214821993-10-14 Richard Stallman <rms@gnu.org>
21483
21484 * src/bison.s1: *** empty log message ***
21485
214861993-10-14 Richard Stallman <rms@gnu.org>
21487
21488 * bison.simple: *** empty log message ***
21489
214901993-09-14 David J. MacKenzie <djm@gnu.org>
21491
21492 * doc/bison.texinfo: *** empty log message ***
21493
214941993-09-13 Noah Friedman <friedman@gnu.org>
21495
21496 * Makefile.in: *** empty log message ***
21497
214981993-09-10 Richard Stallman <rms@gnu.org>
21499
21500 * src/conflicts.c: *** empty log message ***
21501
21502 * src/system.h: entered into RCS
21503
215041993-09-10 Richard Stallman <rms@gnu.org>
21505
21506 * doc/bison.1: entered into RCS
21507
215081993-09-06 Noah Friedman <friedman@gnu.org>
21509
21510 * src/version.c: entered into RCS
21511
215121993-09-06 Noah Friedman <friedman@gnu.org>
21513
21514 * Makefile.in: *** empty log message ***
21515
215161993-07-30 David J. MacKenzie <djm@gnu.org>
21517
21518 * Makefile.in: *** empty log message ***
21519
215201993-07-24 Richard Stallman <rms@gnu.org>
21521
21522 * src/bison.s1: *** empty log message ***
21523
215241993-07-24 Richard Stallman <rms@gnu.org>
21525
21526 * bison.simple: *** empty log message ***
21527
215281993-07-08 David J. MacKenzie <djm@gnu.org>
21529
21530 * Makefile.in: *** empty log message ***
21531
215321993-07-04 Richard Stallman <rms@gnu.org>
21533
21534 * src/bison.s1: *** empty log message ***
21535
215361993-07-04 Richard Stallman <rms@gnu.org>
21537
21538 * bison.simple: *** empty log message ***
21539
215401993-06-26 David J. MacKenzie <djm@gnu.org>
21541
21542 * src/getargs.c: entered into RCS
21543
215441993-06-26 David J. MacKenzie <djm@gnu.org>
21545
21546 * doc/bison.texinfo: *** empty log message ***
21547
21548 * doc/bison.1: New file.
21549
215501993-06-25 Richard Stallman <rms@gnu.org>
21551
21552 * src/getargs.c: New file.
21553
215541993-06-16 Richard Stallman <rms@gnu.org>
21555
21556 * src/bison.s1: *** empty log message ***
21557
215581993-06-16 Richard Stallman <rms@gnu.org>
21559
21560 * bison.simple: *** empty log message ***
21561
215621993-06-03 Richard Stallman <rms@gnu.org>
21563
21564 * src/bison.s1: New file.
21565
215661993-06-03 Richard Stallman <rms@gnu.org>
21567
21568 * doc/bison.texinfo: *** empty log message ***
21569
215701993-06-03 Richard Stallman <rms@gnu.org>
21571
21572 * bison.simple: New file.
21573
215741993-05-19 Richard Stallman <rms@gnu.org>
21575
21576 * doc/bison.texinfo: New file.
21577
215781993-05-07 Noah Friedman <friedman@gnu.org>
21579
21580 * Makefile.in: *** empty log message ***
21581
215821993-04-28 Noah Friedman <friedman@gnu.org>
21583
21584 * src/reader.c: *** empty log message ***
21585
215861993-04-23 Noah Friedman <friedman@gnu.org>
21587
21588 * src/alloc.h: entered into RCS
21589
215901993-04-20 David J. MacKenzie <djm@gnu.org>
21591
21592 * src/version.c: *** empty log message ***
21593
21594 * src/files.c, src/allocate.c:
21595 entered into RCS
21596
21597 * src/reader.c: *** empty log message ***
21598
21599 * src/lex.c: entered into RCS
21600
21601 * src/conflicts.c: New file.
21602
21603 * src/symtab.c: entered into RCS
21604
21605 * src/alloc.h: New file.
21606
21607 * src/LR0.c: entered into RCS
21608
216091993-04-18 Noah Friedman <friedman@gnu.org>
21610
21611 * src/reader.c: New file.
21612
21613 * src/version.c: *** empty log message ***
21614
216151993-04-18 Noah Friedman <friedman@gnu.org>
21616
21617 * Makefile.in: *** empty log message ***
21618
216191993-04-17 Noah Friedman <friedman@gnu.org>
21620
21621 * Makefile.in: *** empty log message ***
21622
216231993-04-15 Richard Stallman <rms@gnu.org>
21624
21625 * src/main.c, src/files.c:
21626 New file.
21627
216281993-04-15 Noah Friedman <friedman@gnu.org>
21629
21630 * configure.in: entered into RCS
21631
21632 * configure.in: *** empty log message ***
21633
21634 * configure.in: New file.
21635
216361993-04-14 Richard Stallman <rms@gnu.org>
21637
21638 * Makefile.in: New file.
21639
216401993-04-13 Richard Stallman <rms@gnu.org>
21641
21642 * src/version.c: New file.
21643
216441993-03-25 Richard Stallman <rms@gnu.org>
21645
21646 * src/output.c: entered into RCS
21647
216481992-09-25 Richard Stallman <rms@gnu.org>
21649
21650 * configure.bat: entered into RCS
21651
216521992-06-22 Richard Stallman <rms@gnu.org>
21653
21654 * src/vmsgetargs.c: entered into RCS
21655
216561992-06-22 Richard Stallman <rms@gnu.org>
21657
21658 * doc/bison.rnh: entered into RCS
21659
216601992-04-20 David J. MacKenzie <djm@gnu.org>
21661
21662 * README: entered into RCS
21663
216641992-01-22 Richard Stallman <rms@gnu.org>
21665
21666 * src/machine.h: entered into RCS
21667
216681991-12-21 Richard Stallman <rms@gnu.org>
21669
21670 * src/lalr.c, src/closure.c:
21671 entered into RCS
21672
216731991-12-20 Richard Stallman <rms@gnu.org>
21674
21675 * src/state.h: entered into RCS
21676
216771991-12-18 Richard Stallman <rms@gnu.org>
21678
21679 * src/print.c, src/nullable.c, src/derives.c:
21680 entered into RCS
21681
216821991-11-03 David J. MacKenzie <djm@gnu.org>
21683
21684 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
21685 entered into RCS
21686
216871988-09-09 Richard Stallman <rms@gnu.org>
21688
21689 * src/bison.hairy: entered into RCS
21690
216911987-12-16 Richard Stallman <rms@gnu.org>
21692
21693 * REFERENCES: entered into RCS
dc546b0f 21694
f294a2c2 21695
04098407 21696 -----
f294a2c2 21697
04098407 21698 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
9126263e 21699 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
95021767 21700 Free Software Foundation, Inc.
f294a2c2 21701
04098407
PE
21702 Copying and distribution of this file, with or without
21703 modification, are permitted provided the copyright notice and this
21704 notice are preserved.