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