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