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