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