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