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