]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/system.h: We don't need nor want bcopy.
[bison.git] / ChangeLog
CommitLineData
a4b36db4
AD
12001-12-30 Akim Demaille <akim@epita.fr>
2
3 * src/system.h: We don't need nor want bcopy.
4 Throw away MS-DOS crap: we don't need getpid.
5 * configure.in: We don't need strndup. It was even causing
6 problems: because Flex includes the headers *before* us,
7 _GNU_SOURCE is not defined by config.h, and therefore strndup was
8 not visible.
9 * lib/xstrndup.c: New.
10 * src/scan-skel.l: Use it.
11 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12 * src/parse-skel.y: Use %directives instead of #defines.
13
14
1239777d
AD
152001-12-30 Akim Demaille <akim@epita.fr>
16
17 * src/skeleton.h: New.
18 * src/output.c (output_parser, output_master_parser): Remove, dead
19 code.
20 * src/output.h (get_lines_number, actions_output, guards_output)
21 (token_definitions_output): Prototype them.
22 * src/parse-skel.y: Add the license notice.
23 Include output.h and skeleton.h.
24 (process_skeleton): Returns void, and takes a single parameter.
25 * src/scan-skel.l: Add the license notice.
26 Include skeleton.h.
27 Don't use %option yylineno: it seems that then Flex imagines
28 REJECT has been used, and therefore it won't reallocate its
29 buffers (which makes no other sense to me than a bug). It results
30 in warnings for `unused: yy_flex_realloc'.
31
32 to guess if the generated parsers should have '.tab' in their
33 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
34
9b3add5b
RA
352001-12-30 Robert Anisko <robert.anisko@epita.fr>
36
37 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
38 (MUSCLE_INSERT_PREFIX): ...to there.
39 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
40 (MUSCLE_INSERT_PREFIX): Move from here...
41
42 * src/bison.hairy: Add a section directive. Put braces around muscle
43 names. This parser skeleton is still broken, but Bison should not
44 choke on a bad muscle 'syntax'.
45 * src/bison.simple: Add a section directive. Put braces around muscle
46 names.
47
48 * src/files.h (strsuffix, stringappend): Add declarations.
49 (tab_extension): Add declaration.
50 (short_base_name): Add declaration.
51
52 * src/files.c (strsuffix, stringappend): No longer static. These
53 functions are used in the skeleton parser.
54 (tab_extension): New.
55 (compute_base_names): Use the computations done in this function
56 to guess if the generated parsers should have '.tab' in their
57 names.
58 (short_base_name): No longer static.
59
60 * src/output.c (output_skeleton): New.
61 (output): Disable call to output_master_parser, and give a try to
62 a new skeleton handling system.
63 (guards_output, actions_output): No longer static.
64 (token_definitions_output, get_lines_number): No longer static.
65
66 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
67
68 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
69 parse-skel.y.
70
71 * src/parse-skel.y: New file.
72 * src/scan-skel.l: New file.
73
b5b61c61
AD
742001-12-29 Akim Demaille <akim@epita.fr>
75
76 %name-prefix is broken.
77
78 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
79 Adjust all dependencies.
80 * tests/headers.at (export YYLTYPE): Strengthen this test: use
81 %name-prefix.
82
83 Renaming yylval but not yylloc is not consistent. Now we do.
84
85 * src/bison.simple: Prefix yylloc if used.
86 * doc/bison.texinfo (Decl Summary): Document that.
87
8c9a50be
AD
882001-12-29 Akim Demaille <akim@epita.fr>
89
90 * doc/bison.texinfo: Promote `%long-directive' over
91 `%long_directive'.
92 Remove all references to fixed-output-files, yacc is enough.
93
d99361e6
AD
942001-12-29 Akim Demaille <akim@epita.fr>
95
96 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
97 user prologue. These are defaults.
98 * tests/actions.at (Mid-rule actions): Make sure the user can
99 define YYDEBUG and YYERROR_VERBOSE.
100
b9cecb91
AD
1012001-12-29 Akim Demaille <akim@epita.fr>
102
103 * src/output.c (header_output): Don't forget to export YYLTYPE and
104 yylloc.
105 * tests/headers.at (export YYLTYPE): New, make sure it does.
106 * tests/regression.at (%union and --defines, Invalid CPP headers):
107 Move to...
108 * tests/headers.at: here.
109
aea13e97
AD
1102001-12-29 Akim Demaille <akim@epita.fr>
111
112 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
113
931394cb
AD
1142001-12-29 Akim Demaille <akim@epita.fr>
115
116 * tests/actions.at (Mid-rule actions): Output on a single line
117 instead of several.
118
704a47c4
AD
1192001-12-29 Akim Demaille <akim@epita.fr>
120
121 * doc/bison.texinfo: Formatting changes.
122
091e20bb
AD
1232001-12-29 Akim Demaille <akim@epita.fr>
124
125 Don't store the token defs in a muscle, just be ready to output it
126 on command. Now possible via `symbols'. Fixes a memory leak.
127
128 * src/output.c (token_definitions_output): New.
129 (output_parser, header_output): Use it.
130 * src/reader.c (symbols_save): Remove.
131
cce71710
AD
1322001-12-29 Akim Demaille <akim@epita.fr>
133
134 * src/bison.simple: Do not provide a default for YYSTYPE and
135 YYLTYPE before the user's prologue. Otherwise it's hardly... a
136 default.
137
82c035a8
AD
1382001-12-29 Akim Demaille <akim@epita.fr>
139
140 Mid-rule actions are simply... ignored!
141
142 * src/reader.c (readgram): Be sure to attach mid-rule actions to
143 the empty-rule associated to the dummy symbol, not to the host
144 rule.
145 * tests/actions.at (Mid-rule actions): New.
146
8419d367
AD
1472001-12-29 Akim Demaille <akim@epita.fr>
148
149 Memory leak.
150
151 * src/reader.c (reader): Free grammar.
152
375d5806
AD
1532001-12-29 Akim Demaille <akim@epita.fr>
154
155 Memory leak.
156
157 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
158 since it allocates it for each state, although only one is needed.
159 (allocate_storage): Do it here.
160
f51cb8ff
AD
1612001-12-29 Akim Demaille <akim@epita.fr>
162
163 * src/options.h, src/options.c (create_long_option_table): Rename
164 as...
165 (long_option_table_new): this, with a clearer prototype.
166 (percent_table): Remove, unused,
167 * src/getargs.c (getargs): Adjust.
168
29e88316
AD
1692001-12-29 Akim Demaille <akim@epita.fr>
170
171 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
172 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
173 as states.
174
b9f71f19
AD
1752001-12-29 Akim Demaille <akim@epita.fr>
176
177 * src/lalr.c (build_relations): Rename `states' as `states1'.
178 Sorry, I don't understand exactly what it is, no better name...
179
1a2b5d37
AD
1802001-12-29 Akim Demaille <akim@epita.fr>
181
182 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
183 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
184 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
185 as rules.
186
1cca533e
AD
1872001-12-29 Akim Demaille <akim@epita.fr>
188
189 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
190 ago.
191
c03ae966
AD
1922001-12-29 Akim Demaille <akim@epita.fr>
193
194 * src/reader.c, src/reader.h (user_toknums): Remove.
195 Adjust all users to use symbols[i]->user_token_number.
196
5a670b1e
AD
1972001-12-29 Akim Demaille <akim@epita.fr>
198
199 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
200 Adjust all users to use symbols[i]->prec or ->assoc.
201
ad949da9
AD
2022001-12-29 Akim Demaille <akim@epita.fr>
203
204 * src/reader.c, src/reader.h (tags): Remove.
205 Adjust all users to use symbols[i]->tag.
206
0e78e603
AD
2072001-12-29 Akim Demaille <akim@epita.fr>
208
209 * src/gram.h, src/gram.c (symbols): New, similar to state_table
210 and rule_table.
211 * src/reader.c (packsymbols): Fill this table.
212 Drop sprec.
213 * src/conflicts.c (resolve_sr_conflict): Adjust.
214 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
215 single table.
216 Use symbols[i]->tag instead of tags[i].
217
213e640e
AD
2182001-12-29 Akim Demaille <akim@epita.fr>
219
220 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
221 In addition, put a comment in there, to replace...
222 * tests/regression.at (%union and C comments): Remove.
223
e7b8bef1
AD
2242001-12-29 Akim Demaille <akim@epita.fr>
225
226 * tests/regression.at (Web2c Actions): Blindly move the actual
227 output as expected output. The contents *seem* right to me, but I
228 can't pretend reading perfectly parser tables... Nonetheless, all
229 the other tests pass correctly, the table look OK, even though the
230 presence of `$axiom' is to be noted: AFAICS it is useless (but
231 harmless).
232
b68e7744
AD
2332001-12-29 Akim Demaille <akim@epita.fr>
234
235 * src/reader.c (readgram): Don't add the rule 0 if there were no
236 rules read. In other words, add it _after_ having performed
237 grammar sanity checks.
238 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
239
78d5bae9
AD
2402001-12-29 Akim Demaille <akim@epita.fr>
241
242 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
243 visible, and some states have now a different number.
244
ff442794
AD
2452001-12-29 Akim Demaille <akim@epita.fr>
246
247 * src/reader.c (readgram): Bind the initial rule's lineno to that
248 of the first rule.
249 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
250 (Solved SR Conflicts): Adjust rule 0's line number.
251
610ab194
AD
2522001-12-29 Akim Demaille <akim@epita.fr>
253
254 Fix the `GAWK Grammar' failure.
255
256 * src/LR0.c (final_state): Initialize to -1 so that we do compute
257 the reductions of the first state which was mistakenly confused
258 with the final state because precisely final_state was initialized
259 to 0.
260 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
261 now noticed by Bison.
262 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
263 have a reduction on $default.
264
29d29c8f
AD
2652001-12-29 Akim Demaille <akim@epita.fr>
266
267 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
268 rule line numbers.
269 * src/closure.c (print_closure): Likewise.
270 * src/derives.c (print_derives): Likewise.
271 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
272 now.
273
7c6b64d0
AD
2742001-12-29 Akim Demaille <akim@epita.fr>
275
276 * src/lalr.c (lookaheads_print): New.
277 (lalr): Call it when --trace-flag.
278 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
279 are dumped.
280
3d4daee3
AD
2812001-12-29 Akim Demaille <akim@epita.fr>
282
283 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
284 when walking through ritem, even via rule->rhs.
285 * src/reduce.c (dump_grammar, useful_production, reduce_output)
286 (useful_production, useless_nonterminals): Likewise.
287 (reduce_grammar_tables): Likewise, plus update nritems.
288 * src/nullable.c (set_nullable): Likewise.
289 * src/lalr.c (build_relations): Likewise.
290 * tests/sets.at (Nullable): Adjust.
291 Fortunately, now, the $axiom is no longer nullable.
292
9e7f6bbd
AD
2932001-12-29 Akim Demaille <akim@epita.fr>
294
295 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
296 the 0-sentinel.
297 * src/gram.c (ritem_longest_rhs): Likewise.
298 * src/reduce.c (nonterminals_reduce): Likewise.
299 * src/print_graph.c (print_graph): Likewise.
300 * src/output.c (output_rule_data): Likewise.
301 * src/nullable.c (set_nullable): Likewise.
302
255ef638
AD
3032001-12-29 Akim Demaille <akim@epita.fr>
304
305 * src/output.c: Comment changes.
306
0d8a7363
AD
3072001-12-27 Paul Eggert <eggert@twinsun.com>
308
309 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
310 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
311 Sparc, as they were causing more porting problems than the
312 (minor) performance improvement was worth.
313
314 Also, catch up with 1.31's YYSTD.
315
3db472b9
AD
3162001-12-27 Akim Demaille <akim@epita.fr>
317
318 * src/output.c (output_gram): Rely on nritems, not the
319 0-sentinel. See below.
320 Use -1 as separator, not 0.
321 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
322 Rely on -1 as separator in yyrhs, instead of 0.
323 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
324 twice `Now at end of input', therefore there are two lines less to
325 expect.
326
b365aa05
AD
3272001-12-27 Akim Demaille <akim@epita.fr>
328
329 * tests/regression.at (Unresolved SR Conflicts):
330 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
331 below.
332
30171f79
AD
3332001-12-27 Akim Demaille <akim@epita.fr>
334
335 * src/LR0.c (new_state): Recognize the final state by the fact it
336 is reached by eoftoken.
337 (insert_start_shifting_state, insert_eof_shifting_state)
338 (insert_accepting_state, augment_automaton): Remove, since now
339 these states are automatically computed from the initial state.
340 (generate_states): Adjust.
341 * src/print.c: When reporting a rule number to the user, substract
342 1, so that the axiom rule is rule 0, and the first user rule is 1.
343 * src/reduce.c: Likewise.
344 * src/print_graph.c (print_core): For the time being, just as for
345 the report, depend upon --trace-flags to dump the full set of
346 items.
347 * src/reader.c (readgram): Once the grammar read, insert the rule
348 0: `$axiom: START-SYMBOL $'.
349 * tests/set.at: Adjust: rule 0 is now displayed, and since the
350 number of the states has changed (the final state is no longer
351 necessarily the last), catch up.
352
75142d45
AD
3532001-12-27 Akim Demaille <akim@epita.fr>
354
355 Try to make the use of the eoftoken valid. Given that its value
356 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
357 is used instead of > 0 where appropriate, (ii), depend upon nritems
358 instead of the 0-sentinel.
359
360 * src/gram.h, src/gram.c (nritems): New.
361 Expected to be duplication of nitems, but for the time being...
362 * src/reader.c (packgram): Assert nritems and nitems are equal.
363 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
364 * src/closure.c (print_closure, print_fderives): Likewise.
365 * src/gram.c (ritem_print): Likewise.
366 * src/print.c (print_core, print_grammar): Likewise.
367 * src/print_graph.c: Likewise.
368
b7c49edf
AD
3692001-12-27 Akim Demaille <akim@epita.fr>
370
371 * src/main.c (main): If there are complains after grammar
372 reductions, then output the report anyway if requested, then die.
373 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
374 * src/reader.c (eoftoken): New.
375 (parse_token_decl): If the token being defined has value `0', it
376 is the eoftoken.
377 (packsymbols): No longer hack `tags' to insert `$' by hand.
378 Be sure to preserve the value of the eoftoken.
379 (reader): Make sure eoftoken is defined.
380 Initialize nsyms to 0: now eoftoken is created just like the others.
381 * src/print.c (print_grammar): Don't special case the eof token.
382 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
383 lie anyway, albeit pleasant.
384 * tests/calc.at: Exercise error messages with eoftoken.
385 Change the grammar so that empty input is invalid.
386 Adjust expectations.
387 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
388
ec2da99f
AD
3892001-12-27 Akim Demaille <akim@epita.fr>
390
391 * configure.in: Check the protos of strchr ans strspn.
392 Replace strchr if needed.
393 * src/system.h: Provide the protos of strchr, strspn and memchr if
394 missing.
395 * lib/strchr.c: New.
396 * src/reader.c (symbols_save): Use strchr.
397
8adfa272
AD
3982001-12-27 Akim Demaille <akim@epita.fr>
399
400 * src/print.c, src/print_graph.c (escape): New.
401 Use it to quote the TAGS outputs.
402 * src/print_graph.c (print_state): Now errors are in red, and
403 reductions in green.
404 Prefer high to wide: output the state number on a line of its own.
405
80dac38c
AD
4062001-12-27 Akim Demaille <akim@epita.fr>
407
408 * src/state.h, src/state.c (reductions_new): New.
409 * src/LR0.c (set_state_table): Let all the states have a
410 `reductions', even if reduced to 0.
411 (save_reductions): Adjust.
412 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
413 * src/print.c (print_reductions, print_actions): Adjust.
414 * src/output.c (action_row): Adjust.
415
2cec70b9
AD
4162001-12-27 Akim Demaille <akim@epita.fr>
417
418 * src/state.h, src/state.c (errs_new, errs_dup): New.
419 * src/LR0.c (set_state_table): Let all the states have an errs,
420 even if reduced to 0.
421 * src/print.c (print_errs, print_reductions): Adjust.
422 * src/output.c (output_actions, action_row): Adjust.
423 * src/conflicts.c (resolve_sr_conflict): Adjust.
424
13ca549a
AD
4252001-12-27 Akim Demaille <akim@epita.fr>
426
427 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
428
5092aba5
AD
4292001-12-27 Akim Demaille <akim@epita.fr>
430
431 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
432 * src/print.c: here.
433 (lookaheadset, shiftset): New, used as additional storage by
434 print_reductions.
435 (print_results): Adjust.
436 (print_shifts, print_gotos, print_errs): New, extracted from...
437 (print_actions): here.
438 * src/print_graph.c (print_actions): Remove dead code.
439
11e2beca
AD
4402001-12-27 Akim Demaille <akim@epita.fr>
441
442 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
443 `$n' and `@n'.
444
dac3c910
AD
4452001-12-27 Akim Demaille <akim@epita.fr>
446
447 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
448 (build_relations): Adjust.
449
d0b0fefa
AD
4502001-12-27 Akim Demaille <akim@epita.fr>
451
452 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
453 duplication.
454
adc8c848
AD
4552001-12-27 Akim Demaille <akim@epita.fr>
456
457 * src/reader.c (packgram): Catch nitems overflows.
458
14d293ac
AD
4592001-12-27 Akim Demaille <akim@epita.fr>
460
461 * src/files.c, src/files.h (guard_obstack): Remove.
462 * src/output.c (output): Adjust.
463 * src/reader.c (parse_braces): New, factoring...
464 (copy_action, copy_guard): these two which are renamed as...
465 (parse_action, parse_guard): these.
466 As a voluntary consequence, using braces around guards is now
467 mandatory.
468
f499b062
AD
4692001-12-27 Akim Demaille <akim@epita.fr>
470
471 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
472 * src/reader.c (symbol_list): `guard' and `guard_line' are new
473 members.
474 (symbol_list_new): Adjust.
475 (copy_action): action_line is the first line, not the last.
476 (copy_guard): Just as for actions, store the `action' only, not
477 the switch/case/break flesh.
478 Don't parse the user action that might follow the guard, let...
479 (readgram): do it, i.e., now, there can be an action after a
480 guard.
481 In other words the guard is just explicitly optional.
482 (packgram): Adjust.
483 * src/output.c (guards_output): New.
484 (output_parser): Call it when needed.
485 (output): Also free the guard and attrs obstacks.
486 * src/files.c, src/files.h (obstack_save): Remove.
487 (output_files): Remove.
488 As a result, if one needs the former `.act' file, using an
489 appropriate skeleton which requires actions and guards is now
490 required.
491 * src/main.c (main): Adjust.
492 * tests/semantic.at: New.
493 * tests/regression.at: Use `input.y' as input file name.
494 Avoid 8+3 problems by requiring input.c when the test needs the
495 parser.
496
d945f5cd
AD
4972001-12-27 Akim Demaille <akim@epita.fr>
498
499 * src/reader.c (symbol_list_new): Be sure to initialize all the
500 fields.
501
d200e455
AD
5022001-12-27 Akim Demaille <akim@epita.fr>
503
504 All the hacks using a final pseudo state are now useless.
505
506 * src/LR0.c (set_state_table): state_table holds exactly nstates.
507 * src/lalr.c (nLA): New.
508 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
509 instead of lookaheadsp from the pseudo state (nstate + 1).
510
f9507c28
AD
5112001-12-27 Akim Demaille <akim@epita.fr>
512
513 * src/output.c (action_row, token_actions): Use a state_t instead
514 of a integer, and nlookaheads instead of the following state's
515 lookaheadsp.
516
065fbd27
AD
5172001-12-27 Akim Demaille <akim@epita.fr>
518
519 * src/conflicts.c (log_resolution, flush_shift)
520 (resolve_sr_conflict, set_conflicts, solve_conflicts)
521 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
522 (conflicts_print, print_reductions): Use a state_t instead of an
523 integer when referring to a state.
524 As much as possible, depend upon nlookaheads, instead of the
525 `lookaheadsp' member of the following state (since lookaheads of
526 successive states are successive, the difference between state n + 1
527 and n served as the number of lookaheads for state n).
528 * src/lalr.c (add_lookback_edge): Likewise.
529 * src/print.c (print_core, print_actions, print_state)
530 (print_results): Likewise.
531 * src/print_graph.c (print_core, print_actions, print_state)
532 (print_graph): Likewise.
533 * src/conflicts.h: Adjust.
534
1b177bd7
AD
5352001-12-27 Akim Demaille <akim@epita.fr>
536
537 * src/bison.hairy: Formatting/comment changes.
538 ANSIfy.
539 Remove `register' indications.
540 Add plenty of `static'.
541
7742ddeb
AD
5422001-12-27 Akim Demaille <akim@epita.fr>
543
544 * src/output.c (prepare): Drop the muscle `ntbase' which
545 duplicates ntokens.
546 * src/bison.simple: Formatting/comment changes.
547 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
548 is an undocumented synonym.
549
1fa14068
AD
5502001-12-22 Akim Demaille <akim@epita.fr>
551
552 * src/output.c (output_table_data): Change the prototype to use
553 `int' for array ranges: some invocations do pass an int, not a
554 short.
555 Reported by Wayne Green.
556
b9752825
AD
5572001-12-22 Akim Demaille <akim@epita.fr>
558
559 Some actions of web2c.y are improperly triggered.
560 Reported by Mike Castle.
561
562 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
563 * tests/regression.at (Web2c): Rename as...
564 (Web2c Report): this.
565 (Web2c Actions): New.
566
776209d6
AD
5672001-12-22 Akim Demaille <akim@epita.fr>
568
569 Reductions in web2c.y are improperly reported.
570 Reported by Mike Castle.
571
572 * src/conflicts.c (print_reductions): Fix.
573 * tests/regression.at (Web2c): New.
574
275fc3ad
AD
5752001-12-18 Akim Demaille <akim@epita.fr>
576
577 Some host fail on `assert (!"foo")', which expands to
578 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
579 Reported by Nelson Beebee.
580
581 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
582 `#define it_succeeded 0' and `assert (it_succeeded)'.
583
897668ee
MA
5842001-12-17 Marc Autret <autret_m@epita.fr>
585
586 * src/bison.simple: Don't hard code the skeleton line and filename.
587 * src/output.c (output_parser): Rename 'line' as 'output_line'.
588 New line counter 'skeleton_line' (skeleton-line muscle).
589
ab3399e0
PE
5902001-12-17 Paul Eggert <eggert@twinsun.com>
591
592 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
593 YYDEBUG must be defined to a nonzero value.
594
595 * src/bison.simple (yytname): Do not assume that the user defines
596 YYDEBUG to a properly parenthesized expression.
597
3877f72b
AD
5982001-12-17 Akim Demaille <akim@epita.fr>
599
600 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
601 nlookaheads is a new member.
602 Adjust all users.
603 * src/lalr.h (nlookaheads): Remove this orphan declaration.
604 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
605 state.
776209d6 606
331dbc1b
AD
6072001-12-17 Akim Demaille <akim@epita.fr>
608
609 * src/files.h, src/files.c (open_files, close_files): Remove.
610 * src/main.c (main): Don't open/close files, nor invoke lex_free,
611 let...
612 * src/reader.c (reader): Do it.
776209d6 613
be750e4c
AD
6142001-12-17 Akim Demaille <akim@epita.fr>
615
616 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 617
709ae8c6
AD
6182001-12-17 Akim Demaille <akim@epita.fr>
619
620 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
621 (flush_reduce): New.
622 (resolve_sr_conflict): Adjust.
776209d6 623
f87685c3
AD
6242001-12-17 Akim Demaille <akim@epita.fr>
625
626 * src/output.c (output_obstack): Be static and rename as...
627 (format_obstack): this, to avoid any confusion with files.c's
628 output_obstack.
629 * src/reader.h (muscle_obstack): Move to...
630 * src/output.h: here, since it's defined in output.c.
631
837491d8
AD
6322001-12-17 Akim Demaille <akim@epita.fr>
633
634 * src/output.c (action_row, save_column, default_goto)
635 (sort_actions, matching_state, pack_vector): Better variable
636 locality.
637
796d61fb
AD
6382001-12-17 Akim Demaille <akim@epita.fr>
639
640 * src/output.c: Various formatting changes.
776209d6 641
64d15509
AD
6422001-12-17 Akim Demaille <akim@epita.fr>
643
644 * src/files.c (output_files): Free the output_obstack.
645 * src/main.c (main): Call print and print_graph conditionally.
646 * src/print.c (print): Work unconditionally.
647 * src/print_graph.c (print_graph): Work unconditionally.
648 * src/conflicts.c (log_resolution): Output only if verbose_flag.
649
fbc8ecb7
MA
6502001-12-16 Marc Autret <autret_m@epita.fr>
651
652 * src/output.c (actions_output): Fix. When we use %no-lines,
653 there is one less line per action.
654
f0440388
MA
6552001-12-16 Marc Autret <autret_m@epita.fr>
656
657 * src/bison.simple: Remove a useless #line directive.
658 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
659 * src/output.c (get_lines_number): New.
776209d6 660 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
661 output muscles.
662 Fix line numbering.
663 (actions_output): Computes the number of lines taken by actions.
664 (output_master_parser): Insert new skeleton which is the name of
665 the output parser file name.
666
a79986b8
MA
6672001-12-15 Marc Autret <autret_m@epita.fr>
668
669 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
670
4ec8e00f
MA
6712001-12-15 Marc Autret <autret_m@epita.fr>
672
673 * src/output.c (output_gram): Keep track of the hairy one.
674
1a4648ff
AD
6752001-12-15 Akim Demaille <akim@epita.fr>
676
677 Make `make distcheck' work.
678
679 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
680 system.h which uses libgettext.h.
681
9c2c67e6
AD
6822001-12-15 Akim Demaille <akim@epita.fr>
683
684 * src/nullable.c (set_nullable): Useless rules must be skipped,
685 otherwise, since we range over their symbols, we might look at a
686 nonterminal which no longer ``exists'', i.e., it is not counted in
687 `nvars', hence we overflow our arrays.
688
93ede233
AD
6892001-12-15 Akim Demaille <akim@epita.fr>
690
691 The header can also be produced directly, without any obstack!
692 Yahoo!
693
694 * src/files.c, src/files.h (defines_obstack): Remove.
695 (compute_header_macro): Global.
696 (defines_obstack_save): Remove.
697 * src/reader.c (parse_union_decl): No longer output to
698 defines_obstack: its content can be found in the `stype' muscle
699 anyway.
700 (output_token_translations): Merge into...
701 (symbols_output): this.
702 Rename as...
703 (symbols_save): this.
704 (reader): Adjust.
705 * src/output.c (header_output): New.
706 (output): Call it.
707
2666f928
AD
7082001-12-15 Akim Demaille <akim@epita.fr>
709
710 * src/reader.c (parse_union_decl): Instead of handling two obstack
711 simultaneously, use one to define the `stype' muscle, and use the
712 value of the latter to fill defines_obstack.
713 (copy_comment): Remove.
714 (copy_comment2): Work for a single obstack.
715 Rename as...
716 (copy_comment): this.
717
428046f8
AD
7182001-12-15 Akim Demaille <akim@epita.fr>
719
720 * src/lex.c, src/lex.h (xgetc): No longer static.
721 * src/reader.c (parse_union_decl): Revamp.
722
ea52d706
AD
7232001-12-15 Akim Demaille <akim@epita.fr>
724
725 Still making progress in separating Bison into (i) input, (ii)
726 process, (iii) output: now we can directly output the parser file
727 without using table_obstack at all.
728
729 * src/files.c, src/files.h (table_obstack): Bye bye.
730 (parser_file_name): New.
731 * src/files.c (compute_output_file_names): Compute it.
732 * src/output.c (actions_output, output_parser)
733 (output_master_parser): To a file instead of an obstack.
734
3f96f4dc
AD
7352001-12-15 Akim Demaille <akim@epita.fr>
736
737 Attach actions to rules, instead of pre-outputting them to
738 actions_obstack.
739
740 * src/gram.h (rule_t): action and action_line are new members.
741 * src/reader.c (symbol_list): Likewise.
742 (copy_action): Save the actions within the rule.
743 (packgram): Save them in rule_table.
744 * src/output.c (actions_output): New.
745 (output_parser): Use it on `%%actions'.
746 (output_rule_data): Don't free rule_table.
747 (output): Do it.
748 (prepare): Don't save the `action' muscle.
749 * src/bison.simple: s/%%action/%%actions/.
750
51576fb3
AD
7512001-12-15 Akim Demaille <akim@epita.fr>
752
753 * src/reader.c (copy_action): When --yacc, don't append a `;'
754 to the user action: let it fail if lacking.
dee049eb 755 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 756
2648a72d
AD
7572001-12-14 Akim Demaille <akim@epita.fr>
758
759 * src/lex.c (literalchar): Simply return the char you decoded, non
760 longer mess around with obstacks and int pointers.
761 Adjust all callers.
762
92790e5b
AD
7632001-12-14 Akim Demaille <akim@epita.fr>
764
765 * src/lex.c (literalchar): Don't escape the special characters,
766 just decode them, and keep them as char (before, eol was output as
767 the 2 char string `\n' etc.).
768 * src/output.c (output_rule_data): Use quotearg to output the
769 token strings.
770
927c1557
PE
7712001-12-13 Paul Eggert <eggert@twinsun.com>
772
773 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
774 Do not infringe on the global user namespace when using C++.
775 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
776 All uses of `fprintf' and `stderr' changed.
777
778 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
779
ed8e1f68
AD
7802001-12-13 Akim Demaille <akim@epita.fr>
781
782 The computation of nullable is broken: it doesn't handle empty
783 RHS's properly.
784
785 * tests/torture.at (GNU AWK Grammar): New.
786 * tests/sets.at (Nullable): New.
787 * src/nullable.c (set_nullable): Instead of blindly looping over
788 `ritems', loop over the rules, and then over their rhs's.
789
790 Work around Autotest bugs.
791
792 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
793 frame, because Autotest understand lines starting with a `+' as
794 traces from the shell. Then, they are not processed properly.
795 Admittedly an Autotest bug, but we don't have time to wait for
796 Autotest to catch up.
797 * tests/regression.at (Broken Closure): Adjust to the new table
798 frames.
799 Move to...
800 * tests/sets.at: here.
801
cb581495
AD
8022001-12-13 Akim Demaille <akim@epita.fr>
803
804 * src/closure.c (closure): Use nrules instead of playing tricks
805 with BITS_PER_WORD.
806
2e729273
AD
8072001-12-13 Akim Demaille <akim@epita.fr>
808
809 * src/print.c (print_actions): Output the handling of `$' as the
810 traces do: shifting the token EOF. Before EOF was treated as a
811 nonterminal.
812 * tests/regression.at: Adjust some tests.
813 * src/print_graph.c (print_core): Complete the set of items via
814 closure. The next-to-final and final states are still unsatisfying,
815 but that's to be addressed elsewhere.
816 No longer output the rule numbers, but do output the state number.
817 A single loop for the shifts + gotos is enough, but picked a
818 distinct color for each.
819 (print_graph): Initialize and finalize closure.
820
107f7dfb
AD
8212001-12-13 Akim Demaille <akim@epita.fr>
822
823 * src/reader.c (readgram): Remove dead code, an strip useless
824 braces.
825 (get_type): Remove, unused.
826
9b53a24f
AD
8272001-12-12 Akim Demaille <akim@epita.fr>
828
829 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
830 on that of lib/error.c.
831
dbfb6dcd
AD
8322001-12-12 Akim Demaille <akim@epita.fr>
833
834 Some hosts don't like `/' in includes.
835
836 * src/system.h: Include libgettext.h without qualifying the path.
837 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
838 $(top_srcdir).
839
c25fb648
MA
8402001-12-11 Marc Autret <autret_m@epita.fr>
841
842 * src/output.c (output_parser): Remove useless muscle.
843
710ddc4f
MA
8442001-12-11 Marc Autret <autret_m@epita.fr>
845
846 * src/bison.simple: Remove #line just before %%epilogue. It
847 is now handled in ...
848 * src/reader.c (read_additionnal_code): Add the output of a
849 #line for the epilogue.
850
e83d80b8
MA
8512001-12-10 Marc Autret <autret_m@epita.fr>
852
927c1557 853 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
854 replace precedent remove.
855 * src/bison.simple: Remove #line before %%prologue because
856 %%input-line is wrong at this time.
857
971d5158
MA
8582001-12-10 Marc Autret <autret_m@epita.fr>
859
860 * src/reader.c (symbols_output): Clean up.
927c1557 861 * src/output.c (output_gram, output): Clean up.
971d5158 862
5edafffd
AD
8632001-12-10 Akim Demaille <akim@epita.fr>
864
865 * src/lalr.c (initialize_lookaheads): New. Extracted from...
866 * src/LR0.c (set_state_table): here.
867 * src/lalr.c (lalr): Call it.
868
0279f8e9
AD
8692001-12-10 Akim Demaille <akim@epita.fr>
870
871 * src/state.h (shifts): Remove the `number' member: shifts are
872 attached to state, hence no longer need to be labelled with a
873 state number.
874
190c4f5f
AD
8752001-12-10 Akim Demaille <akim@epita.fr>
876
877 Now that states have a complete set of members, the linked list of
878 shifts is useless: just fill directly the state's shifts member.
879
880 * src/state.h (shifts): Remove the `next' member.
881 * src/LR0.c (first_state, last_state): Remove.
882 Adjust the callers.
883 (augment_automaton): Don't look for the shifts that must be added
884 a shift on EOF: it is those of the state we looked for! But now,
885 since shifts are attached, it is no longer needed to looking
886 merely by its id: its number.
887
2a73b93d
AD
8882001-12-10 Akim Demaille <akim@epita.fr>
889
890 * src/LR0.c (augment_automaton): Better variable locality.
891 Remove an impossible branch: if there is a state corresponding to
892 the start symbol being shifted, then there is shift for the start
893 symbol from the initial state.
894
74392f6a
AD
8952001-12-10 Akim Demaille <akim@epita.fr>
896
897 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
898 only when appropriate: when insert_start_shifting_state' is not
899 invoked.
900 * tests/regression.at (Rule Line Numbers): Adjust.
901
37c82725
AD
9022001-12-10 Akim Demaille <akim@epita.fr>
903
904 * src/LR0.c (augment_automaton): Now that all states have shifts,
905 merge the two cases addition shifts to the initial state.
906
6a164e0c
AD
9072001-12-10 Akim Demaille <akim@epita.fr>
908
909 * src/lalr.c (set_state_table): Move to...
910 * src/LR0.c: here.
911 * src/lalr.c (lalr): Don't call it...
912 * src/LR0.c (generate_states): do it.
913 * src/LR0.h (first_state): Remove, only the table is used.
914
7215de24
AD
9152001-12-10 Akim Demaille <akim@epita.fr>
916
917 * src/LR0.h (first_shift, first_reduction): Remove.
918 * src/lalr.c: Don't use first_shift: find shifts through the
919 states.
920
80e25d4d
AD
9212001-12-10 Akim Demaille <akim@epita.fr>
922
923 * src/LR0.c: Attach shifts to states as soon as they are
924 computed.
925 * src/lalr.c (set_state_table): Instead of assigning shifts to
926 state, just assert that the mapping was properly done.
927
0ab3728b
AD
9282001-12-10 Akim Demaille <akim@epita.fr>
929
930 * src/LR0.c (insert_start_shift): Rename as...
931 (insert_start_shifting_state): this.
932 (insert_eof_shifting_state, insert_accepting_state): New.
933 (augment_automaton): Adjust.
934 Better locality of the variables.
935 When looking if the start_symbol is shifted from the initial
936 state, using `while (... symbol != start_symbol ...)' sounds
937 better than `while (... symbol < start_symbol ...)': If fail
938 to see how the order between symbols could be relevant!
939
78af9bbc
AD
9402001-12-10 Akim Demaille <akim@epita.fr>
941
942 * src/getargs.h: Don't declare `spec_name_prefix' and
943 `spec_file_prefix', declared by src/files.h.
944 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
945 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
946 * src/output.c (prepare): Adjust.
947 * src/reader.c (symbols_output): Likewise.
948 * src/vmsgetargs.c: Vaguely adjust, but who cares?
949
bdef2a41
AD
9502001-12-10 Akim Demaille <akim@epita.fr>
951
952 * src/muscle_tab.c (muscle_init): NULL is a better default than
953 `"0"'.
954
3735969c
AD
9552001-12-10 Akim Demaille <akim@epita.fr>
956
957 * src/reader.c (reader): Calling symbols_output once is enough.
958
49701457
AD
9592001-12-10 Akim Demaille <akim@epita.fr>
960
961 Now that states have a complete set of members, the linked list of
962 reductions is useless: just fill directly the state's reductions
963 member.
964
965 * src/state.h (struct reductions): Remove member `number' and
966 `next'.
967 * src/LR0.c (first_reduction, last_reduction): Remove.
968 (save_reductions): Don't link the new reductions, store them in
969 this_state.
970 * src/lalr.c (set_state_table): No need to attach reductions to
971 states, it's already done.
972 * src/output.c (output_actions): No longer free the shifts, then
973 the reductions, then the states: free all the states and their
974 members.
975
0edad749
AD
9762001-12-10 Akim Demaille <akim@epita.fr>
977
978 * src/options.c (OPTN, DRTV, BOTH): New.
979 (option_table): Use them.
980
0edad749
AD
981 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
982 the job of system.h.
983 * src/options.c: Don't include stdio.h and xalloc.h for the same
984 reasons.
985
5449dd0f
AD
9862001-12-10 Akim Demaille <akim@epita.fr>
987
988 * src/output.c (output, prepare): Make sure the values of the
989 muscles `action' and `prologue' are 0-terminated.
990
a870c567
AD
9912001-12-10 Akim Demaille <akim@epita.fr>
992
993 Clean up GCC warnings.
994
995 * src/reader.c (copy_action): `buf' is not used.
996 (parse_skel_decl): Be static.
997 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
998 * src/options.h (create_long_option_table): Have a real prototype.
999 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1000 (hash_delete_at): Return const void *.
1001 Adjust casts to preserve the const.
1002
80df8768
AD
10032001-12-10 Akim Demaille <akim@epita.fr>
1004
1005 * configure.in: Require 2.52g.
1006 M4 is not needed, but AUTOM4TE is.
1007 * m4/m4.m4: Remove.
1008 * tests/Makefile.am: Adjust.
1009
f693ad14
AD
10102001-12-10 Akim Demaille <akim@epita.fr>
1011
1012 One structure for states is enough, even though theoretically
1013 there are LR(0) states and LALR(1) states.
1014
1015 * src/lalr.h (state_t): Remove.
1016 (state_table): Be state_t **, not state_t *.
1017 * src/state.h (core, CORE_ALLOC): Rename as...
1018 (state_t, STATE_ALLOC): this.
1019 Add the LALR(1) members: shifts, reductions, errs.
1020 * src/LR0.c (state_table): Rename as...
1021 (state_hash): this, to avoid name clashes with the global
1022 `state_table'.
1023 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1024 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1025
74ffbcb6
AD
10262001-12-10 Akim Demaille <akim@epita.fr>
1027
1028 Bison dumps core on bash.y.
1029 Reported by Pascal Bart.
1030
1031 * src/warshall.c (bitmatrix_print): New.
1032 (TC): Use it.
1033 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1034 j must be the outer loop.
1035 * tests/regression.at (Broken Closure): New.
1036
07708e19
AD
10372001-12-05 Akim Demaille <akim@epita.fr>
1038
1039 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1040 its argument.
1041