]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* src/output.c (header_output): Don't forget to export YYLTYPE and
[bison.git] / ChangeLog
... / ...
CommitLineData
12001-12-29 Akim Demaille <akim@epita.fr>
2
3 * src/output.c (header_output): Don't forget to export YYLTYPE and
4 yylloc.
5 * tests/headers.at (export YYLTYPE): New, make sure it does.
6 * tests/regression.at (%union and --defines, Invalid CPP headers):
7 Move to...
8 * tests/headers.at: here.
9
10
112001-12-29 Akim Demaille <akim@epita.fr>
12
13 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14
15
162001-12-29 Akim Demaille <akim@epita.fr>
17
18 * tests/actions.at (Mid-rule actions): Output on a single line
19 instead of several.
20
21
222001-12-29 Akim Demaille <akim@epita.fr>
23
24 * doc/bison.texinfo: Formatting changes.
25
262001-12-29 Akim Demaille <akim@epita.fr>
27
28 Don't store the token defs in a muscle, just be ready to output it
29 on command. Now possible via `symbols'. Fixes a memory leak.
30
31 * src/output.c (token_definitions_output): New.
32 (output_parser, header_output): Use it.
33 * src/reader.c (symbols_save): Remove.
34
35
362001-12-29 Akim Demaille <akim@epita.fr>
37
38 * src/bison.simple: Do not provide a default for YYSTYPE and
39 YYLTYPE before the user's prologue. Otherwise it's hardly... a
40 default.
41
42
432001-12-29 Akim Demaille <akim@epita.fr>
44
45 Mid-rule actions are simply... ignored!
46
47 * src/reader.c (readgram): Be sure to attach mid-rule actions to
48 the empty-rule associated to the dummy symbol, not to the host
49 rule.
50 * tests/actions.at (Mid-rule actions): New.
51
52
532001-12-29 Akim Demaille <akim@epita.fr>
54
55 Memory leak.
56
57 * src/reader.c (reader): Free grammar.
58
592001-12-29 Akim Demaille <akim@epita.fr>
60
61 Memory leak.
62
63 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
64 since it allocates it for each state, although only one is needed.
65 (allocate_storage): Do it here.
66
67
682001-12-29 Akim Demaille <akim@epita.fr>
69
70 * src/options.h, src/options.c (create_long_option_table): Rename
71 as...
72 (long_option_table_new): this, with a clearer prototype.
73 (percent_table): Remove, unused,
74 * src/getargs.c (getargs): Adjust.
75
76
772001-12-29 Akim Demaille <akim@epita.fr>
78
79 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
80 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
81 as states.
82
83
842001-12-29 Akim Demaille <akim@epita.fr>
85
86 * src/lalr.c (build_relations): Rename `states' as `states1'.
87 Sorry, I don't understand exactly what it is, no better name...
88
89
902001-12-29 Akim Demaille <akim@epita.fr>
91
92 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
93 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
94 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
95 as rules.
96
97
982001-12-29 Akim Demaille <akim@epita.fr>
99
100 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
101 ago.
102
103
1042001-12-29 Akim Demaille <akim@epita.fr>
105
106 * src/reader.c, src/reader.h (user_toknums): Remove.
107 Adjust all users to use symbols[i]->user_token_number.
108
109
1102001-12-29 Akim Demaille <akim@epita.fr>
111
112 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
113 Adjust all users to use symbols[i]->prec or ->assoc.
114
115
1162001-12-29 Akim Demaille <akim@epita.fr>
117
118 * src/reader.c, src/reader.h (tags): Remove.
119 Adjust all users to use symbols[i]->tag.
120
121
1222001-12-29 Akim Demaille <akim@epita.fr>
123
124 * src/gram.h, src/gram.c (symbols): New, similar to state_table
125 and rule_table.
126 * src/reader.c (packsymbols): Fill this table.
127 Drop sprec.
128 * src/conflicts.c (resolve_sr_conflict): Adjust.
129 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
130 single table.
131 Use symbols[i]->tag instead of tags[i].
132
133
1342001-12-29 Akim Demaille <akim@epita.fr>
135
136 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
137 In addition, put a comment in there, to replace...
138 * tests/regression.at (%union and C comments): Remove.
139
140
1412001-12-29 Akim Demaille <akim@epita.fr>
142
143 * tests/regression.at (Web2c Actions): Blindly move the actual
144 output as expected output. The contents *seem* right to me, but I
145 can't pretend reading perfectly parser tables... Nonetheless, all
146 the other tests pass correctly, the table look OK, even though the
147 presence of `$axiom' is to be noted: AFAICS it is useless (but
148 harmless).
149
150
1512001-12-29 Akim Demaille <akim@epita.fr>
152
153 * src/reader.c (readgram): Don't add the rule 0 if there were no
154 rules read. In other words, add it _after_ having performed
155 grammar sanity checks.
156 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
157
158
1592001-12-29 Akim Demaille <akim@epita.fr>
160
161 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
162 visible, and some states have now a different number.
163
164
1652001-12-29 Akim Demaille <akim@epita.fr>
166
167 * src/reader.c (readgram): Bind the initial rule's lineno to that
168 of the first rule.
169 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
170 (Solved SR Conflicts): Adjust rule 0's line number.
171
172
1732001-12-29 Akim Demaille <akim@epita.fr>
174
175 Fix the `GAWK Grammar' failure.
176
177 * src/LR0.c (final_state): Initialize to -1 so that we do compute
178 the reductions of the first state which was mistakenly confused
179 with the final state because precisely final_state was initialized
180 to 0.
181 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
182 now noticed by Bison.
183 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
184 have a reduction on $default.
185
186
1872001-12-29 Akim Demaille <akim@epita.fr>
188
189 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
190 rule line numbers.
191 * src/closure.c (print_closure): Likewise.
192 * src/derives.c (print_derives): Likewise.
193 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
194 now.
195
1962001-12-29 Akim Demaille <akim@epita.fr>
197
198 * src/lalr.c (lookaheads_print): New.
199 (lalr): Call it when --trace-flag.
200 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
201 are dumped.
202
203
2042001-12-29 Akim Demaille <akim@epita.fr>
205
206 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
207 when walking through ritem, even via rule->rhs.
208 * src/reduce.c (dump_grammar, useful_production, reduce_output)
209 (useful_production, useless_nonterminals): Likewise.
210 (reduce_grammar_tables): Likewise, plus update nritems.
211 * src/nullable.c (set_nullable): Likewise.
212 * src/lalr.c (build_relations): Likewise.
213 * tests/sets.at (Nullable): Adjust.
214 Fortunately, now, the $axiom is no longer nullable.
215
216
2172001-12-29 Akim Demaille <akim@epita.fr>
218
219 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
220 the 0-sentinel.
221 * src/gram.c (ritem_longest_rhs): Likewise.
222 * src/reduce.c (nonterminals_reduce): Likewise.
223 * src/print_graph.c (print_graph): Likewise.
224 * src/output.c (output_rule_data): Likewise.
225 * src/nullable.c (set_nullable): Likewise.
226
2272001-12-29 Akim Demaille <akim@epita.fr>
228
229 * src/output.c: Comment changes.
230
2312001-12-27 Paul Eggert <eggert@twinsun.com>
232
233 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
234 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
235 Sparc, as they were causing more porting problems than the
236 (minor) performance improvement was worth.
237
238 Also, catch up with 1.31's YYSTD.
239
2402001-12-27 Akim Demaille <akim@epita.fr>
241
242 * src/output.c (output_gram): Rely on nritems, not the
243 0-sentinel. See below.
244 Use -1 as separator, not 0.
245 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
246 Rely on -1 as separator in yyrhs, instead of 0.
247 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
248 twice `Now at end of input', therefore there are two lines less to
249 expect.
250
2512001-12-27 Akim Demaille <akim@epita.fr>
252
253 * tests/regression.at (Unresolved SR Conflicts):
254 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
255 below.
256
2572001-12-27 Akim Demaille <akim@epita.fr>
258
259 * src/LR0.c (new_state): Recognize the final state by the fact it
260 is reached by eoftoken.
261 (insert_start_shifting_state, insert_eof_shifting_state)
262 (insert_accepting_state, augment_automaton): Remove, since now
263 these states are automatically computed from the initial state.
264 (generate_states): Adjust.
265 * src/print.c: When reporting a rule number to the user, substract
266 1, so that the axiom rule is rule 0, and the first user rule is 1.
267 * src/reduce.c: Likewise.
268 * src/print_graph.c (print_core): For the time being, just as for
269 the report, depend upon --trace-flags to dump the full set of
270 items.
271 * src/reader.c (readgram): Once the grammar read, insert the rule
272 0: `$axiom: START-SYMBOL $'.
273 * tests/set.at: Adjust: rule 0 is now displayed, and since the
274 number of the states has changed (the final state is no longer
275 necessarily the last), catch up.
276
2772001-12-27 Akim Demaille <akim@epita.fr>
278
279 Try to make the use of the eoftoken valid. Given that its value
280 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
281 is used instead of > 0 where appropriate, (ii), depend upon nritems
282 instead of the 0-sentinel.
283
284 * src/gram.h, src/gram.c (nritems): New.
285 Expected to be duplication of nitems, but for the time being...
286 * src/reader.c (packgram): Assert nritems and nitems are equal.
287 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
288 * src/closure.c (print_closure, print_fderives): Likewise.
289 * src/gram.c (ritem_print): Likewise.
290 * src/print.c (print_core, print_grammar): Likewise.
291 * src/print_graph.c: Likewise.
292
2932001-12-27 Akim Demaille <akim@epita.fr>
294
295 * src/main.c (main): If there are complains after grammar
296 reductions, then output the report anyway if requested, then die.
297 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
298 * src/reader.c (eoftoken): New.
299 (parse_token_decl): If the token being defined has value `0', it
300 is the eoftoken.
301 (packsymbols): No longer hack `tags' to insert `$' by hand.
302 Be sure to preserve the value of the eoftoken.
303 (reader): Make sure eoftoken is defined.
304 Initialize nsyms to 0: now eoftoken is created just like the others.
305 * src/print.c (print_grammar): Don't special case the eof token.
306 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
307 lie anyway, albeit pleasant.
308 * tests/calc.at: Exercise error messages with eoftoken.
309 Change the grammar so that empty input is invalid.
310 Adjust expectations.
311 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
312
3132001-12-27 Akim Demaille <akim@epita.fr>
314
315 * configure.in: Check the protos of strchr ans strspn.
316 Replace strchr if needed.
317 * src/system.h: Provide the protos of strchr, strspn and memchr if
318 missing.
319 * lib/strchr.c: New.
320 * src/reader.c (symbols_save): Use strchr.
321
3222001-12-27 Akim Demaille <akim@epita.fr>
323
324 * src/print.c, src/print_graph.c (escape): New.
325 Use it to quote the TAGS outputs.
326 * src/print_graph.c (print_state): Now errors are in red, and
327 reductions in green.
328 Prefer high to wide: output the state number on a line of its own.
329
3302001-12-27 Akim Demaille <akim@epita.fr>
331
332 * src/state.h, src/state.c (reductions_new): New.
333 * src/LR0.c (set_state_table): Let all the states have a
334 `reductions', even if reduced to 0.
335 (save_reductions): Adjust.
336 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
337 * src/print.c (print_reductions, print_actions): Adjust.
338 * src/output.c (action_row): Adjust.
339
3402001-12-27 Akim Demaille <akim@epita.fr>
341
342 * src/state.h, src/state.c (errs_new, errs_dup): New.
343 * src/LR0.c (set_state_table): Let all the states have an errs,
344 even if reduced to 0.
345 * src/print.c (print_errs, print_reductions): Adjust.
346 * src/output.c (output_actions, action_row): Adjust.
347 * src/conflicts.c (resolve_sr_conflict): Adjust.
348
3492001-12-27 Akim Demaille <akim@epita.fr>
350
351 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
352
3532001-12-27 Akim Demaille <akim@epita.fr>
354
355 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
356 * src/print.c: here.
357 (lookaheadset, shiftset): New, used as additional storage by
358 print_reductions.
359 (print_results): Adjust.
360 (print_shifts, print_gotos, print_errs): New, extracted from...
361 (print_actions): here.
362 * src/print_graph.c (print_actions): Remove dead code.
363
3642001-12-27 Akim Demaille <akim@epita.fr>
365
366 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
367 `$n' and `@n'.
368
3692001-12-27 Akim Demaille <akim@epita.fr>
370
371 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
372 (build_relations): Adjust.
373
3742001-12-27 Akim Demaille <akim@epita.fr>
375
376 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
377 duplication.
378
3792001-12-27 Akim Demaille <akim@epita.fr>
380
381 * src/reader.c (packgram): Catch nitems overflows.
382
3832001-12-27 Akim Demaille <akim@epita.fr>
384
385 * src/files.c, src/files.h (guard_obstack): Remove.
386 * src/output.c (output): Adjust.
387 * src/reader.c (parse_braces): New, factoring...
388 (copy_action, copy_guard): these two which are renamed as...
389 (parse_action, parse_guard): these.
390 As a voluntary consequence, using braces around guards is now
391 mandatory.
392
3932001-12-27 Akim Demaille <akim@epita.fr>
394
395 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
396 * src/reader.c (symbol_list): `guard' and `guard_line' are new
397 members.
398 (symbol_list_new): Adjust.
399 (copy_action): action_line is the first line, not the last.
400 (copy_guard): Just as for actions, store the `action' only, not
401 the switch/case/break flesh.
402 Don't parse the user action that might follow the guard, let...
403 (readgram): do it, i.e., now, there can be an action after a
404 guard.
405 In other words the guard is just explicitly optional.
406 (packgram): Adjust.
407 * src/output.c (guards_output): New.
408 (output_parser): Call it when needed.
409 (output): Also free the guard and attrs obstacks.
410 * src/files.c, src/files.h (obstack_save): Remove.
411 (output_files): Remove.
412 As a result, if one needs the former `.act' file, using an
413 appropriate skeleton which requires actions and guards is now
414 required.
415 * src/main.c (main): Adjust.
416 * tests/semantic.at: New.
417 * tests/regression.at: Use `input.y' as input file name.
418 Avoid 8+3 problems by requiring input.c when the test needs the
419 parser.
420
4212001-12-27 Akim Demaille <akim@epita.fr>
422
423 * src/reader.c (symbol_list_new): Be sure to initialize all the
424 fields.
425
4262001-12-27 Akim Demaille <akim@epita.fr>
427
428 All the hacks using a final pseudo state are now useless.
429
430 * src/LR0.c (set_state_table): state_table holds exactly nstates.
431 * src/lalr.c (nLA): New.
432 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
433 instead of lookaheadsp from the pseudo state (nstate + 1).
434
4352001-12-27 Akim Demaille <akim@epita.fr>
436
437 * src/output.c (action_row, token_actions): Use a state_t instead
438 of a integer, and nlookaheads instead of the following state's
439 lookaheadsp.
440
4412001-12-27 Akim Demaille <akim@epita.fr>
442
443 * src/conflicts.c (log_resolution, flush_shift)
444 (resolve_sr_conflict, set_conflicts, solve_conflicts)
445 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
446 (conflicts_print, print_reductions): Use a state_t instead of an
447 integer when referring to a state.
448 As much as possible, depend upon nlookaheads, instead of the
449 `lookaheadsp' member of the following state (since lookaheads of
450 successive states are successive, the difference between state n + 1
451 and n served as the number of lookaheads for state n).
452 * src/lalr.c (add_lookback_edge): Likewise.
453 * src/print.c (print_core, print_actions, print_state)
454 (print_results): Likewise.
455 * src/print_graph.c (print_core, print_actions, print_state)
456 (print_graph): Likewise.
457 * src/conflicts.h: Adjust.
458
4592001-12-27 Akim Demaille <akim@epita.fr>
460
461 * src/bison.hairy: Formatting/comment changes.
462 ANSIfy.
463 Remove `register' indications.
464 Add plenty of `static'.
465
4662001-12-27 Akim Demaille <akim@epita.fr>
467
468 * src/output.c (prepare): Drop the muscle `ntbase' which
469 duplicates ntokens.
470 * src/bison.simple: Formatting/comment changes.
471 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
472 is an undocumented synonym.
473
4742001-12-22 Akim Demaille <akim@epita.fr>
475
476 * src/output.c (output_table_data): Change the prototype to use
477 `int' for array ranges: some invocations do pass an int, not a
478 short.
479 Reported by Wayne Green.
480
4812001-12-22 Akim Demaille <akim@epita.fr>
482
483 Some actions of web2c.y are improperly triggered.
484 Reported by Mike Castle.
485
486 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
487 * tests/regression.at (Web2c): Rename as...
488 (Web2c Report): this.
489 (Web2c Actions): New.
490
4912001-12-22 Akim Demaille <akim@epita.fr>
492
493 Reductions in web2c.y are improperly reported.
494 Reported by Mike Castle.
495
496 * src/conflicts.c (print_reductions): Fix.
497 * tests/regression.at (Web2c): New.
498
4992001-12-18 Akim Demaille <akim@epita.fr>
500
501 Some host fail on `assert (!"foo")', which expands to
502 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
503 Reported by Nelson Beebee.
504
505 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
506 `#define it_succeeded 0' and `assert (it_succeeded)'.
507
5082001-12-17 Marc Autret <autret_m@epita.fr>
509
510 * src/bison.simple: Don't hard code the skeleton line and filename.
511 * src/output.c (output_parser): Rename 'line' as 'output_line'.
512 New line counter 'skeleton_line' (skeleton-line muscle).
513
5142001-12-17 Paul Eggert <eggert@twinsun.com>
515
516 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
517 YYDEBUG must be defined to a nonzero value.
518
519 * src/bison.simple (yytname): Do not assume that the user defines
520 YYDEBUG to a properly parenthesized expression.
521
5222001-12-17 Akim Demaille <akim@epita.fr>
523
524 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
525 nlookaheads is a new member.
526 Adjust all users.
527 * src/lalr.h (nlookaheads): Remove this orphan declaration.
528 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
529 state.
530
5312001-12-17 Akim Demaille <akim@epita.fr>
532
533 * src/files.h, src/files.c (open_files, close_files): Remove.
534 * src/main.c (main): Don't open/close files, nor invoke lex_free,
535 let...
536 * src/reader.c (reader): Do it.
537
5382001-12-17 Akim Demaille <akim@epita.fr>
539
540 * src/conflicts.c (print_reductions): Formatting changes.
541
5422001-12-17 Akim Demaille <akim@epita.fr>
543
544 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
545 (flush_reduce): New.
546 (resolve_sr_conflict): Adjust.
547
5482001-12-17 Akim Demaille <akim@epita.fr>
549
550 * src/output.c (output_obstack): Be static and rename as...
551 (format_obstack): this, to avoid any confusion with files.c's
552 output_obstack.
553 * src/reader.h (muscle_obstack): Move to...
554 * src/output.h: here, since it's defined in output.c.
555
5562001-12-17 Akim Demaille <akim@epita.fr>
557
558 * src/output.c (action_row, save_column, default_goto)
559 (sort_actions, matching_state, pack_vector): Better variable
560 locality.
561
5622001-12-17 Akim Demaille <akim@epita.fr>
563
564 * src/output.c: Various formatting changes.
565
5662001-12-17 Akim Demaille <akim@epita.fr>
567
568 * src/files.c (output_files): Free the output_obstack.
569 * src/main.c (main): Call print and print_graph conditionally.
570 * src/print.c (print): Work unconditionally.
571 * src/print_graph.c (print_graph): Work unconditionally.
572 * src/conflicts.c (log_resolution): Output only if verbose_flag.
573
5742001-12-16 Marc Autret <autret_m@epita.fr>
575
576 * src/output.c (actions_output): Fix. When we use %no-lines,
577 there is one less line per action.
578
5792001-12-16 Marc Autret <autret_m@epita.fr>
580
581 * src/bison.simple: Remove a useless #line directive.
582 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
583 * src/output.c (get_lines_number): New.
584 (output_parser): Adjust, now takes care about the lines of a
585 output muscles.
586 Fix line numbering.
587 (actions_output): Computes the number of lines taken by actions.
588 (output_master_parser): Insert new skeleton which is the name of
589 the output parser file name.
590
5912001-12-15 Marc Autret <autret_m@epita.fr>
592
593 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
594
5952001-12-15 Marc Autret <autret_m@epita.fr>
596
597 * src/output.c (output_gram): Keep track of the hairy one.
598
5992001-12-15 Akim Demaille <akim@epita.fr>
600
601 Make `make distcheck' work.
602
603 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
604 system.h which uses libgettext.h.
605
6062001-12-15 Akim Demaille <akim@epita.fr>
607
608 * src/nullable.c (set_nullable): Useless rules must be skipped,
609 otherwise, since we range over their symbols, we might look at a
610 nonterminal which no longer ``exists'', i.e., it is not counted in
611 `nvars', hence we overflow our arrays.
612
6132001-12-15 Akim Demaille <akim@epita.fr>
614
615 The header can also be produced directly, without any obstack!
616 Yahoo!
617
618 * src/files.c, src/files.h (defines_obstack): Remove.
619 (compute_header_macro): Global.
620 (defines_obstack_save): Remove.
621 * src/reader.c (parse_union_decl): No longer output to
622 defines_obstack: its content can be found in the `stype' muscle
623 anyway.
624 (output_token_translations): Merge into...
625 (symbols_output): this.
626 Rename as...
627 (symbols_save): this.
628 (reader): Adjust.
629 * src/output.c (header_output): New.
630 (output): Call it.
631
6322001-12-15 Akim Demaille <akim@epita.fr>
633
634 * src/reader.c (parse_union_decl): Instead of handling two obstack
635 simultaneously, use one to define the `stype' muscle, and use the
636 value of the latter to fill defines_obstack.
637 (copy_comment): Remove.
638 (copy_comment2): Work for a single obstack.
639 Rename as...
640 (copy_comment): this.
641
6422001-12-15 Akim Demaille <akim@epita.fr>
643
644 * src/lex.c, src/lex.h (xgetc): No longer static.
645 * src/reader.c (parse_union_decl): Revamp.
646
6472001-12-15 Akim Demaille <akim@epita.fr>
648
649 Still making progress in separating Bison into (i) input, (ii)
650 process, (iii) output: now we can directly output the parser file
651 without using table_obstack at all.
652
653 * src/files.c, src/files.h (table_obstack): Bye bye.
654 (parser_file_name): New.
655 * src/files.c (compute_output_file_names): Compute it.
656 * src/output.c (actions_output, output_parser)
657 (output_master_parser): To a file instead of an obstack.
658
6592001-12-15 Akim Demaille <akim@epita.fr>
660
661 Attach actions to rules, instead of pre-outputting them to
662 actions_obstack.
663
664 * src/gram.h (rule_t): action and action_line are new members.
665 * src/reader.c (symbol_list): Likewise.
666 (copy_action): Save the actions within the rule.
667 (packgram): Save them in rule_table.
668 * src/output.c (actions_output): New.
669 (output_parser): Use it on `%%actions'.
670 (output_rule_data): Don't free rule_table.
671 (output): Do it.
672 (prepare): Don't save the `action' muscle.
673 * src/bison.simple: s/%%action/%%actions/.
674
6752001-12-15 Akim Demaille <akim@epita.fr>
676
677 * src/reader.c (copy_action): When --yacc, don't append a `;'
678 to the user action: let it fail if lacking.
679 Suggested by Arnold Robbins and Tom Tromey.
680
6812001-12-14 Akim Demaille <akim@epita.fr>
682
683 * src/lex.c (literalchar): Simply return the char you decoded, non
684 longer mess around with obstacks and int pointers.
685 Adjust all callers.
686
6872001-12-14 Akim Demaille <akim@epita.fr>
688
689 * src/lex.c (literalchar): Don't escape the special characters,
690 just decode them, and keep them as char (before, eol was output as
691 the 2 char string `\n' etc.).
692 * src/output.c (output_rule_data): Use quotearg to output the
693 token strings.
694
6952001-12-13 Paul Eggert <eggert@twinsun.com>
696
697 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
698 Do not infringe on the global user namespace when using C++.
699 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
700 All uses of `fprintf' and `stderr' changed.
701
702 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
703
7042001-12-13 Akim Demaille <akim@epita.fr>
705
706 The computation of nullable is broken: it doesn't handle empty
707 RHS's properly.
708
709 * tests/torture.at (GNU AWK Grammar): New.
710 * tests/sets.at (Nullable): New.
711 * src/nullable.c (set_nullable): Instead of blindly looping over
712 `ritems', loop over the rules, and then over their rhs's.
713
714 Work around Autotest bugs.
715
716 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
717 frame, because Autotest understand lines starting with a `+' as
718 traces from the shell. Then, they are not processed properly.
719 Admittedly an Autotest bug, but we don't have time to wait for
720 Autotest to catch up.
721 * tests/regression.at (Broken Closure): Adjust to the new table
722 frames.
723 Move to...
724 * tests/sets.at: here.
725
7262001-12-13 Akim Demaille <akim@epita.fr>
727
728 * src/closure.c (closure): Use nrules instead of playing tricks
729 with BITS_PER_WORD.
730
7312001-12-13 Akim Demaille <akim@epita.fr>
732
733 * src/print.c (print_actions): Output the handling of `$' as the
734 traces do: shifting the token EOF. Before EOF was treated as a
735 nonterminal.
736 * tests/regression.at: Adjust some tests.
737 * src/print_graph.c (print_core): Complete the set of items via
738 closure. The next-to-final and final states are still unsatisfying,
739 but that's to be addressed elsewhere.
740 No longer output the rule numbers, but do output the state number.
741 A single loop for the shifts + gotos is enough, but picked a
742 distinct color for each.
743 (print_graph): Initialize and finalize closure.
744
7452001-12-13 Akim Demaille <akim@epita.fr>
746
747 * src/reader.c (readgram): Remove dead code, an strip useless
748 braces.
749 (get_type): Remove, unused.
750
7512001-12-12 Akim Demaille <akim@epita.fr>
752
753 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
754 on that of lib/error.c.
755
7562001-12-12 Akim Demaille <akim@epita.fr>
757
758 Some hosts don't like `/' in includes.
759
760 * src/system.h: Include libgettext.h without qualifying the path.
761 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
762 $(top_srcdir).
763
7642001-12-11 Marc Autret <autret_m@epita.fr>
765
766 * src/output.c (output_parser): Remove useless muscle.
767
7682001-12-11 Marc Autret <autret_m@epita.fr>
769
770 * src/bison.simple: Remove #line just before %%epilogue. It
771 is now handled in ...
772 * src/reader.c (read_additionnal_code): Add the output of a
773 #line for the epilogue.
774
7752001-12-10 Marc Autret <autret_m@epita.fr>
776
777 * src/reader.c (copy_definition): Re-use CPP-outed code which
778 replace precedent remove.
779 * src/bison.simple: Remove #line before %%prologue because
780 %%input-line is wrong at this time.
781
7822001-12-10 Marc Autret <autret_m@epita.fr>
783
784 * src/reader.c (symbols_output): Clean up.
785 * src/output.c (output_gram, output): Clean up.
786
7872001-12-10 Akim Demaille <akim@epita.fr>
788
789 * src/lalr.c (initialize_lookaheads): New. Extracted from...
790 * src/LR0.c (set_state_table): here.
791 * src/lalr.c (lalr): Call it.
792
7932001-12-10 Akim Demaille <akim@epita.fr>
794
795 * src/state.h (shifts): Remove the `number' member: shifts are
796 attached to state, hence no longer need to be labelled with a
797 state number.
798
7992001-12-10 Akim Demaille <akim@epita.fr>
800
801 Now that states have a complete set of members, the linked list of
802 shifts is useless: just fill directly the state's shifts member.
803
804 * src/state.h (shifts): Remove the `next' member.
805 * src/LR0.c (first_state, last_state): Remove.
806 Adjust the callers.
807 (augment_automaton): Don't look for the shifts that must be added
808 a shift on EOF: it is those of the state we looked for! But now,
809 since shifts are attached, it is no longer needed to looking
810 merely by its id: its number.
811
8122001-12-10 Akim Demaille <akim@epita.fr>
813
814 * src/LR0.c (augment_automaton): Better variable locality.
815 Remove an impossible branch: if there is a state corresponding to
816 the start symbol being shifted, then there is shift for the start
817 symbol from the initial state.
818
8192001-12-10 Akim Demaille <akim@epita.fr>
820
821 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
822 only when appropriate: when insert_start_shifting_state' is not
823 invoked.
824 * tests/regression.at (Rule Line Numbers): Adjust.
825
8262001-12-10 Akim Demaille <akim@epita.fr>
827
828 * src/LR0.c (augment_automaton): Now that all states have shifts,
829 merge the two cases addition shifts to the initial state.
830
8312001-12-10 Akim Demaille <akim@epita.fr>
832
833 * src/lalr.c (set_state_table): Move to...
834 * src/LR0.c: here.
835 * src/lalr.c (lalr): Don't call it...
836 * src/LR0.c (generate_states): do it.
837 * src/LR0.h (first_state): Remove, only the table is used.
838
8392001-12-10 Akim Demaille <akim@epita.fr>
840
841 * src/LR0.h (first_shift, first_reduction): Remove.
842 * src/lalr.c: Don't use first_shift: find shifts through the
843 states.
844
8452001-12-10 Akim Demaille <akim@epita.fr>
846
847 * src/LR0.c: Attach shifts to states as soon as they are
848 computed.
849 * src/lalr.c (set_state_table): Instead of assigning shifts to
850 state, just assert that the mapping was properly done.
851
8522001-12-10 Akim Demaille <akim@epita.fr>
853
854 * src/LR0.c (insert_start_shift): Rename as...
855 (insert_start_shifting_state): this.
856 (insert_eof_shifting_state, insert_accepting_state): New.
857 (augment_automaton): Adjust.
858 Better locality of the variables.
859 When looking if the start_symbol is shifted from the initial
860 state, using `while (... symbol != start_symbol ...)' sounds
861 better than `while (... symbol < start_symbol ...)': If fail
862 to see how the order between symbols could be relevant!
863
8642001-12-10 Akim Demaille <akim@epita.fr>
865
866 * src/getargs.h: Don't declare `spec_name_prefix' and
867 `spec_file_prefix', declared by src/files.h.
868 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
869 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
870 * src/output.c (prepare): Adjust.
871 * src/reader.c (symbols_output): Likewise.
872 * src/vmsgetargs.c: Vaguely adjust, but who cares?
873
8742001-12-10 Akim Demaille <akim@epita.fr>
875
876 * src/muscle_tab.c (muscle_init): NULL is a better default than
877 `"0"'.
878
8792001-12-10 Akim Demaille <akim@epita.fr>
880
881 * src/reader.c (reader): Calling symbols_output once is enough.
882
8832001-12-10 Akim Demaille <akim@epita.fr>
884
885 Now that states have a complete set of members, the linked list of
886 reductions is useless: just fill directly the state's reductions
887 member.
888
889 * src/state.h (struct reductions): Remove member `number' and
890 `next'.
891 * src/LR0.c (first_reduction, last_reduction): Remove.
892 (save_reductions): Don't link the new reductions, store them in
893 this_state.
894 * src/lalr.c (set_state_table): No need to attach reductions to
895 states, it's already done.
896 * src/output.c (output_actions): No longer free the shifts, then
897 the reductions, then the states: free all the states and their
898 members.
899
9002001-12-10 Akim Demaille <akim@epita.fr>
901
902 * src/options.c (OPTN, DRTV, BOTH): New.
903 (option_table): Use them.
904
905 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
906 the job of system.h.
907 * src/options.c: Don't include stdio.h and xalloc.h for the same
908 reasons.
909
9102001-12-10 Akim Demaille <akim@epita.fr>
911
912 * src/output.c (output, prepare): Make sure the values of the
913 muscles `action' and `prologue' are 0-terminated.
914
9152001-12-10 Akim Demaille <akim@epita.fr>
916
917 Clean up GCC warnings.
918
919 * src/reader.c (copy_action): `buf' is not used.
920 (parse_skel_decl): Be static.
921 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
922 * src/options.h (create_long_option_table): Have a real prototype.
923 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
924 (hash_delete_at): Return const void *.
925 Adjust casts to preserve the const.
926
9272001-12-10 Akim Demaille <akim@epita.fr>
928
929 * configure.in: Require 2.52g.
930 M4 is not needed, but AUTOM4TE is.
931 * m4/m4.m4: Remove.
932 * tests/Makefile.am: Adjust.
933
9342001-12-10 Akim Demaille <akim@epita.fr>
935
936 One structure for states is enough, even though theoretically
937 there are LR(0) states and LALR(1) states.
938
939 * src/lalr.h (state_t): Remove.
940 (state_table): Be state_t **, not state_t *.
941 * src/state.h (core, CORE_ALLOC): Rename as...
942 (state_t, STATE_ALLOC): this.
943 Add the LALR(1) members: shifts, reductions, errs.
944 * src/LR0.c (state_table): Rename as...
945 (state_hash): this, to avoid name clashes with the global
946 `state_table'.
947 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
948 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
949
9502001-12-10 Akim Demaille <akim@epita.fr>
951
952 Bison dumps core on bash.y.
953 Reported by Pascal Bart.
954
955 * src/warshall.c (bitmatrix_print): New.
956 (TC): Use it.
957 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
958 j must be the outer loop.
959 * tests/regression.at (Broken Closure): New.
960
9612001-12-05 Akim Demaille <akim@epita.fr>
962
963 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
964 its argument.
965