]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* src/skeleton.h: New.
[bison.git] / ChangeLog
... / ...
CommitLineData
12001-12-30 Akim Demaille <akim@epita.fr>
2
3 * src/skeleton.h: New.
4 * src/output.c (output_parser, output_master_parser): Remove, dead
5 code.
6 * src/output.h (get_lines_number, actions_output, guards_output)
7 (token_definitions_output): Prototype them.
8 * src/parse-skel.y: Add the license notice.
9 Include output.h and skeleton.h.
10 (process_skeleton): Returns void, and takes a single parameter.
11 * src/scan-skel.l: Add the license notice.
12 Include skeleton.h.
13 Don't use %option yylineno: it seems that then Flex imagines
14 REJECT has been used, and therefore it won't reallocate its
15 buffers (which makes no other sense to me than a bug). It results
16 in warnings for `unused: yy_flex_realloc'.
17
18 to guess if the generated parsers should have '.tab' in their
19 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
20
212001-12-30 Robert Anisko <robert.anisko@epita.fr>
22
23 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
24 (MUSCLE_INSERT_PREFIX): ...to there.
25 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
26 (MUSCLE_INSERT_PREFIX): Move from here...
27
28 * src/bison.hairy: Add a section directive. Put braces around muscle
29 names. This parser skeleton is still broken, but Bison should not
30 choke on a bad muscle 'syntax'.
31 * src/bison.simple: Add a section directive. Put braces around muscle
32 names.
33
34 * src/files.h (strsuffix, stringappend): Add declarations.
35 (tab_extension): Add declaration.
36 (short_base_name): Add declaration.
37
38 * src/files.c (strsuffix, stringappend): No longer static. These
39 functions are used in the skeleton parser.
40 (tab_extension): New.
41 (compute_base_names): Use the computations done in this function
42 to guess if the generated parsers should have '.tab' in their
43 names.
44 (short_base_name): No longer static.
45
46 * src/output.c (output_skeleton): New.
47 (output): Disable call to output_master_parser, and give a try to
48 a new skeleton handling system.
49 (guards_output, actions_output): No longer static.
50 (token_definitions_output, get_lines_number): No longer static.
51
52 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
53
54 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
55 parse-skel.y.
56
57 * src/parse-skel.y: New file.
58 * src/scan-skel.l: New file.
59
602001-12-29 Akim Demaille <akim@epita.fr>
61
62 %name-prefix is broken.
63
64 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
65 Adjust all dependencies.
66 * tests/headers.at (export YYLTYPE): Strengthen this test: use
67 %name-prefix.
68
69 Renaming yylval but not yylloc is not consistent. Now we do.
70
71 * src/bison.simple: Prefix yylloc if used.
72 * doc/bison.texinfo (Decl Summary): Document that.
73
742001-12-29 Akim Demaille <akim@epita.fr>
75
76 * doc/bison.texinfo: Promote `%long-directive' over
77 `%long_directive'.
78 Remove all references to fixed-output-files, yacc is enough.
79
802001-12-29 Akim Demaille <akim@epita.fr>
81
82 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
83 user prologue. These are defaults.
84 * tests/actions.at (Mid-rule actions): Make sure the user can
85 define YYDEBUG and YYERROR_VERBOSE.
86
872001-12-29 Akim Demaille <akim@epita.fr>
88
89 * src/output.c (header_output): Don't forget to export YYLTYPE and
90 yylloc.
91 * tests/headers.at (export YYLTYPE): New, make sure it does.
92 * tests/regression.at (%union and --defines, Invalid CPP headers):
93 Move to...
94 * tests/headers.at: here.
95
962001-12-29 Akim Demaille <akim@epita.fr>
97
98 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
99
1002001-12-29 Akim Demaille <akim@epita.fr>
101
102 * tests/actions.at (Mid-rule actions): Output on a single line
103 instead of several.
104
1052001-12-29 Akim Demaille <akim@epita.fr>
106
107 * doc/bison.texinfo: Formatting changes.
108
1092001-12-29 Akim Demaille <akim@epita.fr>
110
111 Don't store the token defs in a muscle, just be ready to output it
112 on command. Now possible via `symbols'. Fixes a memory leak.
113
114 * src/output.c (token_definitions_output): New.
115 (output_parser, header_output): Use it.
116 * src/reader.c (symbols_save): Remove.
117
1182001-12-29 Akim Demaille <akim@epita.fr>
119
120 * src/bison.simple: Do not provide a default for YYSTYPE and
121 YYLTYPE before the user's prologue. Otherwise it's hardly... a
122 default.
123
1242001-12-29 Akim Demaille <akim@epita.fr>
125
126 Mid-rule actions are simply... ignored!
127
128 * src/reader.c (readgram): Be sure to attach mid-rule actions to
129 the empty-rule associated to the dummy symbol, not to the host
130 rule.
131 * tests/actions.at (Mid-rule actions): New.
132
1332001-12-29 Akim Demaille <akim@epita.fr>
134
135 Memory leak.
136
137 * src/reader.c (reader): Free grammar.
138
1392001-12-29 Akim Demaille <akim@epita.fr>
140
141 Memory leak.
142
143 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
144 since it allocates it for each state, although only one is needed.
145 (allocate_storage): Do it here.
146
1472001-12-29 Akim Demaille <akim@epita.fr>
148
149 * src/options.h, src/options.c (create_long_option_table): Rename
150 as...
151 (long_option_table_new): this, with a clearer prototype.
152 (percent_table): Remove, unused,
153 * src/getargs.c (getargs): Adjust.
154
1552001-12-29 Akim Demaille <akim@epita.fr>
156
157 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
158 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
159 as states.
160
1612001-12-29 Akim Demaille <akim@epita.fr>
162
163 * src/lalr.c (build_relations): Rename `states' as `states1'.
164 Sorry, I don't understand exactly what it is, no better name...
165
1662001-12-29 Akim Demaille <akim@epita.fr>
167
168 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
169 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
170 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
171 as rules.
172
1732001-12-29 Akim Demaille <akim@epita.fr>
174
175 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
176 ago.
177
1782001-12-29 Akim Demaille <akim@epita.fr>
179
180 * src/reader.c, src/reader.h (user_toknums): Remove.
181 Adjust all users to use symbols[i]->user_token_number.
182
1832001-12-29 Akim Demaille <akim@epita.fr>
184
185 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
186 Adjust all users to use symbols[i]->prec or ->assoc.
187
1882001-12-29 Akim Demaille <akim@epita.fr>
189
190 * src/reader.c, src/reader.h (tags): Remove.
191 Adjust all users to use symbols[i]->tag.
192
1932001-12-29 Akim Demaille <akim@epita.fr>
194
195 * src/gram.h, src/gram.c (symbols): New, similar to state_table
196 and rule_table.
197 * src/reader.c (packsymbols): Fill this table.
198 Drop sprec.
199 * src/conflicts.c (resolve_sr_conflict): Adjust.
200 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
201 single table.
202 Use symbols[i]->tag instead of tags[i].
203
2042001-12-29 Akim Demaille <akim@epita.fr>
205
206 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
207 In addition, put a comment in there, to replace...
208 * tests/regression.at (%union and C comments): Remove.
209
2102001-12-29 Akim Demaille <akim@epita.fr>
211
212 * tests/regression.at (Web2c Actions): Blindly move the actual
213 output as expected output. The contents *seem* right to me, but I
214 can't pretend reading perfectly parser tables... Nonetheless, all
215 the other tests pass correctly, the table look OK, even though the
216 presence of `$axiom' is to be noted: AFAICS it is useless (but
217 harmless).
218
2192001-12-29 Akim Demaille <akim@epita.fr>
220
221 * src/reader.c (readgram): Don't add the rule 0 if there were no
222 rules read. In other words, add it _after_ having performed
223 grammar sanity checks.
224 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
225
2262001-12-29 Akim Demaille <akim@epita.fr>
227
228 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
229 visible, and some states have now a different number.
230
2312001-12-29 Akim Demaille <akim@epita.fr>
232
233 * src/reader.c (readgram): Bind the initial rule's lineno to that
234 of the first rule.
235 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
236 (Solved SR Conflicts): Adjust rule 0's line number.
237
2382001-12-29 Akim Demaille <akim@epita.fr>
239
240 Fix the `GAWK Grammar' failure.
241
242 * src/LR0.c (final_state): Initialize to -1 so that we do compute
243 the reductions of the first state which was mistakenly confused
244 with the final state because precisely final_state was initialized
245 to 0.
246 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
247 now noticed by Bison.
248 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
249 have a reduction on $default.
250
2512001-12-29 Akim Demaille <akim@epita.fr>
252
253 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
254 rule line numbers.
255 * src/closure.c (print_closure): Likewise.
256 * src/derives.c (print_derives): Likewise.
257 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
258 now.
259
2602001-12-29 Akim Demaille <akim@epita.fr>
261
262 * src/lalr.c (lookaheads_print): New.
263 (lalr): Call it when --trace-flag.
264 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
265 are dumped.
266
2672001-12-29 Akim Demaille <akim@epita.fr>
268
269 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
270 when walking through ritem, even via rule->rhs.
271 * src/reduce.c (dump_grammar, useful_production, reduce_output)
272 (useful_production, useless_nonterminals): Likewise.
273 (reduce_grammar_tables): Likewise, plus update nritems.
274 * src/nullable.c (set_nullable): Likewise.
275 * src/lalr.c (build_relations): Likewise.
276 * tests/sets.at (Nullable): Adjust.
277 Fortunately, now, the $axiom is no longer nullable.
278
2792001-12-29 Akim Demaille <akim@epita.fr>
280
281 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
282 the 0-sentinel.
283 * src/gram.c (ritem_longest_rhs): Likewise.
284 * src/reduce.c (nonterminals_reduce): Likewise.
285 * src/print_graph.c (print_graph): Likewise.
286 * src/output.c (output_rule_data): Likewise.
287 * src/nullable.c (set_nullable): Likewise.
288
2892001-12-29 Akim Demaille <akim@epita.fr>
290
291 * src/output.c: Comment changes.
292
2932001-12-27 Paul Eggert <eggert@twinsun.com>
294
295 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
296 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
297 Sparc, as they were causing more porting problems than the
298 (minor) performance improvement was worth.
299
300 Also, catch up with 1.31's YYSTD.
301
3022001-12-27 Akim Demaille <akim@epita.fr>
303
304 * src/output.c (output_gram): Rely on nritems, not the
305 0-sentinel. See below.
306 Use -1 as separator, not 0.
307 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
308 Rely on -1 as separator in yyrhs, instead of 0.
309 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
310 twice `Now at end of input', therefore there are two lines less to
311 expect.
312
3132001-12-27 Akim Demaille <akim@epita.fr>
314
315 * tests/regression.at (Unresolved SR Conflicts):
316 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
317 below.
318
3192001-12-27 Akim Demaille <akim@epita.fr>
320
321 * src/LR0.c (new_state): Recognize the final state by the fact it
322 is reached by eoftoken.
323 (insert_start_shifting_state, insert_eof_shifting_state)
324 (insert_accepting_state, augment_automaton): Remove, since now
325 these states are automatically computed from the initial state.
326 (generate_states): Adjust.
327 * src/print.c: When reporting a rule number to the user, substract
328 1, so that the axiom rule is rule 0, and the first user rule is 1.
329 * src/reduce.c: Likewise.
330 * src/print_graph.c (print_core): For the time being, just as for
331 the report, depend upon --trace-flags to dump the full set of
332 items.
333 * src/reader.c (readgram): Once the grammar read, insert the rule
334 0: `$axiom: START-SYMBOL $'.
335 * tests/set.at: Adjust: rule 0 is now displayed, and since the
336 number of the states has changed (the final state is no longer
337 necessarily the last), catch up.
338
3392001-12-27 Akim Demaille <akim@epita.fr>
340
341 Try to make the use of the eoftoken valid. Given that its value
342 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
343 is used instead of > 0 where appropriate, (ii), depend upon nritems
344 instead of the 0-sentinel.
345
346 * src/gram.h, src/gram.c (nritems): New.
347 Expected to be duplication of nitems, but for the time being...
348 * src/reader.c (packgram): Assert nritems and nitems are equal.
349 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
350 * src/closure.c (print_closure, print_fderives): Likewise.
351 * src/gram.c (ritem_print): Likewise.
352 * src/print.c (print_core, print_grammar): Likewise.
353 * src/print_graph.c: Likewise.
354
3552001-12-27 Akim Demaille <akim@epita.fr>
356
357 * src/main.c (main): If there are complains after grammar
358 reductions, then output the report anyway if requested, then die.
359 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
360 * src/reader.c (eoftoken): New.
361 (parse_token_decl): If the token being defined has value `0', it
362 is the eoftoken.
363 (packsymbols): No longer hack `tags' to insert `$' by hand.
364 Be sure to preserve the value of the eoftoken.
365 (reader): Make sure eoftoken is defined.
366 Initialize nsyms to 0: now eoftoken is created just like the others.
367 * src/print.c (print_grammar): Don't special case the eof token.
368 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
369 lie anyway, albeit pleasant.
370 * tests/calc.at: Exercise error messages with eoftoken.
371 Change the grammar so that empty input is invalid.
372 Adjust expectations.
373 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
374
3752001-12-27 Akim Demaille <akim@epita.fr>
376
377 * configure.in: Check the protos of strchr ans strspn.
378 Replace strchr if needed.
379 * src/system.h: Provide the protos of strchr, strspn and memchr if
380 missing.
381 * lib/strchr.c: New.
382 * src/reader.c (symbols_save): Use strchr.
383
3842001-12-27 Akim Demaille <akim@epita.fr>
385
386 * src/print.c, src/print_graph.c (escape): New.
387 Use it to quote the TAGS outputs.
388 * src/print_graph.c (print_state): Now errors are in red, and
389 reductions in green.
390 Prefer high to wide: output the state number on a line of its own.
391
3922001-12-27 Akim Demaille <akim@epita.fr>
393
394 * src/state.h, src/state.c (reductions_new): New.
395 * src/LR0.c (set_state_table): Let all the states have a
396 `reductions', even if reduced to 0.
397 (save_reductions): Adjust.
398 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
399 * src/print.c (print_reductions, print_actions): Adjust.
400 * src/output.c (action_row): Adjust.
401
4022001-12-27 Akim Demaille <akim@epita.fr>
403
404 * src/state.h, src/state.c (errs_new, errs_dup): New.
405 * src/LR0.c (set_state_table): Let all the states have an errs,
406 even if reduced to 0.
407 * src/print.c (print_errs, print_reductions): Adjust.
408 * src/output.c (output_actions, action_row): Adjust.
409 * src/conflicts.c (resolve_sr_conflict): Adjust.
410
4112001-12-27 Akim Demaille <akim@epita.fr>
412
413 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
414
4152001-12-27 Akim Demaille <akim@epita.fr>
416
417 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
418 * src/print.c: here.
419 (lookaheadset, shiftset): New, used as additional storage by
420 print_reductions.
421 (print_results): Adjust.
422 (print_shifts, print_gotos, print_errs): New, extracted from...
423 (print_actions): here.
424 * src/print_graph.c (print_actions): Remove dead code.
425
4262001-12-27 Akim Demaille <akim@epita.fr>
427
428 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
429 `$n' and `@n'.
430
4312001-12-27 Akim Demaille <akim@epita.fr>
432
433 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
434 (build_relations): Adjust.
435
4362001-12-27 Akim Demaille <akim@epita.fr>
437
438 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
439 duplication.
440
4412001-12-27 Akim Demaille <akim@epita.fr>
442
443 * src/reader.c (packgram): Catch nitems overflows.
444
4452001-12-27 Akim Demaille <akim@epita.fr>
446
447 * src/files.c, src/files.h (guard_obstack): Remove.
448 * src/output.c (output): Adjust.
449 * src/reader.c (parse_braces): New, factoring...
450 (copy_action, copy_guard): these two which are renamed as...
451 (parse_action, parse_guard): these.
452 As a voluntary consequence, using braces around guards is now
453 mandatory.
454
4552001-12-27 Akim Demaille <akim@epita.fr>
456
457 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
458 * src/reader.c (symbol_list): `guard' and `guard_line' are new
459 members.
460 (symbol_list_new): Adjust.
461 (copy_action): action_line is the first line, not the last.
462 (copy_guard): Just as for actions, store the `action' only, not
463 the switch/case/break flesh.
464 Don't parse the user action that might follow the guard, let...
465 (readgram): do it, i.e., now, there can be an action after a
466 guard.
467 In other words the guard is just explicitly optional.
468 (packgram): Adjust.
469 * src/output.c (guards_output): New.
470 (output_parser): Call it when needed.
471 (output): Also free the guard and attrs obstacks.
472 * src/files.c, src/files.h (obstack_save): Remove.
473 (output_files): Remove.
474 As a result, if one needs the former `.act' file, using an
475 appropriate skeleton which requires actions and guards is now
476 required.
477 * src/main.c (main): Adjust.
478 * tests/semantic.at: New.
479 * tests/regression.at: Use `input.y' as input file name.
480 Avoid 8+3 problems by requiring input.c when the test needs the
481 parser.
482
4832001-12-27 Akim Demaille <akim@epita.fr>
484
485 * src/reader.c (symbol_list_new): Be sure to initialize all the
486 fields.
487
4882001-12-27 Akim Demaille <akim@epita.fr>
489
490 All the hacks using a final pseudo state are now useless.
491
492 * src/LR0.c (set_state_table): state_table holds exactly nstates.
493 * src/lalr.c (nLA): New.
494 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
495 instead of lookaheadsp from the pseudo state (nstate + 1).
496
4972001-12-27 Akim Demaille <akim@epita.fr>
498
499 * src/output.c (action_row, token_actions): Use a state_t instead
500 of a integer, and nlookaheads instead of the following state's
501 lookaheadsp.
502
5032001-12-27 Akim Demaille <akim@epita.fr>
504
505 * src/conflicts.c (log_resolution, flush_shift)
506 (resolve_sr_conflict, set_conflicts, solve_conflicts)
507 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
508 (conflicts_print, print_reductions): Use a state_t instead of an
509 integer when referring to a state.
510 As much as possible, depend upon nlookaheads, instead of the
511 `lookaheadsp' member of the following state (since lookaheads of
512 successive states are successive, the difference between state n + 1
513 and n served as the number of lookaheads for state n).
514 * src/lalr.c (add_lookback_edge): Likewise.
515 * src/print.c (print_core, print_actions, print_state)
516 (print_results): Likewise.
517 * src/print_graph.c (print_core, print_actions, print_state)
518 (print_graph): Likewise.
519 * src/conflicts.h: Adjust.
520
5212001-12-27 Akim Demaille <akim@epita.fr>
522
523 * src/bison.hairy: Formatting/comment changes.
524 ANSIfy.
525 Remove `register' indications.
526 Add plenty of `static'.
527
5282001-12-27 Akim Demaille <akim@epita.fr>
529
530 * src/output.c (prepare): Drop the muscle `ntbase' which
531 duplicates ntokens.
532 * src/bison.simple: Formatting/comment changes.
533 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
534 is an undocumented synonym.
535
5362001-12-22 Akim Demaille <akim@epita.fr>
537
538 * src/output.c (output_table_data): Change the prototype to use
539 `int' for array ranges: some invocations do pass an int, not a
540 short.
541 Reported by Wayne Green.
542
5432001-12-22 Akim Demaille <akim@epita.fr>
544
545 Some actions of web2c.y are improperly triggered.
546 Reported by Mike Castle.
547
548 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
549 * tests/regression.at (Web2c): Rename as...
550 (Web2c Report): this.
551 (Web2c Actions): New.
552
5532001-12-22 Akim Demaille <akim@epita.fr>
554
555 Reductions in web2c.y are improperly reported.
556 Reported by Mike Castle.
557
558 * src/conflicts.c (print_reductions): Fix.
559 * tests/regression.at (Web2c): New.
560
5612001-12-18 Akim Demaille <akim@epita.fr>
562
563 Some host fail on `assert (!"foo")', which expands to
564 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
565 Reported by Nelson Beebee.
566
567 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
568 `#define it_succeeded 0' and `assert (it_succeeded)'.
569
5702001-12-17 Marc Autret <autret_m@epita.fr>
571
572 * src/bison.simple: Don't hard code the skeleton line and filename.
573 * src/output.c (output_parser): Rename 'line' as 'output_line'.
574 New line counter 'skeleton_line' (skeleton-line muscle).
575
5762001-12-17 Paul Eggert <eggert@twinsun.com>
577
578 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
579 YYDEBUG must be defined to a nonzero value.
580
581 * src/bison.simple (yytname): Do not assume that the user defines
582 YYDEBUG to a properly parenthesized expression.
583
5842001-12-17 Akim Demaille <akim@epita.fr>
585
586 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
587 nlookaheads is a new member.
588 Adjust all users.
589 * src/lalr.h (nlookaheads): Remove this orphan declaration.
590 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
591 state.
592
5932001-12-17 Akim Demaille <akim@epita.fr>
594
595 * src/files.h, src/files.c (open_files, close_files): Remove.
596 * src/main.c (main): Don't open/close files, nor invoke lex_free,
597 let...
598 * src/reader.c (reader): Do it.
599
6002001-12-17 Akim Demaille <akim@epita.fr>
601
602 * src/conflicts.c (print_reductions): Formatting changes.
603
6042001-12-17 Akim Demaille <akim@epita.fr>
605
606 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
607 (flush_reduce): New.
608 (resolve_sr_conflict): Adjust.
609
6102001-12-17 Akim Demaille <akim@epita.fr>
611
612 * src/output.c (output_obstack): Be static and rename as...
613 (format_obstack): this, to avoid any confusion with files.c's
614 output_obstack.
615 * src/reader.h (muscle_obstack): Move to...
616 * src/output.h: here, since it's defined in output.c.
617
6182001-12-17 Akim Demaille <akim@epita.fr>
619
620 * src/output.c (action_row, save_column, default_goto)
621 (sort_actions, matching_state, pack_vector): Better variable
622 locality.
623
6242001-12-17 Akim Demaille <akim@epita.fr>
625
626 * src/output.c: Various formatting changes.
627
6282001-12-17 Akim Demaille <akim@epita.fr>
629
630 * src/files.c (output_files): Free the output_obstack.
631 * src/main.c (main): Call print and print_graph conditionally.
632 * src/print.c (print): Work unconditionally.
633 * src/print_graph.c (print_graph): Work unconditionally.
634 * src/conflicts.c (log_resolution): Output only if verbose_flag.
635
6362001-12-16 Marc Autret <autret_m@epita.fr>
637
638 * src/output.c (actions_output): Fix. When we use %no-lines,
639 there is one less line per action.
640
6412001-12-16 Marc Autret <autret_m@epita.fr>
642
643 * src/bison.simple: Remove a useless #line directive.
644 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
645 * src/output.c (get_lines_number): New.
646 (output_parser): Adjust, now takes care about the lines of a
647 output muscles.
648 Fix line numbering.
649 (actions_output): Computes the number of lines taken by actions.
650 (output_master_parser): Insert new skeleton which is the name of
651 the output parser file name.
652
6532001-12-15 Marc Autret <autret_m@epita.fr>
654
655 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
656
6572001-12-15 Marc Autret <autret_m@epita.fr>
658
659 * src/output.c (output_gram): Keep track of the hairy one.
660
6612001-12-15 Akim Demaille <akim@epita.fr>
662
663 Make `make distcheck' work.
664
665 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
666 system.h which uses libgettext.h.
667
6682001-12-15 Akim Demaille <akim@epita.fr>
669
670 * src/nullable.c (set_nullable): Useless rules must be skipped,
671 otherwise, since we range over their symbols, we might look at a
672 nonterminal which no longer ``exists'', i.e., it is not counted in
673 `nvars', hence we overflow our arrays.
674
6752001-12-15 Akim Demaille <akim@epita.fr>
676
677 The header can also be produced directly, without any obstack!
678 Yahoo!
679
680 * src/files.c, src/files.h (defines_obstack): Remove.
681 (compute_header_macro): Global.
682 (defines_obstack_save): Remove.
683 * src/reader.c (parse_union_decl): No longer output to
684 defines_obstack: its content can be found in the `stype' muscle
685 anyway.
686 (output_token_translations): Merge into...
687 (symbols_output): this.
688 Rename as...
689 (symbols_save): this.
690 (reader): Adjust.
691 * src/output.c (header_output): New.
692 (output): Call it.
693
6942001-12-15 Akim Demaille <akim@epita.fr>
695
696 * src/reader.c (parse_union_decl): Instead of handling two obstack
697 simultaneously, use one to define the `stype' muscle, and use the
698 value of the latter to fill defines_obstack.
699 (copy_comment): Remove.
700 (copy_comment2): Work for a single obstack.
701 Rename as...
702 (copy_comment): this.
703
7042001-12-15 Akim Demaille <akim@epita.fr>
705
706 * src/lex.c, src/lex.h (xgetc): No longer static.
707 * src/reader.c (parse_union_decl): Revamp.
708
7092001-12-15 Akim Demaille <akim@epita.fr>
710
711 Still making progress in separating Bison into (i) input, (ii)
712 process, (iii) output: now we can directly output the parser file
713 without using table_obstack at all.
714
715 * src/files.c, src/files.h (table_obstack): Bye bye.
716 (parser_file_name): New.
717 * src/files.c (compute_output_file_names): Compute it.
718 * src/output.c (actions_output, output_parser)
719 (output_master_parser): To a file instead of an obstack.
720
7212001-12-15 Akim Demaille <akim@epita.fr>
722
723 Attach actions to rules, instead of pre-outputting them to
724 actions_obstack.
725
726 * src/gram.h (rule_t): action and action_line are new members.
727 * src/reader.c (symbol_list): Likewise.
728 (copy_action): Save the actions within the rule.
729 (packgram): Save them in rule_table.
730 * src/output.c (actions_output): New.
731 (output_parser): Use it on `%%actions'.
732 (output_rule_data): Don't free rule_table.
733 (output): Do it.
734 (prepare): Don't save the `action' muscle.
735 * src/bison.simple: s/%%action/%%actions/.
736
7372001-12-15 Akim Demaille <akim@epita.fr>
738
739 * src/reader.c (copy_action): When --yacc, don't append a `;'
740 to the user action: let it fail if lacking.
741 Suggested by Arnold Robbins and Tom Tromey.
742
7432001-12-14 Akim Demaille <akim@epita.fr>
744
745 * src/lex.c (literalchar): Simply return the char you decoded, non
746 longer mess around with obstacks and int pointers.
747 Adjust all callers.
748
7492001-12-14 Akim Demaille <akim@epita.fr>
750
751 * src/lex.c (literalchar): Don't escape the special characters,
752 just decode them, and keep them as char (before, eol was output as
753 the 2 char string `\n' etc.).
754 * src/output.c (output_rule_data): Use quotearg to output the
755 token strings.
756
7572001-12-13 Paul Eggert <eggert@twinsun.com>
758
759 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
760 Do not infringe on the global user namespace when using C++.
761 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
762 All uses of `fprintf' and `stderr' changed.
763
764 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
765
7662001-12-13 Akim Demaille <akim@epita.fr>
767
768 The computation of nullable is broken: it doesn't handle empty
769 RHS's properly.
770
771 * tests/torture.at (GNU AWK Grammar): New.
772 * tests/sets.at (Nullable): New.
773 * src/nullable.c (set_nullable): Instead of blindly looping over
774 `ritems', loop over the rules, and then over their rhs's.
775
776 Work around Autotest bugs.
777
778 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
779 frame, because Autotest understand lines starting with a `+' as
780 traces from the shell. Then, they are not processed properly.
781 Admittedly an Autotest bug, but we don't have time to wait for
782 Autotest to catch up.
783 * tests/regression.at (Broken Closure): Adjust to the new table
784 frames.
785 Move to...
786 * tests/sets.at: here.
787
7882001-12-13 Akim Demaille <akim@epita.fr>
789
790 * src/closure.c (closure): Use nrules instead of playing tricks
791 with BITS_PER_WORD.
792
7932001-12-13 Akim Demaille <akim@epita.fr>
794
795 * src/print.c (print_actions): Output the handling of `$' as the
796 traces do: shifting the token EOF. Before EOF was treated as a
797 nonterminal.
798 * tests/regression.at: Adjust some tests.
799 * src/print_graph.c (print_core): Complete the set of items via
800 closure. The next-to-final and final states are still unsatisfying,
801 but that's to be addressed elsewhere.
802 No longer output the rule numbers, but do output the state number.
803 A single loop for the shifts + gotos is enough, but picked a
804 distinct color for each.
805 (print_graph): Initialize and finalize closure.
806
8072001-12-13 Akim Demaille <akim@epita.fr>
808
809 * src/reader.c (readgram): Remove dead code, an strip useless
810 braces.
811 (get_type): Remove, unused.
812
8132001-12-12 Akim Demaille <akim@epita.fr>
814
815 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
816 on that of lib/error.c.
817
8182001-12-12 Akim Demaille <akim@epita.fr>
819
820 Some hosts don't like `/' in includes.
821
822 * src/system.h: Include libgettext.h without qualifying the path.
823 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
824 $(top_srcdir).
825
8262001-12-11 Marc Autret <autret_m@epita.fr>
827
828 * src/output.c (output_parser): Remove useless muscle.
829
8302001-12-11 Marc Autret <autret_m@epita.fr>
831
832 * src/bison.simple: Remove #line just before %%epilogue. It
833 is now handled in ...
834 * src/reader.c (read_additionnal_code): Add the output of a
835 #line for the epilogue.
836
8372001-12-10 Marc Autret <autret_m@epita.fr>
838
839 * src/reader.c (copy_definition): Re-use CPP-outed code which
840 replace precedent remove.
841 * src/bison.simple: Remove #line before %%prologue because
842 %%input-line is wrong at this time.
843
8442001-12-10 Marc Autret <autret_m@epita.fr>
845
846 * src/reader.c (symbols_output): Clean up.
847 * src/output.c (output_gram, output): Clean up.
848
8492001-12-10 Akim Demaille <akim@epita.fr>
850
851 * src/lalr.c (initialize_lookaheads): New. Extracted from...
852 * src/LR0.c (set_state_table): here.
853 * src/lalr.c (lalr): Call it.
854
8552001-12-10 Akim Demaille <akim@epita.fr>
856
857 * src/state.h (shifts): Remove the `number' member: shifts are
858 attached to state, hence no longer need to be labelled with a
859 state number.
860
8612001-12-10 Akim Demaille <akim@epita.fr>
862
863 Now that states have a complete set of members, the linked list of
864 shifts is useless: just fill directly the state's shifts member.
865
866 * src/state.h (shifts): Remove the `next' member.
867 * src/LR0.c (first_state, last_state): Remove.
868 Adjust the callers.
869 (augment_automaton): Don't look for the shifts that must be added
870 a shift on EOF: it is those of the state we looked for! But now,
871 since shifts are attached, it is no longer needed to looking
872 merely by its id: its number.
873
8742001-12-10 Akim Demaille <akim@epita.fr>
875
876 * src/LR0.c (augment_automaton): Better variable locality.
877 Remove an impossible branch: if there is a state corresponding to
878 the start symbol being shifted, then there is shift for the start
879 symbol from the initial state.
880
8812001-12-10 Akim Demaille <akim@epita.fr>
882
883 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
884 only when appropriate: when insert_start_shifting_state' is not
885 invoked.
886 * tests/regression.at (Rule Line Numbers): Adjust.
887
8882001-12-10 Akim Demaille <akim@epita.fr>
889
890 * src/LR0.c (augment_automaton): Now that all states have shifts,
891 merge the two cases addition shifts to the initial state.
892
8932001-12-10 Akim Demaille <akim@epita.fr>
894
895 * src/lalr.c (set_state_table): Move to...
896 * src/LR0.c: here.
897 * src/lalr.c (lalr): Don't call it...
898 * src/LR0.c (generate_states): do it.
899 * src/LR0.h (first_state): Remove, only the table is used.
900
9012001-12-10 Akim Demaille <akim@epita.fr>
902
903 * src/LR0.h (first_shift, first_reduction): Remove.
904 * src/lalr.c: Don't use first_shift: find shifts through the
905 states.
906
9072001-12-10 Akim Demaille <akim@epita.fr>
908
909 * src/LR0.c: Attach shifts to states as soon as they are
910 computed.
911 * src/lalr.c (set_state_table): Instead of assigning shifts to
912 state, just assert that the mapping was properly done.
913
9142001-12-10 Akim Demaille <akim@epita.fr>
915
916 * src/LR0.c (insert_start_shift): Rename as...
917 (insert_start_shifting_state): this.
918 (insert_eof_shifting_state, insert_accepting_state): New.
919 (augment_automaton): Adjust.
920 Better locality of the variables.
921 When looking if the start_symbol is shifted from the initial
922 state, using `while (... symbol != start_symbol ...)' sounds
923 better than `while (... symbol < start_symbol ...)': If fail
924 to see how the order between symbols could be relevant!
925
9262001-12-10 Akim Demaille <akim@epita.fr>
927
928 * src/getargs.h: Don't declare `spec_name_prefix' and
929 `spec_file_prefix', declared by src/files.h.
930 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
931 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
932 * src/output.c (prepare): Adjust.
933 * src/reader.c (symbols_output): Likewise.
934 * src/vmsgetargs.c: Vaguely adjust, but who cares?
935
9362001-12-10 Akim Demaille <akim@epita.fr>
937
938 * src/muscle_tab.c (muscle_init): NULL is a better default than
939 `"0"'.
940
9412001-12-10 Akim Demaille <akim@epita.fr>
942
943 * src/reader.c (reader): Calling symbols_output once is enough.
944
9452001-12-10 Akim Demaille <akim@epita.fr>
946
947 Now that states have a complete set of members, the linked list of
948 reductions is useless: just fill directly the state's reductions
949 member.
950
951 * src/state.h (struct reductions): Remove member `number' and
952 `next'.
953 * src/LR0.c (first_reduction, last_reduction): Remove.
954 (save_reductions): Don't link the new reductions, store them in
955 this_state.
956 * src/lalr.c (set_state_table): No need to attach reductions to
957 states, it's already done.
958 * src/output.c (output_actions): No longer free the shifts, then
959 the reductions, then the states: free all the states and their
960 members.
961
9622001-12-10 Akim Demaille <akim@epita.fr>
963
964 * src/options.c (OPTN, DRTV, BOTH): New.
965 (option_table): Use them.
966
967 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
968 the job of system.h.
969 * src/options.c: Don't include stdio.h and xalloc.h for the same
970 reasons.
971
9722001-12-10 Akim Demaille <akim@epita.fr>
973
974 * src/output.c (output, prepare): Make sure the values of the
975 muscles `action' and `prologue' are 0-terminated.
976
9772001-12-10 Akim Demaille <akim@epita.fr>
978
979 Clean up GCC warnings.
980
981 * src/reader.c (copy_action): `buf' is not used.
982 (parse_skel_decl): Be static.
983 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
984 * src/options.h (create_long_option_table): Have a real prototype.
985 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
986 (hash_delete_at): Return const void *.
987 Adjust casts to preserve the const.
988
9892001-12-10 Akim Demaille <akim@epita.fr>
990
991 * configure.in: Require 2.52g.
992 M4 is not needed, but AUTOM4TE is.
993 * m4/m4.m4: Remove.
994 * tests/Makefile.am: Adjust.
995
9962001-12-10 Akim Demaille <akim@epita.fr>
997
998 One structure for states is enough, even though theoretically
999 there are LR(0) states and LALR(1) states.
1000
1001 * src/lalr.h (state_t): Remove.
1002 (state_table): Be state_t **, not state_t *.
1003 * src/state.h (core, CORE_ALLOC): Rename as...
1004 (state_t, STATE_ALLOC): this.
1005 Add the LALR(1) members: shifts, reductions, errs.
1006 * src/LR0.c (state_table): Rename as...
1007 (state_hash): this, to avoid name clashes with the global
1008 `state_table'.
1009 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1010 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1011
10122001-12-10 Akim Demaille <akim@epita.fr>
1013
1014 Bison dumps core on bash.y.
1015 Reported by Pascal Bart.
1016
1017 * src/warshall.c (bitmatrix_print): New.
1018 (TC): Use it.
1019 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1020 j must be the outer loop.
1021 * tests/regression.at (Broken Closure): New.
1022
10232001-12-05 Akim Demaille <akim@epita.fr>
1024
1025 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1026 its argument.
1027