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