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