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