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