]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* configure.in (WERROR_CFLAGS): Compute it.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-01-09 Akim Demaille <akim@epita.fr>
2
3 * configure.in (WERROR_CFLAGS): Compute it.
4 * src/Makefile.am (CFLAGS): Pass it.
5 * tests/atlocal.in (CFLAGS): Idem.
6 * src/files.c: Fix a few warnings.
7 (get_extension_index): Remove, unused.
8
92002-01-08 Akim Demaille <akim@epita.fr>
10
11 * src/getargs.c (AS_FILE_NAME): New.
12 (getargs): Use it to convert DOSish file names.
13 * src/files.c (base_name): Rename as full_base_name to avoid
14 clashes with `base_name ()'.
15 (filename_split): New.
16 (compute_base_names): N-th rewrite, using filename_split.
17
182002-01-08 Akim Demaille <akim@epita.fr>
19
20 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
21 New, stolen from the Fileutils 4.1.
22 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
23 * configure.in: Check for the presence of memrchr, and of its
24 prototype.
25
262002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
27
28 * lib/hash.h (__P): Added definition for this macro.
29 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
30 BUILT_SOURCES, to ensure they are generated first.
31 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
32 %error-verbose to allow bootstrapping with bison 1.30x.
33
342002-01-06 Akim Demaille <akim@epita.fr>
35
36 * src/reader.c (parse_braces): Don't fetch the next char, the
37 convention is to fetch on entry.
38 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
39 'switch' without a following semicolon.
40 * tests/regression.at (braces parsing): New.
41
422002-01-06 Akim Demaille <akim@epita.fr>
43
44 Bison is dead wrong in its RR conflict reports.
45
46 * tests/torture.at (GNU Cim Grammar): New.
47 * src/conflicts.c (count_rr_conflicts): Fix.
48
492002-01-06 Akim Demaille <akim@epita.fr>
50
51 Creating package.m4 from configure.ac causes too many problems.
52
53 * tests/Makefile.am (package.m4): Create it by hand,
54 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
55
562002-01-06 Akim Demaille <akim@epita.fr>
57
58 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
59 skeleton.h.
60
612002-01-04 Paul Eggert <eggert@twinsun.com>
62
63 * doc/bison.texinfo (Debugging):
64 Remove YYSTDERR; it's no longer defined or used.
65 Also, s/cstdio.h/cstdio/.
66
672002-01-03 Akim Demaille <akim@epita.fr>
68
69 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
70
712002-01-03 Akim Demaille <akim@epita.fr>
72
73 * src/parse-skel.y (process_skeleton): Don't bind the parser's
74 tracing code to --trace, wait for a better --trace option, with
75 args.
76
772002-01-03 Akim Demaille <akim@epita.fr>
78
79 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
80 The ISO C++ standard is extremely clear about it: stderr is
81 considered a macro, not a regular symbol (see table 94 `Header
82 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
83 Therefore std:: does not apply to it. It still does with fprintf.
84 Also, s/cstdio.h/cstdio/.
85
862002-01-03 Akim Demaille <akim@epita.fr>
87
88 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
89 for non system headers.
90
912002-01-02 Akim Demaille <akim@epita.fr>
92
93 Equip the skeleton chain with location tracking, runtime trace,
94 pure parser and scanner.
95
96 * src/parse-skel.y: Request a pure parser, locations, and prefix
97 renaming.
98 (%union): Having several members with the same type does not help
99 type mismatches, simplify.
100 (YYPRINT, yyprint): New.
101 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
102 (skel_error): this.
103 Handle locations.
104 * src/scan-skel.l: Adjust to these changes.
105 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
106 (LOCATION_PRINT, skel_control_t): New.
107
1082001-12-30 Akim Demaille <akim@epita.fr>
109
110 * src/parse-skel.y: Get rid of the shift/reduce conflict:
111 replace `gb' with BLANKS.
112 * src/scan-skel.l: Adjust.
113
1142001-12-30 Akim Demaille <akim@epita.fr>
115
116 * src/system.h: We don't need nor want bcopy.
117 Throw away MS-DOS crap: we don't need getpid.
118 * configure.in: We don't need strndup. It was even causing
119 problems: because Flex includes the headers *before* us,
120 _GNU_SOURCE is not defined by config.h, and therefore strndup was
121 not visible.
122 * lib/xstrndup.c: New.
123 * src/scan-skel.l: Use it.
124 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
125 * src/parse-skel.y: Use %directives instead of #defines.
126
1272001-12-30 Akim Demaille <akim@epita.fr>
128
129 * src/skeleton.h: New.
130 * src/output.c (output_parser, output_master_parser): Remove, dead
131 code.
132 * src/output.h (get_lines_number, actions_output, guards_output)
133 (token_definitions_output): Prototype them.
134 * src/parse-skel.y: Add the license notice.
135 Include output.h and skeleton.h.
136 (process_skeleton): Returns void, and takes a single parameter.
137 * src/scan-skel.l: Add the license notice.
138 Include skeleton.h.
139 Don't use %option yylineno: it seems that then Flex imagines
140 REJECT has been used, and therefore it won't reallocate its
141 buffers (which makes no other sense to me than a bug). It results
142 in warnings for `unused: yy_flex_realloc'.
143
1442001-12-30 Robert Anisko <robert.anisko@epita.fr>
145
146 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
147 (MUSCLE_INSERT_PREFIX): ...to there.
148 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
149 (MUSCLE_INSERT_PREFIX): Move from here...
150
151 * src/bison.hairy: Add a section directive. Put braces around muscle
152 names. This parser skeleton is still broken, but Bison should not
153 choke on a bad muscle 'syntax'.
154 * src/bison.simple: Add a section directive. Put braces around muscle
155 names.
156
157 * src/files.h (strsuffix, stringappend): Add declarations.
158 (tab_extension): Add declaration.
159 (short_base_name): Add declaration.
160
161 * src/files.c (strsuffix, stringappend): No longer static. These
162 functions are used in the skeleton parser.
163 (tab_extension): New.
164 (compute_base_names): Use the computations done in this function
165 to guess if the generated parsers should have '.tab' in their
166 names.
167 (short_base_name): No longer static.
168
169 * src/output.c (output_skeleton): New.
170 (output): Disable call to output_master_parser, and give a try to
171 a new skeleton handling system.
172 (guards_output, actions_output): No longer static.
173 (token_definitions_output, get_lines_number): No longer static.
174
175 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
176
177 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
178 parse-skel.y.
179
180 * src/parse-skel.y: New file.
181 * src/scan-skel.l: New file.
182
1832001-12-29 Akim Demaille <akim@epita.fr>
184
185 %name-prefix is broken.
186
187 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
188 Adjust all dependencies.
189 * tests/headers.at (export YYLTYPE): Strengthen this test: use
190 %name-prefix.
191
192 Renaming yylval but not yylloc is not consistent. Now we do.
193
194 * src/bison.simple: Prefix yylloc if used.
195 * doc/bison.texinfo (Decl Summary): Document that.
196
1972001-12-29 Akim Demaille <akim@epita.fr>
198
199 * doc/bison.texinfo: Promote `%long-directive' over
200 `%long_directive'.
201 Remove all references to fixed-output-files, yacc is enough.
202
2032001-12-29 Akim Demaille <akim@epita.fr>
204
205 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
206 user prologue. These are defaults.
207 * tests/actions.at (Mid-rule actions): Make sure the user can
208 define YYDEBUG and YYERROR_VERBOSE.
209
2102001-12-29 Akim Demaille <akim@epita.fr>
211
212 * src/output.c (header_output): Don't forget to export YYLTYPE and
213 yylloc.
214 * tests/headers.at (export YYLTYPE): New, make sure it does.
215 * tests/regression.at (%union and --defines, Invalid CPP headers):
216 Move to...
217 * tests/headers.at: here.
218
2192001-12-29 Akim Demaille <akim@epita.fr>
220
221 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
222
2232001-12-29 Akim Demaille <akim@epita.fr>
224
225 * tests/actions.at (Mid-rule actions): Output on a single line
226 instead of several.
227
2282001-12-29 Akim Demaille <akim@epita.fr>
229
230 * doc/bison.texinfo: Formatting changes.
231
2322001-12-29 Akim Demaille <akim@epita.fr>
233
234 Don't store the token defs in a muscle, just be ready to output it
235 on command. Now possible via `symbols'. Fixes a memory leak.
236
237 * src/output.c (token_definitions_output): New.
238 (output_parser, header_output): Use it.
239 * src/reader.c (symbols_save): Remove.
240
2412001-12-29 Akim Demaille <akim@epita.fr>
242
243 * src/bison.simple: Do not provide a default for YYSTYPE and
244 YYLTYPE before the user's prologue. Otherwise it's hardly... a
245 default.
246
2472001-12-29 Akim Demaille <akim@epita.fr>
248
249 Mid-rule actions are simply... ignored!
250
251 * src/reader.c (readgram): Be sure to attach mid-rule actions to
252 the empty-rule associated to the dummy symbol, not to the host
253 rule.
254 * tests/actions.at (Mid-rule actions): New.
255
2562001-12-29 Akim Demaille <akim@epita.fr>
257
258 Memory leak.
259
260 * src/reader.c (reader): Free grammar.
261
2622001-12-29 Akim Demaille <akim@epita.fr>
263
264 Memory leak.
265
266 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
267 since it allocates it for each state, although only one is needed.
268 (allocate_storage): Do it here.
269
2702001-12-29 Akim Demaille <akim@epita.fr>
271
272 * src/options.h, src/options.c (create_long_option_table): Rename
273 as...
274 (long_option_table_new): this, with a clearer prototype.
275 (percent_table): Remove, unused,
276 * src/getargs.c (getargs): Adjust.
277
2782001-12-29 Akim Demaille <akim@epita.fr>
279
280 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
281 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
282 as states.
283
2842001-12-29 Akim Demaille <akim@epita.fr>
285
286 * src/lalr.c (build_relations): Rename `states' as `states1'.
287 Sorry, I don't understand exactly what it is, no better name...
288
2892001-12-29 Akim Demaille <akim@epita.fr>
290
291 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
292 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
293 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
294 as rules.
295
2962001-12-29 Akim Demaille <akim@epita.fr>
297
298 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
299 ago.
300
3012001-12-29 Akim Demaille <akim@epita.fr>
302
303 * src/reader.c, src/reader.h (user_toknums): Remove.
304 Adjust all users to use symbols[i]->user_token_number.
305
3062001-12-29 Akim Demaille <akim@epita.fr>
307
308 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
309 Adjust all users to use symbols[i]->prec or ->assoc.
310
3112001-12-29 Akim Demaille <akim@epita.fr>
312
313 * src/reader.c, src/reader.h (tags): Remove.
314 Adjust all users to use symbols[i]->tag.
315
3162001-12-29 Akim Demaille <akim@epita.fr>
317
318 * src/gram.h, src/gram.c (symbols): New, similar to state_table
319 and rule_table.
320 * src/reader.c (packsymbols): Fill this table.
321 Drop sprec.
322 * src/conflicts.c (resolve_sr_conflict): Adjust.
323 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
324 single table.
325 Use symbols[i]->tag instead of tags[i].
326
3272001-12-29 Akim Demaille <akim@epita.fr>
328
329 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
330 In addition, put a comment in there, to replace...
331 * tests/regression.at (%union and C comments): Remove.
332
3332001-12-29 Akim Demaille <akim@epita.fr>
334
335 * tests/regression.at (Web2c Actions): Blindly move the actual
336 output as expected output. The contents *seem* right to me, but I
337 can't pretend reading perfectly parser tables... Nonetheless, all
338 the other tests pass correctly, the table look OK, even though the
339 presence of `$axiom' is to be noted: AFAICS it is useless (but
340 harmless).
341
3422001-12-29 Akim Demaille <akim@epita.fr>
343
344 * src/reader.c (readgram): Don't add the rule 0 if there were no
345 rules read. In other words, add it _after_ having performed
346 grammar sanity checks.
347 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
348
3492001-12-29 Akim Demaille <akim@epita.fr>
350
351 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
352 visible, and some states have now a different number.
353
3542001-12-29 Akim Demaille <akim@epita.fr>
355
356 * src/reader.c (readgram): Bind the initial rule's lineno to that
357 of the first rule.
358 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
359 (Solved SR Conflicts): Adjust rule 0's line number.
360
3612001-12-29 Akim Demaille <akim@epita.fr>
362
363 Fix the `GAWK Grammar' failure.
364
365 * src/LR0.c (final_state): Initialize to -1 so that we do compute
366 the reductions of the first state which was mistakenly confused
367 with the final state because precisely final_state was initialized
368 to 0.
369 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
370 now noticed by Bison.
371 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
372 have a reduction on $default.
373
3742001-12-29 Akim Demaille <akim@epita.fr>
375
376 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
377 rule line numbers.
378 * src/closure.c (print_closure): Likewise.
379 * src/derives.c (print_derives): Likewise.
380 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
381 now.
382
3832001-12-29 Akim Demaille <akim@epita.fr>
384
385 * src/lalr.c (lookaheads_print): New.
386 (lalr): Call it when --trace-flag.
387 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
388 are dumped.
389
3902001-12-29 Akim Demaille <akim@epita.fr>
391
392 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
393 when walking through ritem, even via rule->rhs.
394 * src/reduce.c (dump_grammar, useful_production, reduce_output)
395 (useful_production, useless_nonterminals): Likewise.
396 (reduce_grammar_tables): Likewise, plus update nritems.
397 * src/nullable.c (set_nullable): Likewise.
398 * src/lalr.c (build_relations): Likewise.
399 * tests/sets.at (Nullable): Adjust.
400 Fortunately, now, the $axiom is no longer nullable.
401
4022001-12-29 Akim Demaille <akim@epita.fr>
403
404 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
405 the 0-sentinel.
406 * src/gram.c (ritem_longest_rhs): Likewise.
407 * src/reduce.c (nonterminals_reduce): Likewise.
408 * src/print_graph.c (print_graph): Likewise.
409 * src/output.c (output_rule_data): Likewise.
410 * src/nullable.c (set_nullable): Likewise.
411
4122001-12-29 Akim Demaille <akim@epita.fr>
413
414 * src/output.c: Comment changes.
415
4162001-12-27 Paul Eggert <eggert@twinsun.com>
417
418 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
419 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
420 Sparc, as they were causing more porting problems than the
421 (minor) performance improvement was worth.
422
423 Also, catch up with 1.31's YYSTD.
424
4252001-12-27 Akim Demaille <akim@epita.fr>
426
427 * src/output.c (output_gram): Rely on nritems, not the
428 0-sentinel. See below.
429 Use -1 as separator, not 0.
430 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
431 Rely on -1 as separator in yyrhs, instead of 0.
432 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
433 twice `Now at end of input', therefore there are two lines less to
434 expect.
435
4362001-12-27 Akim Demaille <akim@epita.fr>
437
438 * tests/regression.at (Unresolved SR Conflicts):
439 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
440 below.
441
4422001-12-27 Akim Demaille <akim@epita.fr>
443
444 * src/LR0.c (new_state): Recognize the final state by the fact it
445 is reached by eoftoken.
446 (insert_start_shifting_state, insert_eof_shifting_state)
447 (insert_accepting_state, augment_automaton): Remove, since now
448 these states are automatically computed from the initial state.
449 (generate_states): Adjust.
450 * src/print.c: When reporting a rule number to the user, substract
451 1, so that the axiom rule is rule 0, and the first user rule is 1.
452 * src/reduce.c: Likewise.
453 * src/print_graph.c (print_core): For the time being, just as for
454 the report, depend upon --trace-flags to dump the full set of
455 items.
456 * src/reader.c (readgram): Once the grammar read, insert the rule
457 0: `$axiom: START-SYMBOL $'.
458 * tests/set.at: Adjust: rule 0 is now displayed, and since the
459 number of the states has changed (the final state is no longer
460 necessarily the last), catch up.
461
4622001-12-27 Akim Demaille <akim@epita.fr>
463
464 Try to make the use of the eoftoken valid. Given that its value
465 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
466 is used instead of > 0 where appropriate, (ii), depend upon nritems
467 instead of the 0-sentinel.
468
469 * src/gram.h, src/gram.c (nritems): New.
470 Expected to be duplication of nitems, but for the time being...
471 * src/reader.c (packgram): Assert nritems and nitems are equal.
472 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
473 * src/closure.c (print_closure, print_fderives): Likewise.
474 * src/gram.c (ritem_print): Likewise.
475 * src/print.c (print_core, print_grammar): Likewise.
476 * src/print_graph.c: Likewise.
477
4782001-12-27 Akim Demaille <akim@epita.fr>
479
480 * src/main.c (main): If there are complains after grammar
481 reductions, then output the report anyway if requested, then die.
482 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
483 * src/reader.c (eoftoken): New.
484 (parse_token_decl): If the token being defined has value `0', it
485 is the eoftoken.
486 (packsymbols): No longer hack `tags' to insert `$' by hand.
487 Be sure to preserve the value of the eoftoken.
488 (reader): Make sure eoftoken is defined.
489 Initialize nsyms to 0: now eoftoken is created just like the others.
490 * src/print.c (print_grammar): Don't special case the eof token.
491 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
492 lie anyway, albeit pleasant.
493 * tests/calc.at: Exercise error messages with eoftoken.
494 Change the grammar so that empty input is invalid.
495 Adjust expectations.
496 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
497
4982001-12-27 Akim Demaille <akim@epita.fr>
499
500 * configure.in: Check the protos of strchr ans strspn.
501 Replace strchr if needed.
502 * src/system.h: Provide the protos of strchr, strspn and memchr if
503 missing.
504 * lib/strchr.c: New.
505 * src/reader.c (symbols_save): Use strchr.
506
5072001-12-27 Akim Demaille <akim@epita.fr>
508
509 * src/print.c, src/print_graph.c (escape): New.
510 Use it to quote the TAGS outputs.
511 * src/print_graph.c (print_state): Now errors are in red, and
512 reductions in green.
513 Prefer high to wide: output the state number on a line of its own.
514
5152001-12-27 Akim Demaille <akim@epita.fr>
516
517 * src/state.h, src/state.c (reductions_new): New.
518 * src/LR0.c (set_state_table): Let all the states have a
519 `reductions', even if reduced to 0.
520 (save_reductions): Adjust.
521 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
522 * src/print.c (print_reductions, print_actions): Adjust.
523 * src/output.c (action_row): Adjust.
524
5252001-12-27 Akim Demaille <akim@epita.fr>
526
527 * src/state.h, src/state.c (errs_new, errs_dup): New.
528 * src/LR0.c (set_state_table): Let all the states have an errs,
529 even if reduced to 0.
530 * src/print.c (print_errs, print_reductions): Adjust.
531 * src/output.c (output_actions, action_row): Adjust.
532 * src/conflicts.c (resolve_sr_conflict): Adjust.
533
5342001-12-27 Akim Demaille <akim@epita.fr>
535
536 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
537
5382001-12-27 Akim Demaille <akim@epita.fr>
539
540 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
541 * src/print.c: here.
542 (lookaheadset, shiftset): New, used as additional storage by
543 print_reductions.
544 (print_results): Adjust.
545 (print_shifts, print_gotos, print_errs): New, extracted from...
546 (print_actions): here.
547 * src/print_graph.c (print_actions): Remove dead code.
548
5492001-12-27 Akim Demaille <akim@epita.fr>
550
551 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
552 `$n' and `@n'.
553
5542001-12-27 Akim Demaille <akim@epita.fr>
555
556 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
557 (build_relations): Adjust.
558
5592001-12-27 Akim Demaille <akim@epita.fr>
560
561 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
562 duplication.
563
5642001-12-27 Akim Demaille <akim@epita.fr>
565
566 * src/reader.c (packgram): Catch nitems overflows.
567
5682001-12-27 Akim Demaille <akim@epita.fr>
569
570 * src/files.c, src/files.h (guard_obstack): Remove.
571 * src/output.c (output): Adjust.
572 * src/reader.c (parse_braces): New, factoring...
573 (copy_action, copy_guard): these two which are renamed as...
574 (parse_action, parse_guard): these.
575 As a voluntary consequence, using braces around guards is now
576 mandatory.
577
5782001-12-27 Akim Demaille <akim@epita.fr>
579
580 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
581 * src/reader.c (symbol_list): `guard' and `guard_line' are new
582 members.
583 (symbol_list_new): Adjust.
584 (copy_action): action_line is the first line, not the last.
585 (copy_guard): Just as for actions, store the `action' only, not
586 the switch/case/break flesh.
587 Don't parse the user action that might follow the guard, let...
588 (readgram): do it, i.e., now, there can be an action after a
589 guard.
590 In other words the guard is just explicitly optional.
591 (packgram): Adjust.
592 * src/output.c (guards_output): New.
593 (output_parser): Call it when needed.
594 (output): Also free the guard and attrs obstacks.
595 * src/files.c, src/files.h (obstack_save): Remove.
596 (output_files): Remove.
597 As a result, if one needs the former `.act' file, using an
598 appropriate skeleton which requires actions and guards is now
599 required.
600 * src/main.c (main): Adjust.
601 * tests/semantic.at: New.
602 * tests/regression.at: Use `input.y' as input file name.
603 Avoid 8+3 problems by requiring input.c when the test needs the
604 parser.
605
6062001-12-27 Akim Demaille <akim@epita.fr>
607
608 * src/reader.c (symbol_list_new): Be sure to initialize all the
609 fields.
610
6112001-12-27 Akim Demaille <akim@epita.fr>
612
613 All the hacks using a final pseudo state are now useless.
614
615 * src/LR0.c (set_state_table): state_table holds exactly nstates.
616 * src/lalr.c (nLA): New.
617 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
618 instead of lookaheadsp from the pseudo state (nstate + 1).
619
6202001-12-27 Akim Demaille <akim@epita.fr>
621
622 * src/output.c (action_row, token_actions): Use a state_t instead
623 of a integer, and nlookaheads instead of the following state's
624 lookaheadsp.
625
6262001-12-27 Akim Demaille <akim@epita.fr>
627
628 * src/conflicts.c (log_resolution, flush_shift)
629 (resolve_sr_conflict, set_conflicts, solve_conflicts)
630 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
631 (conflicts_print, print_reductions): Use a state_t instead of an
632 integer when referring to a state.
633 As much as possible, depend upon nlookaheads, instead of the
634 `lookaheadsp' member of the following state (since lookaheads of
635 successive states are successive, the difference between state n + 1
636 and n served as the number of lookaheads for state n).
637 * src/lalr.c (add_lookback_edge): Likewise.
638 * src/print.c (print_core, print_actions, print_state)
639 (print_results): Likewise.
640 * src/print_graph.c (print_core, print_actions, print_state)
641 (print_graph): Likewise.
642 * src/conflicts.h: Adjust.
643
6442001-12-27 Akim Demaille <akim@epita.fr>
645
646 * src/bison.hairy: Formatting/comment changes.
647 ANSIfy.
648 Remove `register' indications.
649 Add plenty of `static'.
650
6512001-12-27 Akim Demaille <akim@epita.fr>
652
653 * src/output.c (prepare): Drop the muscle `ntbase' which
654 duplicates ntokens.
655 * src/bison.simple: Formatting/comment changes.
656 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
657 is an undocumented synonym.
658
6592001-12-22 Akim Demaille <akim@epita.fr>
660
661 * src/output.c (output_table_data): Change the prototype to use
662 `int' for array ranges: some invocations do pass an int, not a
663 short.
664 Reported by Wayne Green.
665
6662001-12-22 Akim Demaille <akim@epita.fr>
667
668 Some actions of web2c.y are improperly triggered.
669 Reported by Mike Castle.
670
671 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
672 * tests/regression.at (Web2c): Rename as...
673 (Web2c Report): this.
674 (Web2c Actions): New.
675
6762001-12-22 Akim Demaille <akim@epita.fr>
677
678 Reductions in web2c.y are improperly reported.
679 Reported by Mike Castle.
680
681 * src/conflicts.c (print_reductions): Fix.
682 * tests/regression.at (Web2c): New.
683
6842001-12-18 Akim Demaille <akim@epita.fr>
685
686 Some host fail on `assert (!"foo")', which expands to
687 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
688 Reported by Nelson Beebee.
689
690 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
691 `#define it_succeeded 0' and `assert (it_succeeded)'.
692
6932001-12-17 Marc Autret <autret_m@epita.fr>
694
695 * src/bison.simple: Don't hard code the skeleton line and filename.
696 * src/output.c (output_parser): Rename 'line' as 'output_line'.
697 New line counter 'skeleton_line' (skeleton-line muscle).
698
6992001-12-17 Paul Eggert <eggert@twinsun.com>
700
701 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
702 YYDEBUG must be defined to a nonzero value.
703
704 * src/bison.simple (yytname): Do not assume that the user defines
705 YYDEBUG to a properly parenthesized expression.
706
7072001-12-17 Akim Demaille <akim@epita.fr>
708
709 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
710 nlookaheads is a new member.
711 Adjust all users.
712 * src/lalr.h (nlookaheads): Remove this orphan declaration.
713 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
714 state.
715
7162001-12-17 Akim Demaille <akim@epita.fr>
717
718 * src/files.h, src/files.c (open_files, close_files): Remove.
719 * src/main.c (main): Don't open/close files, nor invoke lex_free,
720 let...
721 * src/reader.c (reader): Do it.
722
7232001-12-17 Akim Demaille <akim@epita.fr>
724
725 * src/conflicts.c (print_reductions): Formatting changes.
726
7272001-12-17 Akim Demaille <akim@epita.fr>
728
729 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
730 (flush_reduce): New.
731 (resolve_sr_conflict): Adjust.
732
7332001-12-17 Akim Demaille <akim@epita.fr>
734
735 * src/output.c (output_obstack): Be static and rename as...
736 (format_obstack): this, to avoid any confusion with files.c's
737 output_obstack.
738 * src/reader.h (muscle_obstack): Move to...
739 * src/output.h: here, since it's defined in output.c.
740
7412001-12-17 Akim Demaille <akim@epita.fr>
742
743 * src/output.c (action_row, save_column, default_goto)
744 (sort_actions, matching_state, pack_vector): Better variable
745 locality.
746
7472001-12-17 Akim Demaille <akim@epita.fr>
748
749 * src/output.c: Various formatting changes.
750
7512001-12-17 Akim Demaille <akim@epita.fr>
752
753 * src/files.c (output_files): Free the output_obstack.
754 * src/main.c (main): Call print and print_graph conditionally.
755 * src/print.c (print): Work unconditionally.
756 * src/print_graph.c (print_graph): Work unconditionally.
757 * src/conflicts.c (log_resolution): Output only if verbose_flag.
758
7592001-12-16 Marc Autret <autret_m@epita.fr>
760
761 * src/output.c (actions_output): Fix. When we use %no-lines,
762 there is one less line per action.
763
7642001-12-16 Marc Autret <autret_m@epita.fr>
765
766 * src/bison.simple: Remove a useless #line directive.
767 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
768 * src/output.c (get_lines_number): New.
769 (output_parser): Adjust, now takes care about the lines of a
770 output muscles.
771 Fix line numbering.
772 (actions_output): Computes the number of lines taken by actions.
773 (output_master_parser): Insert new skeleton which is the name of
774 the output parser file name.
775
7762001-12-15 Marc Autret <autret_m@epita.fr>
777
778 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
779
7802001-12-15 Marc Autret <autret_m@epita.fr>
781
782 * src/output.c (output_gram): Keep track of the hairy one.
783
7842001-12-15 Akim Demaille <akim@epita.fr>
785
786 Make `make distcheck' work.
787
788 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
789 system.h which uses libgettext.h.
790
7912001-12-15 Akim Demaille <akim@epita.fr>
792
793 * src/nullable.c (set_nullable): Useless rules must be skipped,
794 otherwise, since we range over their symbols, we might look at a
795 nonterminal which no longer ``exists'', i.e., it is not counted in
796 `nvars', hence we overflow our arrays.
797
7982001-12-15 Akim Demaille <akim@epita.fr>
799
800 The header can also be produced directly, without any obstack!
801 Yahoo!
802
803 * src/files.c, src/files.h (defines_obstack): Remove.
804 (compute_header_macro): Global.
805 (defines_obstack_save): Remove.
806 * src/reader.c (parse_union_decl): No longer output to
807 defines_obstack: its content can be found in the `stype' muscle
808 anyway.
809 (output_token_translations): Merge into...
810 (symbols_output): this.
811 Rename as...
812 (symbols_save): this.
813 (reader): Adjust.
814 * src/output.c (header_output): New.
815 (output): Call it.
816
8172001-12-15 Akim Demaille <akim@epita.fr>
818
819 * src/reader.c (parse_union_decl): Instead of handling two obstack
820 simultaneously, use one to define the `stype' muscle, and use the
821 value of the latter to fill defines_obstack.
822 (copy_comment): Remove.
823 (copy_comment2): Work for a single obstack.
824 Rename as...
825 (copy_comment): this.
826
8272001-12-15 Akim Demaille <akim@epita.fr>
828
829 * src/lex.c, src/lex.h (xgetc): No longer static.
830 * src/reader.c (parse_union_decl): Revamp.
831
8322001-12-15 Akim Demaille <akim@epita.fr>
833
834 Still making progress in separating Bison into (i) input, (ii)
835 process, (iii) output: now we can directly output the parser file
836 without using table_obstack at all.
837
838 * src/files.c, src/files.h (table_obstack): Bye bye.
839 (parser_file_name): New.
840 * src/files.c (compute_output_file_names): Compute it.
841 * src/output.c (actions_output, output_parser)
842 (output_master_parser): To a file instead of an obstack.
843
8442001-12-15 Akim Demaille <akim@epita.fr>
845
846 Attach actions to rules, instead of pre-outputting them to
847 actions_obstack.
848
849 * src/gram.h (rule_t): action and action_line are new members.
850 * src/reader.c (symbol_list): Likewise.
851 (copy_action): Save the actions within the rule.
852 (packgram): Save them in rule_table.
853 * src/output.c (actions_output): New.
854 (output_parser): Use it on `%%actions'.
855 (output_rule_data): Don't free rule_table.
856 (output): Do it.
857 (prepare): Don't save the `action' muscle.
858 * src/bison.simple: s/%%action/%%actions/.
859
8602001-12-15 Akim Demaille <akim@epita.fr>
861
862 * src/reader.c (copy_action): When --yacc, don't append a `;'
863 to the user action: let it fail if lacking.
864 Suggested by Arnold Robbins and Tom Tromey.
865
8662001-12-14 Akim Demaille <akim@epita.fr>
867
868 * src/lex.c (literalchar): Simply return the char you decoded, non
869 longer mess around with obstacks and int pointers.
870 Adjust all callers.
871
8722001-12-14 Akim Demaille <akim@epita.fr>
873
874 * src/lex.c (literalchar): Don't escape the special characters,
875 just decode them, and keep them as char (before, eol was output as
876 the 2 char string `\n' etc.).
877 * src/output.c (output_rule_data): Use quotearg to output the
878 token strings.
879
8802001-12-13 Paul Eggert <eggert@twinsun.com>
881
882 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
883 Do not infringe on the global user namespace when using C++.
884 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
885 All uses of `fprintf' and `stderr' changed.
886
887 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
888
8892001-12-13 Akim Demaille <akim@epita.fr>
890
891 The computation of nullable is broken: it doesn't handle empty
892 RHS's properly.
893
894 * tests/torture.at (GNU AWK Grammar): New.
895 * tests/sets.at (Nullable): New.
896 * src/nullable.c (set_nullable): Instead of blindly looping over
897 `ritems', loop over the rules, and then over their rhs's.
898
899 Work around Autotest bugs.
900
901 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
902 frame, because Autotest understand lines starting with a `+' as
903 traces from the shell. Then, they are not processed properly.
904 Admittedly an Autotest bug, but we don't have time to wait for
905 Autotest to catch up.
906 * tests/regression.at (Broken Closure): Adjust to the new table
907 frames.
908 Move to...
909 * tests/sets.at: here.
910
9112001-12-13 Akim Demaille <akim@epita.fr>
912
913 * src/closure.c (closure): Use nrules instead of playing tricks
914 with BITS_PER_WORD.
915
9162001-12-13 Akim Demaille <akim@epita.fr>
917
918 * src/print.c (print_actions): Output the handling of `$' as the
919 traces do: shifting the token EOF. Before EOF was treated as a
920 nonterminal.
921 * tests/regression.at: Adjust some tests.
922 * src/print_graph.c (print_core): Complete the set of items via
923 closure. The next-to-final and final states are still unsatisfying,
924 but that's to be addressed elsewhere.
925 No longer output the rule numbers, but do output the state number.
926 A single loop for the shifts + gotos is enough, but picked a
927 distinct color for each.
928 (print_graph): Initialize and finalize closure.
929
9302001-12-13 Akim Demaille <akim@epita.fr>
931
932 * src/reader.c (readgram): Remove dead code, an strip useless
933 braces.
934 (get_type): Remove, unused.
935
9362001-12-12 Akim Demaille <akim@epita.fr>
937
938 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
939 on that of lib/error.c.
940
9412001-12-12 Akim Demaille <akim@epita.fr>
942
943 Some hosts don't like `/' in includes.
944
945 * src/system.h: Include libgettext.h without qualifying the path.
946 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
947 $(top_srcdir).
948
9492001-12-11 Marc Autret <autret_m@epita.fr>
950
951 * src/output.c (output_parser): Remove useless muscle.
952
9532001-12-11 Marc Autret <autret_m@epita.fr>
954
955 * src/bison.simple: Remove #line just before %%epilogue. It
956 is now handled in ...
957 * src/reader.c (read_additionnal_code): Add the output of a
958 #line for the epilogue.
959
9602001-12-10 Marc Autret <autret_m@epita.fr>
961
962 * src/reader.c (copy_definition): Re-use CPP-outed code which
963 replace precedent remove.
964 * src/bison.simple: Remove #line before %%prologue because
965 %%input-line is wrong at this time.
966
9672001-12-10 Marc Autret <autret_m@epita.fr>
968
969 * src/reader.c (symbols_output): Clean up.
970 * src/output.c (output_gram, output): Clean up.
971
9722001-12-10 Akim Demaille <akim@epita.fr>
973
974 * src/lalr.c (initialize_lookaheads): New. Extracted from...
975 * src/LR0.c (set_state_table): here.
976 * src/lalr.c (lalr): Call it.
977
9782001-12-10 Akim Demaille <akim@epita.fr>
979
980 * src/state.h (shifts): Remove the `number' member: shifts are
981 attached to state, hence no longer need to be labelled with a
982 state number.
983
9842001-12-10 Akim Demaille <akim@epita.fr>
985
986 Now that states have a complete set of members, the linked list of
987 shifts is useless: just fill directly the state's shifts member.
988
989 * src/state.h (shifts): Remove the `next' member.
990 * src/LR0.c (first_state, last_state): Remove.
991 Adjust the callers.
992 (augment_automaton): Don't look for the shifts that must be added
993 a shift on EOF: it is those of the state we looked for! But now,
994 since shifts are attached, it is no longer needed to looking
995 merely by its id: its number.
996
9972001-12-10 Akim Demaille <akim@epita.fr>
998
999 * src/LR0.c (augment_automaton): Better variable locality.
1000 Remove an impossible branch: if there is a state corresponding to
1001 the start symbol being shifted, then there is shift for the start
1002 symbol from the initial state.
1003
10042001-12-10 Akim Demaille <akim@epita.fr>
1005
1006 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1007 only when appropriate: when insert_start_shifting_state' is not
1008 invoked.
1009 * tests/regression.at (Rule Line Numbers): Adjust.
1010
10112001-12-10 Akim Demaille <akim@epita.fr>
1012
1013 * src/LR0.c (augment_automaton): Now that all states have shifts,
1014 merge the two cases addition shifts to the initial state.
1015
10162001-12-10 Akim Demaille <akim@epita.fr>
1017
1018 * src/lalr.c (set_state_table): Move to...
1019 * src/LR0.c: here.
1020 * src/lalr.c (lalr): Don't call it...
1021 * src/LR0.c (generate_states): do it.
1022 * src/LR0.h (first_state): Remove, only the table is used.
1023
10242001-12-10 Akim Demaille <akim@epita.fr>
1025
1026 * src/LR0.h (first_shift, first_reduction): Remove.
1027 * src/lalr.c: Don't use first_shift: find shifts through the
1028 states.
1029
10302001-12-10 Akim Demaille <akim@epita.fr>
1031
1032 * src/LR0.c: Attach shifts to states as soon as they are
1033 computed.
1034 * src/lalr.c (set_state_table): Instead of assigning shifts to
1035 state, just assert that the mapping was properly done.
1036
10372001-12-10 Akim Demaille <akim@epita.fr>
1038
1039 * src/LR0.c (insert_start_shift): Rename as...
1040 (insert_start_shifting_state): this.
1041 (insert_eof_shifting_state, insert_accepting_state): New.
1042 (augment_automaton): Adjust.
1043 Better locality of the variables.
1044 When looking if the start_symbol is shifted from the initial
1045 state, using `while (... symbol != start_symbol ...)' sounds
1046 better than `while (... symbol < start_symbol ...)': If fail
1047 to see how the order between symbols could be relevant!
1048
10492001-12-10 Akim Demaille <akim@epita.fr>
1050
1051 * src/getargs.h: Don't declare `spec_name_prefix' and
1052 `spec_file_prefix', declared by src/files.h.
1053 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1054 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1055 * src/output.c (prepare): Adjust.
1056 * src/reader.c (symbols_output): Likewise.
1057 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1058
10592001-12-10 Akim Demaille <akim@epita.fr>
1060
1061 * src/muscle_tab.c (muscle_init): NULL is a better default than
1062 `"0"'.
1063
10642001-12-10 Akim Demaille <akim@epita.fr>
1065
1066 * src/reader.c (reader): Calling symbols_output once is enough.
1067
10682001-12-10 Akim Demaille <akim@epita.fr>
1069
1070 Now that states have a complete set of members, the linked list of
1071 reductions is useless: just fill directly the state's reductions
1072 member.
1073
1074 * src/state.h (struct reductions): Remove member `number' and
1075 `next'.
1076 * src/LR0.c (first_reduction, last_reduction): Remove.
1077 (save_reductions): Don't link the new reductions, store them in
1078 this_state.
1079 * src/lalr.c (set_state_table): No need to attach reductions to
1080 states, it's already done.
1081 * src/output.c (output_actions): No longer free the shifts, then
1082 the reductions, then the states: free all the states and their
1083 members.
1084
10852001-12-10 Akim Demaille <akim@epita.fr>
1086
1087 * src/options.c (OPTN, DRTV, BOTH): New.
1088 (option_table): Use them.
1089
1090 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1091 the job of system.h.
1092 * src/options.c: Don't include stdio.h and xalloc.h for the same
1093 reasons.
1094
10952001-12-10 Akim Demaille <akim@epita.fr>
1096
1097 * src/output.c (output, prepare): Make sure the values of the
1098 muscles `action' and `prologue' are 0-terminated.
1099
11002001-12-10 Akim Demaille <akim@epita.fr>
1101
1102 Clean up GCC warnings.
1103
1104 * src/reader.c (copy_action): `buf' is not used.
1105 (parse_skel_decl): Be static.
1106 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1107 * src/options.h (create_long_option_table): Have a real prototype.
1108 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1109 (hash_delete_at): Return const void *.
1110 Adjust casts to preserve the const.
1111
11122001-12-10 Akim Demaille <akim@epita.fr>
1113
1114 * configure.in: Require 2.52g.
1115 M4 is not needed, but AUTOM4TE is.
1116 * m4/m4.m4: Remove.
1117 * tests/Makefile.am: Adjust.
1118
11192001-12-10 Akim Demaille <akim@epita.fr>
1120
1121 One structure for states is enough, even though theoretically
1122 there are LR(0) states and LALR(1) states.
1123
1124 * src/lalr.h (state_t): Remove.
1125 (state_table): Be state_t **, not state_t *.
1126 * src/state.h (core, CORE_ALLOC): Rename as...
1127 (state_t, STATE_ALLOC): this.
1128 Add the LALR(1) members: shifts, reductions, errs.
1129 * src/LR0.c (state_table): Rename as...
1130 (state_hash): this, to avoid name clashes with the global
1131 `state_table'.
1132 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1133 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1134
11352001-12-10 Akim Demaille <akim@epita.fr>
1136
1137 Bison dumps core on bash.y.
1138 Reported by Pascal Bart.
1139
1140 * src/warshall.c (bitmatrix_print): New.
1141 (TC): Use it.
1142 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1143 j must be the outer loop.
1144 * tests/regression.at (Broken Closure): New.
1145
11462001-12-05 Akim Demaille <akim@epita.fr>
1147
1148 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1149 its argument.
1150