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