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