]> git.saurik.com Git - bison.git/blame - ChangeLog
Memory leak.
[bison.git] / ChangeLog
CommitLineData
8419d367
AD
12001-12-29 Akim Demaille <akim@epita.fr>
2
3 Memory leak.
4
5 * src/reader.c (reader): Free grammar.
6
375d5806
AD
72001-12-29 Akim Demaille <akim@epita.fr>
8
9 Memory leak.
10
11 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12 since it allocates it for each state, although only one is needed.
13 (allocate_storage): Do it here.
14
15
f51cb8ff
AD
162001-12-29 Akim Demaille <akim@epita.fr>
17
18 * src/options.h, src/options.c (create_long_option_table): Rename
19 as...
20 (long_option_table_new): this, with a clearer prototype.
21 (percent_table): Remove, unused,
22 * src/getargs.c (getargs): Adjust.
23
24
29e88316
AD
252001-12-29 Akim Demaille <akim@epita.fr>
26
27 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
28 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
29 as states.
30
31
b9f71f19
AD
322001-12-29 Akim Demaille <akim@epita.fr>
33
34 * src/lalr.c (build_relations): Rename `states' as `states1'.
35 Sorry, I don't understand exactly what it is, no better name...
36
37
1a2b5d37
AD
382001-12-29 Akim Demaille <akim@epita.fr>
39
40 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
41 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
42 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
43 as rules.
44
45
1cca533e
AD
462001-12-29 Akim Demaille <akim@epita.fr>
47
48 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
49 ago.
50
51
c03ae966
AD
522001-12-29 Akim Demaille <akim@epita.fr>
53
54 * src/reader.c, src/reader.h (user_toknums): Remove.
55 Adjust all users to use symbols[i]->user_token_number.
56
57
5a670b1e
AD
582001-12-29 Akim Demaille <akim@epita.fr>
59
60 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
61 Adjust all users to use symbols[i]->prec or ->assoc.
62
63
ad949da9
AD
642001-12-29 Akim Demaille <akim@epita.fr>
65
66 * src/reader.c, src/reader.h (tags): Remove.
67 Adjust all users to use symbols[i]->tag.
68
69
0e78e603
AD
702001-12-29 Akim Demaille <akim@epita.fr>
71
72 * src/gram.h, src/gram.c (symbols): New, similar to state_table
73 and rule_table.
74 * src/reader.c (packsymbols): Fill this table.
75 Drop sprec.
76 * src/conflicts.c (resolve_sr_conflict): Adjust.
77 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
78 single table.
79 Use symbols[i]->tag instead of tags[i].
80
81
213e640e
AD
822001-12-29 Akim Demaille <akim@epita.fr>
83
84 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
85 In addition, put a comment in there, to replace...
86 * tests/regression.at (%union and C comments): Remove.
87
88
e7b8bef1
AD
892001-12-29 Akim Demaille <akim@epita.fr>
90
91 * tests/regression.at (Web2c Actions): Blindly move the actual
92 output as expected output. The contents *seem* right to me, but I
93 can't pretend reading perfectly parser tables... Nonetheless, all
94 the other tests pass correctly, the table look OK, even though the
95 presence of `$axiom' is to be noted: AFAICS it is useless (but
96 harmless).
97
98
b68e7744
AD
992001-12-29 Akim Demaille <akim@epita.fr>
100
101 * src/reader.c (readgram): Don't add the rule 0 if there were no
102 rules read. In other words, add it _after_ having performed
103 grammar sanity checks.
104 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
105
106
78d5bae9
AD
1072001-12-29 Akim Demaille <akim@epita.fr>
108
109 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
110 visible, and some states have now a different number.
111
112
ff442794
AD
1132001-12-29 Akim Demaille <akim@epita.fr>
114
115 * src/reader.c (readgram): Bind the initial rule's lineno to that
116 of the first rule.
117 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
118 (Solved SR Conflicts): Adjust rule 0's line number.
119
120
610ab194
AD
1212001-12-29 Akim Demaille <akim@epita.fr>
122
123 Fix the `GAWK Grammar' failure.
124
125 * src/LR0.c (final_state): Initialize to -1 so that we do compute
126 the reductions of the first state which was mistakenly confused
127 with the final state because precisely final_state was initialized
128 to 0.
129 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
130 now noticed by Bison.
131 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
132 have a reduction on $default.
133
134
29d29c8f
AD
1352001-12-29 Akim Demaille <akim@epita.fr>
136
137 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
138 rule line numbers.
139 * src/closure.c (print_closure): Likewise.
140 * src/derives.c (print_derives): Likewise.
141 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
142 now.
143
7c6b64d0
AD
1442001-12-29 Akim Demaille <akim@epita.fr>
145
146 * src/lalr.c (lookaheads_print): New.
147 (lalr): Call it when --trace-flag.
148 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
149 are dumped.
150
151
3d4daee3
AD
1522001-12-29 Akim Demaille <akim@epita.fr>
153
154 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
155 when walking through ritem, even via rule->rhs.
156 * src/reduce.c (dump_grammar, useful_production, reduce_output)
157 (useful_production, useless_nonterminals): Likewise.
158 (reduce_grammar_tables): Likewise, plus update nritems.
159 * src/nullable.c (set_nullable): Likewise.
160 * src/lalr.c (build_relations): Likewise.
161 * tests/sets.at (Nullable): Adjust.
162 Fortunately, now, the $axiom is no longer nullable.
163
164
9e7f6bbd
AD
1652001-12-29 Akim Demaille <akim@epita.fr>
166
167 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
168 the 0-sentinel.
169 * src/gram.c (ritem_longest_rhs): Likewise.
170 * src/reduce.c (nonterminals_reduce): Likewise.
171 * src/print_graph.c (print_graph): Likewise.
172 * src/output.c (output_rule_data): Likewise.
173 * src/nullable.c (set_nullable): Likewise.
174
255ef638
AD
1752001-12-29 Akim Demaille <akim@epita.fr>
176
177 * src/output.c: Comment changes.
178
0d8a7363
AD
1792001-12-27 Paul Eggert <eggert@twinsun.com>
180
181 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
182 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
183 Sparc, as they were causing more porting problems than the
184 (minor) performance improvement was worth.
185
186 Also, catch up with 1.31's YYSTD.
187
3db472b9
AD
1882001-12-27 Akim Demaille <akim@epita.fr>
189
190 * src/output.c (output_gram): Rely on nritems, not the
191 0-sentinel. See below.
192 Use -1 as separator, not 0.
193 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
194 Rely on -1 as separator in yyrhs, instead of 0.
195 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
196 twice `Now at end of input', therefore there are two lines less to
197 expect.
198
b365aa05
AD
1992001-12-27 Akim Demaille <akim@epita.fr>
200
201 * tests/regression.at (Unresolved SR Conflicts):
202 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
203 below.
204
30171f79
AD
2052001-12-27 Akim Demaille <akim@epita.fr>
206
207 * src/LR0.c (new_state): Recognize the final state by the fact it
208 is reached by eoftoken.
209 (insert_start_shifting_state, insert_eof_shifting_state)
210 (insert_accepting_state, augment_automaton): Remove, since now
211 these states are automatically computed from the initial state.
212 (generate_states): Adjust.
213 * src/print.c: When reporting a rule number to the user, substract
214 1, so that the axiom rule is rule 0, and the first user rule is 1.
215 * src/reduce.c: Likewise.
216 * src/print_graph.c (print_core): For the time being, just as for
217 the report, depend upon --trace-flags to dump the full set of
218 items.
219 * src/reader.c (readgram): Once the grammar read, insert the rule
220 0: `$axiom: START-SYMBOL $'.
221 * tests/set.at: Adjust: rule 0 is now displayed, and since the
222 number of the states has changed (the final state is no longer
223 necessarily the last), catch up.
224
75142d45
AD
2252001-12-27 Akim Demaille <akim@epita.fr>
226
227 Try to make the use of the eoftoken valid. Given that its value
228 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
229 is used instead of > 0 where appropriate, (ii), depend upon nritems
230 instead of the 0-sentinel.
231
232 * src/gram.h, src/gram.c (nritems): New.
233 Expected to be duplication of nitems, but for the time being...
234 * src/reader.c (packgram): Assert nritems and nitems are equal.
235 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
236 * src/closure.c (print_closure, print_fderives): Likewise.
237 * src/gram.c (ritem_print): Likewise.
238 * src/print.c (print_core, print_grammar): Likewise.
239 * src/print_graph.c: Likewise.
240
b7c49edf
AD
2412001-12-27 Akim Demaille <akim@epita.fr>
242
243 * src/main.c (main): If there are complains after grammar
244 reductions, then output the report anyway if requested, then die.
245 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
246 * src/reader.c (eoftoken): New.
247 (parse_token_decl): If the token being defined has value `0', it
248 is the eoftoken.
249 (packsymbols): No longer hack `tags' to insert `$' by hand.
250 Be sure to preserve the value of the eoftoken.
251 (reader): Make sure eoftoken is defined.
252 Initialize nsyms to 0: now eoftoken is created just like the others.
253 * src/print.c (print_grammar): Don't special case the eof token.
254 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
255 lie anyway, albeit pleasant.
256 * tests/calc.at: Exercise error messages with eoftoken.
257 Change the grammar so that empty input is invalid.
258 Adjust expectations.
259 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
260
ec2da99f
AD
2612001-12-27 Akim Demaille <akim@epita.fr>
262
263 * configure.in: Check the protos of strchr ans strspn.
264 Replace strchr if needed.
265 * src/system.h: Provide the protos of strchr, strspn and memchr if
266 missing.
267 * lib/strchr.c: New.
268 * src/reader.c (symbols_save): Use strchr.
269
8adfa272
AD
2702001-12-27 Akim Demaille <akim@epita.fr>
271
272 * src/print.c, src/print_graph.c (escape): New.
273 Use it to quote the TAGS outputs.
274 * src/print_graph.c (print_state): Now errors are in red, and
275 reductions in green.
276 Prefer high to wide: output the state number on a line of its own.
277
80dac38c
AD
2782001-12-27 Akim Demaille <akim@epita.fr>
279
280 * src/state.h, src/state.c (reductions_new): New.
281 * src/LR0.c (set_state_table): Let all the states have a
282 `reductions', even if reduced to 0.
283 (save_reductions): Adjust.
284 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
285 * src/print.c (print_reductions, print_actions): Adjust.
286 * src/output.c (action_row): Adjust.
287
2cec70b9
AD
2882001-12-27 Akim Demaille <akim@epita.fr>
289
290 * src/state.h, src/state.c (errs_new, errs_dup): New.
291 * src/LR0.c (set_state_table): Let all the states have an errs,
292 even if reduced to 0.
293 * src/print.c (print_errs, print_reductions): Adjust.
294 * src/output.c (output_actions, action_row): Adjust.
295 * src/conflicts.c (resolve_sr_conflict): Adjust.
296
13ca549a
AD
2972001-12-27 Akim Demaille <akim@epita.fr>
298
299 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
300
5092aba5
AD
3012001-12-27 Akim Demaille <akim@epita.fr>
302
303 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
304 * src/print.c: here.
305 (lookaheadset, shiftset): New, used as additional storage by
306 print_reductions.
307 (print_results): Adjust.
308 (print_shifts, print_gotos, print_errs): New, extracted from...
309 (print_actions): here.
310 * src/print_graph.c (print_actions): Remove dead code.
311
11e2beca
AD
3122001-12-27 Akim Demaille <akim@epita.fr>
313
314 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
315 `$n' and `@n'.
316
dac3c910
AD
3172001-12-27 Akim Demaille <akim@epita.fr>
318
319 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
320 (build_relations): Adjust.
321
d0b0fefa
AD
3222001-12-27 Akim Demaille <akim@epita.fr>
323
324 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
325 duplication.
326
adc8c848
AD
3272001-12-27 Akim Demaille <akim@epita.fr>
328
329 * src/reader.c (packgram): Catch nitems overflows.
330
14d293ac
AD
3312001-12-27 Akim Demaille <akim@epita.fr>
332
333 * src/files.c, src/files.h (guard_obstack): Remove.
334 * src/output.c (output): Adjust.
335 * src/reader.c (parse_braces): New, factoring...
336 (copy_action, copy_guard): these two which are renamed as...
337 (parse_action, parse_guard): these.
338 As a voluntary consequence, using braces around guards is now
339 mandatory.
340
f499b062
AD
3412001-12-27 Akim Demaille <akim@epita.fr>
342
343 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
344 * src/reader.c (symbol_list): `guard' and `guard_line' are new
345 members.
346 (symbol_list_new): Adjust.
347 (copy_action): action_line is the first line, not the last.
348 (copy_guard): Just as for actions, store the `action' only, not
349 the switch/case/break flesh.
350 Don't parse the user action that might follow the guard, let...
351 (readgram): do it, i.e., now, there can be an action after a
352 guard.
353 In other words the guard is just explicitly optional.
354 (packgram): Adjust.
355 * src/output.c (guards_output): New.
356 (output_parser): Call it when needed.
357 (output): Also free the guard and attrs obstacks.
358 * src/files.c, src/files.h (obstack_save): Remove.
359 (output_files): Remove.
360 As a result, if one needs the former `.act' file, using an
361 appropriate skeleton which requires actions and guards is now
362 required.
363 * src/main.c (main): Adjust.
364 * tests/semantic.at: New.
365 * tests/regression.at: Use `input.y' as input file name.
366 Avoid 8+3 problems by requiring input.c when the test needs the
367 parser.
368
d945f5cd
AD
3692001-12-27 Akim Demaille <akim@epita.fr>
370
371 * src/reader.c (symbol_list_new): Be sure to initialize all the
372 fields.
373
d200e455
AD
3742001-12-27 Akim Demaille <akim@epita.fr>
375
376 All the hacks using a final pseudo state are now useless.
377
378 * src/LR0.c (set_state_table): state_table holds exactly nstates.
379 * src/lalr.c (nLA): New.
380 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
381 instead of lookaheadsp from the pseudo state (nstate + 1).
382
f9507c28
AD
3832001-12-27 Akim Demaille <akim@epita.fr>
384
385 * src/output.c (action_row, token_actions): Use a state_t instead
386 of a integer, and nlookaheads instead of the following state's
387 lookaheadsp.
388
065fbd27
AD
3892001-12-27 Akim Demaille <akim@epita.fr>
390
391 * src/conflicts.c (log_resolution, flush_shift)
392 (resolve_sr_conflict, set_conflicts, solve_conflicts)
393 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
394 (conflicts_print, print_reductions): Use a state_t instead of an
395 integer when referring to a state.
396 As much as possible, depend upon nlookaheads, instead of the
397 `lookaheadsp' member of the following state (since lookaheads of
398 successive states are successive, the difference between state n + 1
399 and n served as the number of lookaheads for state n).
400 * src/lalr.c (add_lookback_edge): Likewise.
401 * src/print.c (print_core, print_actions, print_state)
402 (print_results): Likewise.
403 * src/print_graph.c (print_core, print_actions, print_state)
404 (print_graph): Likewise.
405 * src/conflicts.h: Adjust.
406
1b177bd7
AD
4072001-12-27 Akim Demaille <akim@epita.fr>
408
409 * src/bison.hairy: Formatting/comment changes.
410 ANSIfy.
411 Remove `register' indications.
412 Add plenty of `static'.
413
7742ddeb
AD
4142001-12-27 Akim Demaille <akim@epita.fr>
415
416 * src/output.c (prepare): Drop the muscle `ntbase' which
417 duplicates ntokens.
418 * src/bison.simple: Formatting/comment changes.
419 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
420 is an undocumented synonym.
421
1fa14068
AD
4222001-12-22 Akim Demaille <akim@epita.fr>
423
424 * src/output.c (output_table_data): Change the prototype to use
425 `int' for array ranges: some invocations do pass an int, not a
426 short.
427 Reported by Wayne Green.
428
b9752825
AD
4292001-12-22 Akim Demaille <akim@epita.fr>
430
431 Some actions of web2c.y are improperly triggered.
432 Reported by Mike Castle.
433
434 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
435 * tests/regression.at (Web2c): Rename as...
436 (Web2c Report): this.
437 (Web2c Actions): New.
438
776209d6
AD
4392001-12-22 Akim Demaille <akim@epita.fr>
440
441 Reductions in web2c.y are improperly reported.
442 Reported by Mike Castle.
443
444 * src/conflicts.c (print_reductions): Fix.
445 * tests/regression.at (Web2c): New.
446
275fc3ad
AD
4472001-12-18 Akim Demaille <akim@epita.fr>
448
449 Some host fail on `assert (!"foo")', which expands to
450 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
451 Reported by Nelson Beebee.
452
453 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
454 `#define it_succeeded 0' and `assert (it_succeeded)'.
455
897668ee
MA
4562001-12-17 Marc Autret <autret_m@epita.fr>
457
458 * src/bison.simple: Don't hard code the skeleton line and filename.
459 * src/output.c (output_parser): Rename 'line' as 'output_line'.
460 New line counter 'skeleton_line' (skeleton-line muscle).
461
ab3399e0
PE
4622001-12-17 Paul Eggert <eggert@twinsun.com>
463
464 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
465 YYDEBUG must be defined to a nonzero value.
466
467 * src/bison.simple (yytname): Do not assume that the user defines
468 YYDEBUG to a properly parenthesized expression.
469
3877f72b
AD
4702001-12-17 Akim Demaille <akim@epita.fr>
471
472 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
473 nlookaheads is a new member.
474 Adjust all users.
475 * src/lalr.h (nlookaheads): Remove this orphan declaration.
476 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
477 state.
776209d6 478
331dbc1b
AD
4792001-12-17 Akim Demaille <akim@epita.fr>
480
481 * src/files.h, src/files.c (open_files, close_files): Remove.
482 * src/main.c (main): Don't open/close files, nor invoke lex_free,
483 let...
484 * src/reader.c (reader): Do it.
776209d6 485
be750e4c
AD
4862001-12-17 Akim Demaille <akim@epita.fr>
487
488 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 489
709ae8c6
AD
4902001-12-17 Akim Demaille <akim@epita.fr>
491
492 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
493 (flush_reduce): New.
494 (resolve_sr_conflict): Adjust.
776209d6 495
f87685c3
AD
4962001-12-17 Akim Demaille <akim@epita.fr>
497
498 * src/output.c (output_obstack): Be static and rename as...
499 (format_obstack): this, to avoid any confusion with files.c's
500 output_obstack.
501 * src/reader.h (muscle_obstack): Move to...
502 * src/output.h: here, since it's defined in output.c.
503
837491d8
AD
5042001-12-17 Akim Demaille <akim@epita.fr>
505
506 * src/output.c (action_row, save_column, default_goto)
507 (sort_actions, matching_state, pack_vector): Better variable
508 locality.
509
796d61fb
AD
5102001-12-17 Akim Demaille <akim@epita.fr>
511
512 * src/output.c: Various formatting changes.
776209d6 513
64d15509
AD
5142001-12-17 Akim Demaille <akim@epita.fr>
515
516 * src/files.c (output_files): Free the output_obstack.
517 * src/main.c (main): Call print and print_graph conditionally.
518 * src/print.c (print): Work unconditionally.
519 * src/print_graph.c (print_graph): Work unconditionally.
520 * src/conflicts.c (log_resolution): Output only if verbose_flag.
521
fbc8ecb7
MA
5222001-12-16 Marc Autret <autret_m@epita.fr>
523
524 * src/output.c (actions_output): Fix. When we use %no-lines,
525 there is one less line per action.
526
f0440388
MA
5272001-12-16 Marc Autret <autret_m@epita.fr>
528
529 * src/bison.simple: Remove a useless #line directive.
530 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
531 * src/output.c (get_lines_number): New.
776209d6 532 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
533 output muscles.
534 Fix line numbering.
535 (actions_output): Computes the number of lines taken by actions.
536 (output_master_parser): Insert new skeleton which is the name of
537 the output parser file name.
538
a79986b8
MA
5392001-12-15 Marc Autret <autret_m@epita.fr>
540
541 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
542
4ec8e00f
MA
5432001-12-15 Marc Autret <autret_m@epita.fr>
544
545 * src/output.c (output_gram): Keep track of the hairy one.
546
1a4648ff
AD
5472001-12-15 Akim Demaille <akim@epita.fr>
548
549 Make `make distcheck' work.
550
551 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
552 system.h which uses libgettext.h.
553
9c2c67e6
AD
5542001-12-15 Akim Demaille <akim@epita.fr>
555
556 * src/nullable.c (set_nullable): Useless rules must be skipped,
557 otherwise, since we range over their symbols, we might look at a
558 nonterminal which no longer ``exists'', i.e., it is not counted in
559 `nvars', hence we overflow our arrays.
560
93ede233
AD
5612001-12-15 Akim Demaille <akim@epita.fr>
562
563 The header can also be produced directly, without any obstack!
564 Yahoo!
565
566 * src/files.c, src/files.h (defines_obstack): Remove.
567 (compute_header_macro): Global.
568 (defines_obstack_save): Remove.
569 * src/reader.c (parse_union_decl): No longer output to
570 defines_obstack: its content can be found in the `stype' muscle
571 anyway.
572 (output_token_translations): Merge into...
573 (symbols_output): this.
574 Rename as...
575 (symbols_save): this.
576 (reader): Adjust.
577 * src/output.c (header_output): New.
578 (output): Call it.
579
2666f928
AD
5802001-12-15 Akim Demaille <akim@epita.fr>
581
582 * src/reader.c (parse_union_decl): Instead of handling two obstack
583 simultaneously, use one to define the `stype' muscle, and use the
584 value of the latter to fill defines_obstack.
585 (copy_comment): Remove.
586 (copy_comment2): Work for a single obstack.
587 Rename as...
588 (copy_comment): this.
589
428046f8
AD
5902001-12-15 Akim Demaille <akim@epita.fr>
591
592 * src/lex.c, src/lex.h (xgetc): No longer static.
593 * src/reader.c (parse_union_decl): Revamp.
594
ea52d706
AD
5952001-12-15 Akim Demaille <akim@epita.fr>
596
597 Still making progress in separating Bison into (i) input, (ii)
598 process, (iii) output: now we can directly output the parser file
599 without using table_obstack at all.
600
601 * src/files.c, src/files.h (table_obstack): Bye bye.
602 (parser_file_name): New.
603 * src/files.c (compute_output_file_names): Compute it.
604 * src/output.c (actions_output, output_parser)
605 (output_master_parser): To a file instead of an obstack.
606
3f96f4dc
AD
6072001-12-15 Akim Demaille <akim@epita.fr>
608
609 Attach actions to rules, instead of pre-outputting them to
610 actions_obstack.
611
612 * src/gram.h (rule_t): action and action_line are new members.
613 * src/reader.c (symbol_list): Likewise.
614 (copy_action): Save the actions within the rule.
615 (packgram): Save them in rule_table.
616 * src/output.c (actions_output): New.
617 (output_parser): Use it on `%%actions'.
618 (output_rule_data): Don't free rule_table.
619 (output): Do it.
620 (prepare): Don't save the `action' muscle.
621 * src/bison.simple: s/%%action/%%actions/.
622
51576fb3
AD
6232001-12-15 Akim Demaille <akim@epita.fr>
624
625 * src/reader.c (copy_action): When --yacc, don't append a `;'
626 to the user action: let it fail if lacking.
dee049eb 627 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 628
2648a72d
AD
6292001-12-14 Akim Demaille <akim@epita.fr>
630
631 * src/lex.c (literalchar): Simply return the char you decoded, non
632 longer mess around with obstacks and int pointers.
633 Adjust all callers.
634
92790e5b
AD
6352001-12-14 Akim Demaille <akim@epita.fr>
636
637 * src/lex.c (literalchar): Don't escape the special characters,
638 just decode them, and keep them as char (before, eol was output as
639 the 2 char string `\n' etc.).
640 * src/output.c (output_rule_data): Use quotearg to output the
641 token strings.
642
927c1557
PE
6432001-12-13 Paul Eggert <eggert@twinsun.com>
644
645 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
646 Do not infringe on the global user namespace when using C++.
647 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
648 All uses of `fprintf' and `stderr' changed.
649
650 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
651
ed8e1f68
AD
6522001-12-13 Akim Demaille <akim@epita.fr>
653
654 The computation of nullable is broken: it doesn't handle empty
655 RHS's properly.
656
657 * tests/torture.at (GNU AWK Grammar): New.
658 * tests/sets.at (Nullable): New.
659 * src/nullable.c (set_nullable): Instead of blindly looping over
660 `ritems', loop over the rules, and then over their rhs's.
661
662 Work around Autotest bugs.
663
664 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
665 frame, because Autotest understand lines starting with a `+' as
666 traces from the shell. Then, they are not processed properly.
667 Admittedly an Autotest bug, but we don't have time to wait for
668 Autotest to catch up.
669 * tests/regression.at (Broken Closure): Adjust to the new table
670 frames.
671 Move to...
672 * tests/sets.at: here.
673
cb581495
AD
6742001-12-13 Akim Demaille <akim@epita.fr>
675
676 * src/closure.c (closure): Use nrules instead of playing tricks
677 with BITS_PER_WORD.
678
2e729273
AD
6792001-12-13 Akim Demaille <akim@epita.fr>
680
681 * src/print.c (print_actions): Output the handling of `$' as the
682 traces do: shifting the token EOF. Before EOF was treated as a
683 nonterminal.
684 * tests/regression.at: Adjust some tests.
685 * src/print_graph.c (print_core): Complete the set of items via
686 closure. The next-to-final and final states are still unsatisfying,
687 but that's to be addressed elsewhere.
688 No longer output the rule numbers, but do output the state number.
689 A single loop for the shifts + gotos is enough, but picked a
690 distinct color for each.
691 (print_graph): Initialize and finalize closure.
692
107f7dfb
AD
6932001-12-13 Akim Demaille <akim@epita.fr>
694
695 * src/reader.c (readgram): Remove dead code, an strip useless
696 braces.
697 (get_type): Remove, unused.
698
9b53a24f
AD
6992001-12-12 Akim Demaille <akim@epita.fr>
700
701 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
702 on that of lib/error.c.
703
dbfb6dcd
AD
7042001-12-12 Akim Demaille <akim@epita.fr>
705
706 Some hosts don't like `/' in includes.
707
708 * src/system.h: Include libgettext.h without qualifying the path.
709 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
710 $(top_srcdir).
711
c25fb648
MA
7122001-12-11 Marc Autret <autret_m@epita.fr>
713
714 * src/output.c (output_parser): Remove useless muscle.
715
710ddc4f
MA
7162001-12-11 Marc Autret <autret_m@epita.fr>
717
718 * src/bison.simple: Remove #line just before %%epilogue. It
719 is now handled in ...
720 * src/reader.c (read_additionnal_code): Add the output of a
721 #line for the epilogue.
722
e83d80b8
MA
7232001-12-10 Marc Autret <autret_m@epita.fr>
724
927c1557 725 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
726 replace precedent remove.
727 * src/bison.simple: Remove #line before %%prologue because
728 %%input-line is wrong at this time.
729
971d5158
MA
7302001-12-10 Marc Autret <autret_m@epita.fr>
731
732 * src/reader.c (symbols_output): Clean up.
927c1557 733 * src/output.c (output_gram, output): Clean up.
971d5158 734
5edafffd
AD
7352001-12-10 Akim Demaille <akim@epita.fr>
736
737 * src/lalr.c (initialize_lookaheads): New. Extracted from...
738 * src/LR0.c (set_state_table): here.
739 * src/lalr.c (lalr): Call it.
740
0279f8e9
AD
7412001-12-10 Akim Demaille <akim@epita.fr>
742
743 * src/state.h (shifts): Remove the `number' member: shifts are
744 attached to state, hence no longer need to be labelled with a
745 state number.
746
190c4f5f
AD
7472001-12-10 Akim Demaille <akim@epita.fr>
748
749 Now that states have a complete set of members, the linked list of
750 shifts is useless: just fill directly the state's shifts member.
751
752 * src/state.h (shifts): Remove the `next' member.
753 * src/LR0.c (first_state, last_state): Remove.
754 Adjust the callers.
755 (augment_automaton): Don't look for the shifts that must be added
756 a shift on EOF: it is those of the state we looked for! But now,
757 since shifts are attached, it is no longer needed to looking
758 merely by its id: its number.
759
2a73b93d
AD
7602001-12-10 Akim Demaille <akim@epita.fr>
761
762 * src/LR0.c (augment_automaton): Better variable locality.
763 Remove an impossible branch: if there is a state corresponding to
764 the start symbol being shifted, then there is shift for the start
765 symbol from the initial state.
766
74392f6a
AD
7672001-12-10 Akim Demaille <akim@epita.fr>
768
769 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
770 only when appropriate: when insert_start_shifting_state' is not
771 invoked.
772 * tests/regression.at (Rule Line Numbers): Adjust.
773
37c82725
AD
7742001-12-10 Akim Demaille <akim@epita.fr>
775
776 * src/LR0.c (augment_automaton): Now that all states have shifts,
777 merge the two cases addition shifts to the initial state.
778
6a164e0c
AD
7792001-12-10 Akim Demaille <akim@epita.fr>
780
781 * src/lalr.c (set_state_table): Move to...
782 * src/LR0.c: here.
783 * src/lalr.c (lalr): Don't call it...
784 * src/LR0.c (generate_states): do it.
785 * src/LR0.h (first_state): Remove, only the table is used.
786
7215de24
AD
7872001-12-10 Akim Demaille <akim@epita.fr>
788
789 * src/LR0.h (first_shift, first_reduction): Remove.
790 * src/lalr.c: Don't use first_shift: find shifts through the
791 states.
792
80e25d4d
AD
7932001-12-10 Akim Demaille <akim@epita.fr>
794
795 * src/LR0.c: Attach shifts to states as soon as they are
796 computed.
797 * src/lalr.c (set_state_table): Instead of assigning shifts to
798 state, just assert that the mapping was properly done.
799
0ab3728b
AD
8002001-12-10 Akim Demaille <akim@epita.fr>
801
802 * src/LR0.c (insert_start_shift): Rename as...
803 (insert_start_shifting_state): this.
804 (insert_eof_shifting_state, insert_accepting_state): New.
805 (augment_automaton): Adjust.
806 Better locality of the variables.
807 When looking if the start_symbol is shifted from the initial
808 state, using `while (... symbol != start_symbol ...)' sounds
809 better than `while (... symbol < start_symbol ...)': If fail
810 to see how the order between symbols could be relevant!
811
78af9bbc
AD
8122001-12-10 Akim Demaille <akim@epita.fr>
813
814 * src/getargs.h: Don't declare `spec_name_prefix' and
815 `spec_file_prefix', declared by src/files.h.
816 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
817 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
818 * src/output.c (prepare): Adjust.
819 * src/reader.c (symbols_output): Likewise.
820 * src/vmsgetargs.c: Vaguely adjust, but who cares?
821
bdef2a41
AD
8222001-12-10 Akim Demaille <akim@epita.fr>
823
824 * src/muscle_tab.c (muscle_init): NULL is a better default than
825 `"0"'.
826
3735969c
AD
8272001-12-10 Akim Demaille <akim@epita.fr>
828
829 * src/reader.c (reader): Calling symbols_output once is enough.
830
49701457
AD
8312001-12-10 Akim Demaille <akim@epita.fr>
832
833 Now that states have a complete set of members, the linked list of
834 reductions is useless: just fill directly the state's reductions
835 member.
836
837 * src/state.h (struct reductions): Remove member `number' and
838 `next'.
839 * src/LR0.c (first_reduction, last_reduction): Remove.
840 (save_reductions): Don't link the new reductions, store them in
841 this_state.
842 * src/lalr.c (set_state_table): No need to attach reductions to
843 states, it's already done.
844 * src/output.c (output_actions): No longer free the shifts, then
845 the reductions, then the states: free all the states and their
846 members.
847
0edad749
AD
8482001-12-10 Akim Demaille <akim@epita.fr>
849
850 * src/options.c (OPTN, DRTV, BOTH): New.
851 (option_table): Use them.
852
0edad749
AD
853 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
854 the job of system.h.
855 * src/options.c: Don't include stdio.h and xalloc.h for the same
856 reasons.
857
5449dd0f
AD
8582001-12-10 Akim Demaille <akim@epita.fr>
859
860 * src/output.c (output, prepare): Make sure the values of the
861 muscles `action' and `prologue' are 0-terminated.
862
a870c567
AD
8632001-12-10 Akim Demaille <akim@epita.fr>
864
865 Clean up GCC warnings.
866
867 * src/reader.c (copy_action): `buf' is not used.
868 (parse_skel_decl): Be static.
869 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
870 * src/options.h (create_long_option_table): Have a real prototype.
871 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
872 (hash_delete_at): Return const void *.
873 Adjust casts to preserve the const.
874
80df8768
AD
8752001-12-10 Akim Demaille <akim@epita.fr>
876
877 * configure.in: Require 2.52g.
878 M4 is not needed, but AUTOM4TE is.
879 * m4/m4.m4: Remove.
880 * tests/Makefile.am: Adjust.
881
f693ad14
AD
8822001-12-10 Akim Demaille <akim@epita.fr>
883
884 One structure for states is enough, even though theoretically
885 there are LR(0) states and LALR(1) states.
886
887 * src/lalr.h (state_t): Remove.
888 (state_table): Be state_t **, not state_t *.
889 * src/state.h (core, CORE_ALLOC): Rename as...
890 (state_t, STATE_ALLOC): this.
891 Add the LALR(1) members: shifts, reductions, errs.
892 * src/LR0.c (state_table): Rename as...
893 (state_hash): this, to avoid name clashes with the global
894 `state_table'.
895 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
896 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
897
74ffbcb6
AD
8982001-12-10 Akim Demaille <akim@epita.fr>
899
900 Bison dumps core on bash.y.
901 Reported by Pascal Bart.
902
903 * src/warshall.c (bitmatrix_print): New.
904 (TC): Use it.
905 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
906 j must be the outer loop.
907 * tests/regression.at (Broken Closure): New.
908
07708e19
AD
9092001-12-05 Akim Demaille <akim@epita.fr>
910
911 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
912 its argument.
913