]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* tests/output.at: New test.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-01-20 Marc Autret <marc@gnu.org>
2
3 * tests/output.at: New test.
4 * src/files.c (compute_base_names): Don't map extensions when
5 the YACC flag is set, use defaults.
6 Reported by Evgeny Stambulchik.
7
82002-01-20 Marc Autret <marc@gnu.org>
9
10 * src/system.h: Need to define __attribute__ away for non-GCC
11 compilers as well (i.e. the vendor C compiler).
12 Suggested by Albert Chin-A-Young.
13
142002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15
16 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17 canonical definition.
18 * src/system.h: Use the canonical definition for PARAMS (avoids
19 a conflict with the macro from lib/hash.h).
20
212002-01-11 Akim Demaille <akim@epita.fr>
22
23 * configure.in: Use AC_FUNC_STRNLEN.
24 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
25
262002-01-09 Akim Demaille <akim@epita.fr>
27
28 * src/files.c, src/files.h (output_infix): New.
29 (tab_extension): Remove.
30 (compute_base_names): Compute the former, drop the latter.
31 * src/output.c (prepare): Insert the muscles `output-infix', and
32 `output-suffix'.
33 * src/parse-skel.y (string, string.1): New.
34 (section.header): Use it.
35 (section.yacc): Remove.
36 (prefix): Remove too.
37 * src/scan-skel.l: Adjust.
38 * src/bison.simple, src/bison.hairy: Adjust.
39
402002-01-09 Akim Demaille <akim@epita.fr>
41
42 * configure.in (WERROR_CFLAGS): Compute it.
43 * src/Makefile.am (CFLAGS): Pass it.
44 * tests/atlocal.in (CFLAGS): Idem.
45 * src/files.c: Fix a few warnings.
46 (get_extension_index): Remove, unused.
47
482002-01-08 Akim Demaille <akim@epita.fr>
49
50 * src/getargs.c (AS_FILE_NAME): New.
51 (getargs): Use it to convert DOSish file names.
52 * src/files.c (base_name): Rename as full_base_name to avoid
53 clashes with `base_name ()'.
54 (filename_split): New.
55 (compute_base_names): N-th rewrite, using filename_split.
56
572002-01-08 Akim Demaille <akim@epita.fr>
58
59 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
60 New, stolen from the Fileutils 4.1.
61 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
62 * configure.in: Check for the presence of memrchr, and of its
63 prototype.
64
652002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
66
67 * lib/hash.h (__P): Added definition for this macro.
68 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
69 BUILT_SOURCES, to ensure they are generated first.
70 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
71 %error-verbose to allow bootstrapping with bison 1.30x.
72
732002-01-06 Akim Demaille <akim@epita.fr>
74
75 * src/reader.c (parse_braces): Don't fetch the next char, the
76 convention is to fetch on entry.
77 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
78 'switch' without a following semicolon.
79 * tests/regression.at (braces parsing): New.
80
812002-01-06 Akim Demaille <akim@epita.fr>
82
83 Bison is dead wrong in its RR conflict reports.
84
85 * tests/torture.at (GNU Cim Grammar): New.
86 * src/conflicts.c (count_rr_conflicts): Fix.
87
882002-01-06 Akim Demaille <akim@epita.fr>
89
90 Creating package.m4 from configure.ac causes too many problems.
91
92 * tests/Makefile.am (package.m4): Create it by hand,
93 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
94
952002-01-06 Akim Demaille <akim@epita.fr>
96
97 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
98 skeleton.h.
99
1002002-01-04 Paul Eggert <eggert@twinsun.com>
101
102 * doc/bison.texinfo (Debugging):
103 Remove YYSTDERR; it's no longer defined or used.
104 Also, s/cstdio.h/cstdio/.
105
1062002-01-03 Akim Demaille <akim@epita.fr>
107
108 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
109
1102002-01-03 Akim Demaille <akim@epita.fr>
111
112 * src/parse-skel.y (process_skeleton): Don't bind the parser's
113 tracing code to --trace, wait for a better --trace option, with
114 args.
115
1162002-01-03 Akim Demaille <akim@epita.fr>
117
118 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
119 The ISO C++ standard is extremely clear about it: stderr is
120 considered a macro, not a regular symbol (see table 94 `Header
121 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
122 Therefore std:: does not apply to it. It still does with fprintf.
123 Also, s/cstdio.h/cstdio/.
124
1252002-01-03 Akim Demaille <akim@epita.fr>
126
127 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
128 for non system headers.
129
1302002-01-02 Akim Demaille <akim@epita.fr>
131
132 Equip the skeleton chain with location tracking, runtime trace,
133 pure parser and scanner.
134
135 * src/parse-skel.y: Request a pure parser, locations, and prefix
136 renaming.
137 (%union): Having several members with the same type does not help
138 type mismatches, simplify.
139 (YYPRINT, yyprint): New.
140 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
141 (skel_error): this.
142 Handle locations.
143 * src/scan-skel.l: Adjust to these changes.
144 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
145 (LOCATION_PRINT, skel_control_t): New.
146
1472001-12-30 Akim Demaille <akim@epita.fr>
148
149 * src/parse-skel.y: Get rid of the shift/reduce conflict:
150 replace `gb' with BLANKS.
151 * src/scan-skel.l: Adjust.
152
1532001-12-30 Akim Demaille <akim@epita.fr>
154
155 * src/system.h: We don't need nor want bcopy.
156 Throw away MS-DOS crap: we don't need getpid.
157 * configure.in: We don't need strndup. It was even causing
158 problems: because Flex includes the headers *before* us,
159 _GNU_SOURCE is not defined by config.h, and therefore strndup was
160 not visible.
161 * lib/xstrndup.c: New.
162 * src/scan-skel.l: Use it.
163 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
164 * src/parse-skel.y: Use %directives instead of #defines.
165
1662001-12-30 Akim Demaille <akim@epita.fr>
167
168 * src/skeleton.h: New.
169 * src/output.c (output_parser, output_master_parser): Remove, dead
170 code.
171 * src/output.h (get_lines_number, actions_output, guards_output)
172 (token_definitions_output): Prototype them.
173 * src/parse-skel.y: Add the license notice.
174 Include output.h and skeleton.h.
175 (process_skeleton): Returns void, and takes a single parameter.
176 * src/scan-skel.l: Add the license notice.
177 Include skeleton.h.
178 Don't use %option yylineno: it seems that then Flex imagines
179 REJECT has been used, and therefore it won't reallocate its
180 buffers (which makes no other sense to me than a bug). It results
181 in warnings for `unused: yy_flex_realloc'.
182
1832001-12-30 Robert Anisko <robert.anisko@epita.fr>
184
185 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
186 (MUSCLE_INSERT_PREFIX): ...to there.
187 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
188 (MUSCLE_INSERT_PREFIX): Move from here...
189
190 * src/bison.hairy: Add a section directive. Put braces around muscle
191 names. This parser skeleton is still broken, but Bison should not
192 choke on a bad muscle 'syntax'.
193 * src/bison.simple: Add a section directive. Put braces around muscle
194 names.
195
196 * src/files.h (strsuffix, stringappend): Add declarations.
197 (tab_extension): Add declaration.
198 (short_base_name): Add declaration.
199
200 * src/files.c (strsuffix, stringappend): No longer static. These
201 functions are used in the skeleton parser.
202 (tab_extension): New.
203 (compute_base_names): Use the computations done in this function
204 to guess if the generated parsers should have '.tab' in their
205 names.
206 (short_base_name): No longer static.
207
208 * src/output.c (output_skeleton): New.
209 (output): Disable call to output_master_parser, and give a try to
210 a new skeleton handling system.
211 (guards_output, actions_output): No longer static.
212 (token_definitions_output, get_lines_number): No longer static.
213
214 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
215
216 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
217 parse-skel.y.
218
219 * src/parse-skel.y: New file.
220 * src/scan-skel.l: New file.
221
2222001-12-29 Akim Demaille <akim@epita.fr>
223
224 %name-prefix is broken.
225
226 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
227 Adjust all dependencies.
228 * tests/headers.at (export YYLTYPE): Strengthen this test: use
229 %name-prefix.
230
231 Renaming yylval but not yylloc is not consistent. Now we do.
232
233 * src/bison.simple: Prefix yylloc if used.
234 * doc/bison.texinfo (Decl Summary): Document that.
235
2362001-12-29 Akim Demaille <akim@epita.fr>
237
238 * doc/bison.texinfo: Promote `%long-directive' over
239 `%long_directive'.
240 Remove all references to fixed-output-files, yacc is enough.
241
2422001-12-29 Akim Demaille <akim@epita.fr>
243
244 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
245 user prologue. These are defaults.
246 * tests/actions.at (Mid-rule actions): Make sure the user can
247 define YYDEBUG and YYERROR_VERBOSE.
248
2492001-12-29 Akim Demaille <akim@epita.fr>
250
251 * src/output.c (header_output): Don't forget to export YYLTYPE and
252 yylloc.
253 * tests/headers.at (export YYLTYPE): New, make sure it does.
254 * tests/regression.at (%union and --defines, Invalid CPP headers):
255 Move to...
256 * tests/headers.at: here.
257
2582001-12-29 Akim Demaille <akim@epita.fr>
259
260 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
261
2622001-12-29 Akim Demaille <akim@epita.fr>
263
264 * tests/actions.at (Mid-rule actions): Output on a single line
265 instead of several.
266
2672001-12-29 Akim Demaille <akim@epita.fr>
268
269 * doc/bison.texinfo: Formatting changes.
270
2712001-12-29 Akim Demaille <akim@epita.fr>
272
273 Don't store the token defs in a muscle, just be ready to output it
274 on command. Now possible via `symbols'. Fixes a memory leak.
275
276 * src/output.c (token_definitions_output): New.
277 (output_parser, header_output): Use it.
278 * src/reader.c (symbols_save): Remove.
279
2802001-12-29 Akim Demaille <akim@epita.fr>
281
282 * src/bison.simple: Do not provide a default for YYSTYPE and
283 YYLTYPE before the user's prologue. Otherwise it's hardly... a
284 default.
285
2862001-12-29 Akim Demaille <akim@epita.fr>
287
288 Mid-rule actions are simply... ignored!
289
290 * src/reader.c (readgram): Be sure to attach mid-rule actions to
291 the empty-rule associated to the dummy symbol, not to the host
292 rule.
293 * tests/actions.at (Mid-rule actions): New.
294
2952001-12-29 Akim Demaille <akim@epita.fr>
296
297 Memory leak.
298
299 * src/reader.c (reader): Free grammar.
300
3012001-12-29 Akim Demaille <akim@epita.fr>
302
303 Memory leak.
304
305 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
306 since it allocates it for each state, although only one is needed.
307 (allocate_storage): Do it here.
308
3092001-12-29 Akim Demaille <akim@epita.fr>
310
311 * src/options.h, src/options.c (create_long_option_table): Rename
312 as...
313 (long_option_table_new): this, with a clearer prototype.
314 (percent_table): Remove, unused,
315 * src/getargs.c (getargs): Adjust.
316
3172001-12-29 Akim Demaille <akim@epita.fr>
318
319 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
320 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
321 as states.
322
3232001-12-29 Akim Demaille <akim@epita.fr>
324
325 * src/lalr.c (build_relations): Rename `states' as `states1'.
326 Sorry, I don't understand exactly what it is, no better name...
327
3282001-12-29 Akim Demaille <akim@epita.fr>
329
330 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
331 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
332 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
333 as rules.
334
3352001-12-29 Akim Demaille <akim@epita.fr>
336
337 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
338 ago.
339
3402001-12-29 Akim Demaille <akim@epita.fr>
341
342 * src/reader.c, src/reader.h (user_toknums): Remove.
343 Adjust all users to use symbols[i]->user_token_number.
344
3452001-12-29 Akim Demaille <akim@epita.fr>
346
347 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
348 Adjust all users to use symbols[i]->prec or ->assoc.
349
3502001-12-29 Akim Demaille <akim@epita.fr>
351
352 * src/reader.c, src/reader.h (tags): Remove.
353 Adjust all users to use symbols[i]->tag.
354
3552001-12-29 Akim Demaille <akim@epita.fr>
356
357 * src/gram.h, src/gram.c (symbols): New, similar to state_table
358 and rule_table.
359 * src/reader.c (packsymbols): Fill this table.
360 Drop sprec.
361 * src/conflicts.c (resolve_sr_conflict): Adjust.
362 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
363 single table.
364 Use symbols[i]->tag instead of tags[i].
365
3662001-12-29 Akim Demaille <akim@epita.fr>
367
368 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
369 In addition, put a comment in there, to replace...
370 * tests/regression.at (%union and C comments): Remove.
371
3722001-12-29 Akim Demaille <akim@epita.fr>
373
374 * tests/regression.at (Web2c Actions): Blindly move the actual
375 output as expected output. The contents *seem* right to me, but I
376 can't pretend reading perfectly parser tables... Nonetheless, all
377 the other tests pass correctly, the table look OK, even though the
378 presence of `$axiom' is to be noted: AFAICS it is useless (but
379 harmless).
380
3812001-12-29 Akim Demaille <akim@epita.fr>
382
383 * src/reader.c (readgram): Don't add the rule 0 if there were no
384 rules read. In other words, add it _after_ having performed
385 grammar sanity checks.
386 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
387
3882001-12-29 Akim Demaille <akim@epita.fr>
389
390 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
391 visible, and some states have now a different number.
392
3932001-12-29 Akim Demaille <akim@epita.fr>
394
395 * src/reader.c (readgram): Bind the initial rule's lineno to that
396 of the first rule.
397 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
398 (Solved SR Conflicts): Adjust rule 0's line number.
399
4002001-12-29 Akim Demaille <akim@epita.fr>
401
402 Fix the `GAWK Grammar' failure.
403
404 * src/LR0.c (final_state): Initialize to -1 so that we do compute
405 the reductions of the first state which was mistakenly confused
406 with the final state because precisely final_state was initialized
407 to 0.
408 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
409 now noticed by Bison.
410 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
411 have a reduction on $default.
412
4132001-12-29 Akim Demaille <akim@epita.fr>
414
415 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
416 rule line numbers.
417 * src/closure.c (print_closure): Likewise.
418 * src/derives.c (print_derives): Likewise.
419 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
420 now.
421
4222001-12-29 Akim Demaille <akim@epita.fr>
423
424 * src/lalr.c (lookaheads_print): New.
425 (lalr): Call it when --trace-flag.
426 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
427 are dumped.
428
4292001-12-29 Akim Demaille <akim@epita.fr>
430
431 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
432 when walking through ritem, even via rule->rhs.
433 * src/reduce.c (dump_grammar, useful_production, reduce_output)
434 (useful_production, useless_nonterminals): Likewise.
435 (reduce_grammar_tables): Likewise, plus update nritems.
436 * src/nullable.c (set_nullable): Likewise.
437 * src/lalr.c (build_relations): Likewise.
438 * tests/sets.at (Nullable): Adjust.
439 Fortunately, now, the $axiom is no longer nullable.
440
4412001-12-29 Akim Demaille <akim@epita.fr>
442
443 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
444 the 0-sentinel.
445 * src/gram.c (ritem_longest_rhs): Likewise.
446 * src/reduce.c (nonterminals_reduce): Likewise.
447 * src/print_graph.c (print_graph): Likewise.
448 * src/output.c (output_rule_data): Likewise.
449 * src/nullable.c (set_nullable): Likewise.
450
4512001-12-29 Akim Demaille <akim@epita.fr>
452
453 * src/output.c: Comment changes.
454
4552001-12-27 Paul Eggert <eggert@twinsun.com>
456
457 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
458 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
459 Sparc, as they were causing more porting problems than the
460 (minor) performance improvement was worth.
461
462 Also, catch up with 1.31's YYSTD.
463
4642001-12-27 Akim Demaille <akim@epita.fr>
465
466 * src/output.c (output_gram): Rely on nritems, not the
467 0-sentinel. See below.
468 Use -1 as separator, not 0.
469 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
470 Rely on -1 as separator in yyrhs, instead of 0.
471 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
472 twice `Now at end of input', therefore there are two lines less to
473 expect.
474
4752001-12-27 Akim Demaille <akim@epita.fr>
476
477 * tests/regression.at (Unresolved SR Conflicts):
478 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
479 below.
480
4812001-12-27 Akim Demaille <akim@epita.fr>
482
483 * src/LR0.c (new_state): Recognize the final state by the fact it
484 is reached by eoftoken.
485 (insert_start_shifting_state, insert_eof_shifting_state)
486 (insert_accepting_state, augment_automaton): Remove, since now
487 these states are automatically computed from the initial state.
488 (generate_states): Adjust.
489 * src/print.c: When reporting a rule number to the user, substract
490 1, so that the axiom rule is rule 0, and the first user rule is 1.
491 * src/reduce.c: Likewise.
492 * src/print_graph.c (print_core): For the time being, just as for
493 the report, depend upon --trace-flags to dump the full set of
494 items.
495 * src/reader.c (readgram): Once the grammar read, insert the rule
496 0: `$axiom: START-SYMBOL $'.
497 * tests/set.at: Adjust: rule 0 is now displayed, and since the
498 number of the states has changed (the final state is no longer
499 necessarily the last), catch up.
500
5012001-12-27 Akim Demaille <akim@epita.fr>
502
503 Try to make the use of the eoftoken valid. Given that its value
504 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
505 is used instead of > 0 where appropriate, (ii), depend upon nritems
506 instead of the 0-sentinel.
507
508 * src/gram.h, src/gram.c (nritems): New.
509 Expected to be duplication of nitems, but for the time being...
510 * src/reader.c (packgram): Assert nritems and nitems are equal.
511 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
512 * src/closure.c (print_closure, print_fderives): Likewise.
513 * src/gram.c (ritem_print): Likewise.
514 * src/print.c (print_core, print_grammar): Likewise.
515 * src/print_graph.c: Likewise.
516
5172001-12-27 Akim Demaille <akim@epita.fr>
518
519 * src/main.c (main): If there are complains after grammar
520 reductions, then output the report anyway if requested, then die.
521 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
522 * src/reader.c (eoftoken): New.
523 (parse_token_decl): If the token being defined has value `0', it
524 is the eoftoken.
525 (packsymbols): No longer hack `tags' to insert `$' by hand.
526 Be sure to preserve the value of the eoftoken.
527 (reader): Make sure eoftoken is defined.
528 Initialize nsyms to 0: now eoftoken is created just like the others.
529 * src/print.c (print_grammar): Don't special case the eof token.
530 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
531 lie anyway, albeit pleasant.
532 * tests/calc.at: Exercise error messages with eoftoken.
533 Change the grammar so that empty input is invalid.
534 Adjust expectations.
535 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
536
5372001-12-27 Akim Demaille <akim@epita.fr>
538
539 * configure.in: Check the protos of strchr ans strspn.
540 Replace strchr if needed.
541 * src/system.h: Provide the protos of strchr, strspn and memchr if
542 missing.
543 * lib/strchr.c: New.
544 * src/reader.c (symbols_save): Use strchr.
545
5462001-12-27 Akim Demaille <akim@epita.fr>
547
548 * src/print.c, src/print_graph.c (escape): New.
549 Use it to quote the TAGS outputs.
550 * src/print_graph.c (print_state): Now errors are in red, and
551 reductions in green.
552 Prefer high to wide: output the state number on a line of its own.
553
5542001-12-27 Akim Demaille <akim@epita.fr>
555
556 * src/state.h, src/state.c (reductions_new): New.
557 * src/LR0.c (set_state_table): Let all the states have a
558 `reductions', even if reduced to 0.
559 (save_reductions): Adjust.
560 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
561 * src/print.c (print_reductions, print_actions): Adjust.
562 * src/output.c (action_row): Adjust.
563
5642001-12-27 Akim Demaille <akim@epita.fr>
565
566 * src/state.h, src/state.c (errs_new, errs_dup): New.
567 * src/LR0.c (set_state_table): Let all the states have an errs,
568 even if reduced to 0.
569 * src/print.c (print_errs, print_reductions): Adjust.
570 * src/output.c (output_actions, action_row): Adjust.
571 * src/conflicts.c (resolve_sr_conflict): Adjust.
572
5732001-12-27 Akim Demaille <akim@epita.fr>
574
575 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
576
5772001-12-27 Akim Demaille <akim@epita.fr>
578
579 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
580 * src/print.c: here.
581 (lookaheadset, shiftset): New, used as additional storage by
582 print_reductions.
583 (print_results): Adjust.
584 (print_shifts, print_gotos, print_errs): New, extracted from...
585 (print_actions): here.
586 * src/print_graph.c (print_actions): Remove dead code.
587
5882001-12-27 Akim Demaille <akim@epita.fr>
589
590 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
591 `$n' and `@n'.
592
5932001-12-27 Akim Demaille <akim@epita.fr>
594
595 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
596 (build_relations): Adjust.
597
5982001-12-27 Akim Demaille <akim@epita.fr>
599
600 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
601 duplication.
602
6032001-12-27 Akim Demaille <akim@epita.fr>
604
605 * src/reader.c (packgram): Catch nitems overflows.
606
6072001-12-27 Akim Demaille <akim@epita.fr>
608
609 * src/files.c, src/files.h (guard_obstack): Remove.
610 * src/output.c (output): Adjust.
611 * src/reader.c (parse_braces): New, factoring...
612 (copy_action, copy_guard): these two which are renamed as...
613 (parse_action, parse_guard): these.
614 As a voluntary consequence, using braces around guards is now
615 mandatory.
616
6172001-12-27 Akim Demaille <akim@epita.fr>
618
619 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
620 * src/reader.c (symbol_list): `guard' and `guard_line' are new
621 members.
622 (symbol_list_new): Adjust.
623 (copy_action): action_line is the first line, not the last.
624 (copy_guard): Just as for actions, store the `action' only, not
625 the switch/case/break flesh.
626 Don't parse the user action that might follow the guard, let...
627 (readgram): do it, i.e., now, there can be an action after a
628 guard.
629 In other words the guard is just explicitly optional.
630 (packgram): Adjust.
631 * src/output.c (guards_output): New.
632 (output_parser): Call it when needed.
633 (output): Also free the guard and attrs obstacks.
634 * src/files.c, src/files.h (obstack_save): Remove.
635 (output_files): Remove.
636 As a result, if one needs the former `.act' file, using an
637 appropriate skeleton which requires actions and guards is now
638 required.
639 * src/main.c (main): Adjust.
640 * tests/semantic.at: New.
641 * tests/regression.at: Use `input.y' as input file name.
642 Avoid 8+3 problems by requiring input.c when the test needs the
643 parser.
644
6452001-12-27 Akim Demaille <akim@epita.fr>
646
647 * src/reader.c (symbol_list_new): Be sure to initialize all the
648 fields.
649
6502001-12-27 Akim Demaille <akim@epita.fr>
651
652 All the hacks using a final pseudo state are now useless.
653
654 * src/LR0.c (set_state_table): state_table holds exactly nstates.
655 * src/lalr.c (nLA): New.
656 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
657 instead of lookaheadsp from the pseudo state (nstate + 1).
658
6592001-12-27 Akim Demaille <akim@epita.fr>
660
661 * src/output.c (action_row, token_actions): Use a state_t instead
662 of a integer, and nlookaheads instead of the following state's
663 lookaheadsp.
664
6652001-12-27 Akim Demaille <akim@epita.fr>
666
667 * src/conflicts.c (log_resolution, flush_shift)
668 (resolve_sr_conflict, set_conflicts, solve_conflicts)
669 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
670 (conflicts_print, print_reductions): Use a state_t instead of an
671 integer when referring to a state.
672 As much as possible, depend upon nlookaheads, instead of the
673 `lookaheadsp' member of the following state (since lookaheads of
674 successive states are successive, the difference between state n + 1
675 and n served as the number of lookaheads for state n).
676 * src/lalr.c (add_lookback_edge): Likewise.
677 * src/print.c (print_core, print_actions, print_state)
678 (print_results): Likewise.
679 * src/print_graph.c (print_core, print_actions, print_state)
680 (print_graph): Likewise.
681 * src/conflicts.h: Adjust.
682
6832001-12-27 Akim Demaille <akim@epita.fr>
684
685 * src/bison.hairy: Formatting/comment changes.
686 ANSIfy.
687 Remove `register' indications.
688 Add plenty of `static'.
689
6902001-12-27 Akim Demaille <akim@epita.fr>
691
692 * src/output.c (prepare): Drop the muscle `ntbase' which
693 duplicates ntokens.
694 * src/bison.simple: Formatting/comment changes.
695 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
696 is an undocumented synonym.
697
6982001-12-22 Akim Demaille <akim@epita.fr>
699
700 * src/output.c (output_table_data): Change the prototype to use
701 `int' for array ranges: some invocations do pass an int, not a
702 short.
703 Reported by Wayne Green.
704
7052001-12-22 Akim Demaille <akim@epita.fr>
706
707 Some actions of web2c.y are improperly triggered.
708 Reported by Mike Castle.
709
710 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
711 * tests/regression.at (Web2c): Rename as...
712 (Web2c Report): this.
713 (Web2c Actions): New.
714
7152001-12-22 Akim Demaille <akim@epita.fr>
716
717 Reductions in web2c.y are improperly reported.
718 Reported by Mike Castle.
719
720 * src/conflicts.c (print_reductions): Fix.
721 * tests/regression.at (Web2c): New.
722
7232001-12-18 Akim Demaille <akim@epita.fr>
724
725 Some host fail on `assert (!"foo")', which expands to
726 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
727 Reported by Nelson Beebee.
728
729 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
730 `#define it_succeeded 0' and `assert (it_succeeded)'.
731
7322001-12-17 Marc Autret <autret_m@epita.fr>
733
734 * src/bison.simple: Don't hard code the skeleton line and filename.
735 * src/output.c (output_parser): Rename 'line' as 'output_line'.
736 New line counter 'skeleton_line' (skeleton-line muscle).
737
7382001-12-17 Paul Eggert <eggert@twinsun.com>
739
740 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
741 YYDEBUG must be defined to a nonzero value.
742
743 * src/bison.simple (yytname): Do not assume that the user defines
744 YYDEBUG to a properly parenthesized expression.
745
7462001-12-17 Akim Demaille <akim@epita.fr>
747
748 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
749 nlookaheads is a new member.
750 Adjust all users.
751 * src/lalr.h (nlookaheads): Remove this orphan declaration.
752 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
753 state.
754
7552001-12-17 Akim Demaille <akim@epita.fr>
756
757 * src/files.h, src/files.c (open_files, close_files): Remove.
758 * src/main.c (main): Don't open/close files, nor invoke lex_free,
759 let...
760 * src/reader.c (reader): Do it.
761
7622001-12-17 Akim Demaille <akim@epita.fr>
763
764 * src/conflicts.c (print_reductions): Formatting changes.
765
7662001-12-17 Akim Demaille <akim@epita.fr>
767
768 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
769 (flush_reduce): New.
770 (resolve_sr_conflict): Adjust.
771
7722001-12-17 Akim Demaille <akim@epita.fr>
773
774 * src/output.c (output_obstack): Be static and rename as...
775 (format_obstack): this, to avoid any confusion with files.c's
776 output_obstack.
777 * src/reader.h (muscle_obstack): Move to...
778 * src/output.h: here, since it's defined in output.c.
779
7802001-12-17 Akim Demaille <akim@epita.fr>
781
782 * src/output.c (action_row, save_column, default_goto)
783 (sort_actions, matching_state, pack_vector): Better variable
784 locality.
785
7862001-12-17 Akim Demaille <akim@epita.fr>
787
788 * src/output.c: Various formatting changes.
789
7902001-12-17 Akim Demaille <akim@epita.fr>
791
792 * src/files.c (output_files): Free the output_obstack.
793 * src/main.c (main): Call print and print_graph conditionally.
794 * src/print.c (print): Work unconditionally.
795 * src/print_graph.c (print_graph): Work unconditionally.
796 * src/conflicts.c (log_resolution): Output only if verbose_flag.
797
7982001-12-16 Marc Autret <autret_m@epita.fr>
799
800 * src/output.c (actions_output): Fix. When we use %no-lines,
801 there is one less line per action.
802
8032001-12-16 Marc Autret <autret_m@epita.fr>
804
805 * src/bison.simple: Remove a useless #line directive.
806 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
807 * src/output.c (get_lines_number): New.
808 (output_parser): Adjust, now takes care about the lines of a
809 output muscles.
810 Fix line numbering.
811 (actions_output): Computes the number of lines taken by actions.
812 (output_master_parser): Insert new skeleton which is the name of
813 the output parser file name.
814
8152001-12-15 Marc Autret <autret_m@epita.fr>
816
817 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
818
8192001-12-15 Marc Autret <autret_m@epita.fr>
820
821 * src/output.c (output_gram): Keep track of the hairy one.
822
8232001-12-15 Akim Demaille <akim@epita.fr>
824
825 Make `make distcheck' work.
826
827 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
828 system.h which uses libgettext.h.
829
8302001-12-15 Akim Demaille <akim@epita.fr>
831
832 * src/nullable.c (set_nullable): Useless rules must be skipped,
833 otherwise, since we range over their symbols, we might look at a
834 nonterminal which no longer ``exists'', i.e., it is not counted in
835 `nvars', hence we overflow our arrays.
836
8372001-12-15 Akim Demaille <akim@epita.fr>
838
839 The header can also be produced directly, without any obstack!
840 Yahoo!
841
842 * src/files.c, src/files.h (defines_obstack): Remove.
843 (compute_header_macro): Global.
844 (defines_obstack_save): Remove.
845 * src/reader.c (parse_union_decl): No longer output to
846 defines_obstack: its content can be found in the `stype' muscle
847 anyway.
848 (output_token_translations): Merge into...
849 (symbols_output): this.
850 Rename as...
851 (symbols_save): this.
852 (reader): Adjust.
853 * src/output.c (header_output): New.
854 (output): Call it.
855
8562001-12-15 Akim Demaille <akim@epita.fr>
857
858 * src/reader.c (parse_union_decl): Instead of handling two obstack
859 simultaneously, use one to define the `stype' muscle, and use the
860 value of the latter to fill defines_obstack.
861 (copy_comment): Remove.
862 (copy_comment2): Work for a single obstack.
863 Rename as...
864 (copy_comment): this.
865
8662001-12-15 Akim Demaille <akim@epita.fr>
867
868 * src/lex.c, src/lex.h (xgetc): No longer static.
869 * src/reader.c (parse_union_decl): Revamp.
870
8712001-12-15 Akim Demaille <akim@epita.fr>
872
873 Still making progress in separating Bison into (i) input, (ii)
874 process, (iii) output: now we can directly output the parser file
875 without using table_obstack at all.
876
877 * src/files.c, src/files.h (table_obstack): Bye bye.
878 (parser_file_name): New.
879 * src/files.c (compute_output_file_names): Compute it.
880 * src/output.c (actions_output, output_parser)
881 (output_master_parser): To a file instead of an obstack.
882
8832001-12-15 Akim Demaille <akim@epita.fr>
884
885 Attach actions to rules, instead of pre-outputting them to
886 actions_obstack.
887
888 * src/gram.h (rule_t): action and action_line are new members.
889 * src/reader.c (symbol_list): Likewise.
890 (copy_action): Save the actions within the rule.
891 (packgram): Save them in rule_table.
892 * src/output.c (actions_output): New.
893 (output_parser): Use it on `%%actions'.
894 (output_rule_data): Don't free rule_table.
895 (output): Do it.
896 (prepare): Don't save the `action' muscle.
897 * src/bison.simple: s/%%action/%%actions/.
898
8992001-12-15 Akim Demaille <akim@epita.fr>
900
901 * src/reader.c (copy_action): When --yacc, don't append a `;'
902 to the user action: let it fail if lacking.
903 Suggested by Arnold Robbins and Tom Tromey.
904
9052001-12-14 Akim Demaille <akim@epita.fr>
906
907 * src/lex.c (literalchar): Simply return the char you decoded, non
908 longer mess around with obstacks and int pointers.
909 Adjust all callers.
910
9112001-12-14 Akim Demaille <akim@epita.fr>
912
913 * src/lex.c (literalchar): Don't escape the special characters,
914 just decode them, and keep them as char (before, eol was output as
915 the 2 char string `\n' etc.).
916 * src/output.c (output_rule_data): Use quotearg to output the
917 token strings.
918
9192001-12-13 Paul Eggert <eggert@twinsun.com>
920
921 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
922 Do not infringe on the global user namespace when using C++.
923 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
924 All uses of `fprintf' and `stderr' changed.
925
926 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
927
9282001-12-13 Akim Demaille <akim@epita.fr>
929
930 The computation of nullable is broken: it doesn't handle empty
931 RHS's properly.
932
933 * tests/torture.at (GNU AWK Grammar): New.
934 * tests/sets.at (Nullable): New.
935 * src/nullable.c (set_nullable): Instead of blindly looping over
936 `ritems', loop over the rules, and then over their rhs's.
937
938 Work around Autotest bugs.
939
940 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
941 frame, because Autotest understand lines starting with a `+' as
942 traces from the shell. Then, they are not processed properly.
943 Admittedly an Autotest bug, but we don't have time to wait for
944 Autotest to catch up.
945 * tests/regression.at (Broken Closure): Adjust to the new table
946 frames.
947 Move to...
948 * tests/sets.at: here.
949
9502001-12-13 Akim Demaille <akim@epita.fr>
951
952 * src/closure.c (closure): Use nrules instead of playing tricks
953 with BITS_PER_WORD.
954
9552001-12-13 Akim Demaille <akim@epita.fr>
956
957 * src/print.c (print_actions): Output the handling of `$' as the
958 traces do: shifting the token EOF. Before EOF was treated as a
959 nonterminal.
960 * tests/regression.at: Adjust some tests.
961 * src/print_graph.c (print_core): Complete the set of items via
962 closure. The next-to-final and final states are still unsatisfying,
963 but that's to be addressed elsewhere.
964 No longer output the rule numbers, but do output the state number.
965 A single loop for the shifts + gotos is enough, but picked a
966 distinct color for each.
967 (print_graph): Initialize and finalize closure.
968
9692001-12-13 Akim Demaille <akim@epita.fr>
970
971 * src/reader.c (readgram): Remove dead code, an strip useless
972 braces.
973 (get_type): Remove, unused.
974
9752001-12-12 Akim Demaille <akim@epita.fr>
976
977 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
978 on that of lib/error.c.
979
9802001-12-12 Akim Demaille <akim@epita.fr>
981
982 Some hosts don't like `/' in includes.
983
984 * src/system.h: Include libgettext.h without qualifying the path.
985 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
986 $(top_srcdir).
987
9882001-12-11 Marc Autret <autret_m@epita.fr>
989
990 * src/output.c (output_parser): Remove useless muscle.
991
9922001-12-11 Marc Autret <autret_m@epita.fr>
993
994 * src/bison.simple: Remove #line just before %%epilogue. It
995 is now handled in ...
996 * src/reader.c (read_additionnal_code): Add the output of a
997 #line for the epilogue.
998
9992001-12-10 Marc Autret <autret_m@epita.fr>
1000
1001 * src/reader.c (copy_definition): Re-use CPP-outed code which
1002 replace precedent remove.
1003 * src/bison.simple: Remove #line before %%prologue because
1004 %%input-line is wrong at this time.
1005
10062001-12-10 Marc Autret <autret_m@epita.fr>
1007
1008 * src/reader.c (symbols_output): Clean up.
1009 * src/output.c (output_gram, output): Clean up.
1010
10112001-12-10 Akim Demaille <akim@epita.fr>
1012
1013 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1014 * src/LR0.c (set_state_table): here.
1015 * src/lalr.c (lalr): Call it.
1016
10172001-12-10 Akim Demaille <akim@epita.fr>
1018
1019 * src/state.h (shifts): Remove the `number' member: shifts are
1020 attached to state, hence no longer need to be labelled with a
1021 state number.
1022
10232001-12-10 Akim Demaille <akim@epita.fr>
1024
1025 Now that states have a complete set of members, the linked list of
1026 shifts is useless: just fill directly the state's shifts member.
1027
1028 * src/state.h (shifts): Remove the `next' member.
1029 * src/LR0.c (first_state, last_state): Remove.
1030 Adjust the callers.
1031 (augment_automaton): Don't look for the shifts that must be added
1032 a shift on EOF: it is those of the state we looked for! But now,
1033 since shifts are attached, it is no longer needed to looking
1034 merely by its id: its number.
1035
10362001-12-10 Akim Demaille <akim@epita.fr>
1037
1038 * src/LR0.c (augment_automaton): Better variable locality.
1039 Remove an impossible branch: if there is a state corresponding to
1040 the start symbol being shifted, then there is shift for the start
1041 symbol from the initial state.
1042
10432001-12-10 Akim Demaille <akim@epita.fr>
1044
1045 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1046 only when appropriate: when insert_start_shifting_state' is not
1047 invoked.
1048 * tests/regression.at (Rule Line Numbers): Adjust.
1049
10502001-12-10 Akim Demaille <akim@epita.fr>
1051
1052 * src/LR0.c (augment_automaton): Now that all states have shifts,
1053 merge the two cases addition shifts to the initial state.
1054
10552001-12-10 Akim Demaille <akim@epita.fr>
1056
1057 * src/lalr.c (set_state_table): Move to...
1058 * src/LR0.c: here.
1059 * src/lalr.c (lalr): Don't call it...
1060 * src/LR0.c (generate_states): do it.
1061 * src/LR0.h (first_state): Remove, only the table is used.
1062
10632001-12-10 Akim Demaille <akim@epita.fr>
1064
1065 * src/LR0.h (first_shift, first_reduction): Remove.
1066 * src/lalr.c: Don't use first_shift: find shifts through the
1067 states.
1068
10692001-12-10 Akim Demaille <akim@epita.fr>
1070
1071 * src/LR0.c: Attach shifts to states as soon as they are
1072 computed.
1073 * src/lalr.c (set_state_table): Instead of assigning shifts to
1074 state, just assert that the mapping was properly done.
1075
10762001-12-10 Akim Demaille <akim@epita.fr>
1077
1078 * src/LR0.c (insert_start_shift): Rename as...
1079 (insert_start_shifting_state): this.
1080 (insert_eof_shifting_state, insert_accepting_state): New.
1081 (augment_automaton): Adjust.
1082 Better locality of the variables.
1083 When looking if the start_symbol is shifted from the initial
1084 state, using `while (... symbol != start_symbol ...)' sounds
1085 better than `while (... symbol < start_symbol ...)': If fail
1086 to see how the order between symbols could be relevant!
1087
10882001-12-10 Akim Demaille <akim@epita.fr>
1089
1090 * src/getargs.h: Don't declare `spec_name_prefix' and
1091 `spec_file_prefix', declared by src/files.h.
1092 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1093 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1094 * src/output.c (prepare): Adjust.
1095 * src/reader.c (symbols_output): Likewise.
1096 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1097
10982001-12-10 Akim Demaille <akim@epita.fr>
1099
1100 * src/muscle_tab.c (muscle_init): NULL is a better default than
1101 `"0"'.
1102
11032001-12-10 Akim Demaille <akim@epita.fr>
1104
1105 * src/reader.c (reader): Calling symbols_output once is enough.
1106
11072001-12-10 Akim Demaille <akim@epita.fr>
1108
1109 Now that states have a complete set of members, the linked list of
1110 reductions is useless: just fill directly the state's reductions
1111 member.
1112
1113 * src/state.h (struct reductions): Remove member `number' and
1114 `next'.
1115 * src/LR0.c (first_reduction, last_reduction): Remove.
1116 (save_reductions): Don't link the new reductions, store them in
1117 this_state.
1118 * src/lalr.c (set_state_table): No need to attach reductions to
1119 states, it's already done.
1120 * src/output.c (output_actions): No longer free the shifts, then
1121 the reductions, then the states: free all the states and their
1122 members.
1123
11242001-12-10 Akim Demaille <akim@epita.fr>
1125
1126 * src/options.c (OPTN, DRTV, BOTH): New.
1127 (option_table): Use them.
1128
1129 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1130 the job of system.h.
1131 * src/options.c: Don't include stdio.h and xalloc.h for the same
1132 reasons.
1133
11342001-12-10 Akim Demaille <akim@epita.fr>
1135
1136 * src/output.c (output, prepare): Make sure the values of the
1137 muscles `action' and `prologue' are 0-terminated.
1138
11392001-12-10 Akim Demaille <akim@epita.fr>
1140
1141 Clean up GCC warnings.
1142
1143 * src/reader.c (copy_action): `buf' is not used.
1144 (parse_skel_decl): Be static.
1145 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1146 * src/options.h (create_long_option_table): Have a real prototype.
1147 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1148 (hash_delete_at): Return const void *.
1149 Adjust casts to preserve the const.
1150
11512001-12-10 Akim Demaille <akim@epita.fr>
1152
1153 * configure.in: Require 2.52g.
1154 M4 is not needed, but AUTOM4TE is.
1155 * m4/m4.m4: Remove.
1156 * tests/Makefile.am: Adjust.
1157
11582001-12-10 Akim Demaille <akim@epita.fr>
1159
1160 One structure for states is enough, even though theoretically
1161 there are LR(0) states and LALR(1) states.
1162
1163 * src/lalr.h (state_t): Remove.
1164 (state_table): Be state_t **, not state_t *.
1165 * src/state.h (core, CORE_ALLOC): Rename as...
1166 (state_t, STATE_ALLOC): this.
1167 Add the LALR(1) members: shifts, reductions, errs.
1168 * src/LR0.c (state_table): Rename as...
1169 (state_hash): this, to avoid name clashes with the global
1170 `state_table'.
1171 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1172 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1173
11742001-12-10 Akim Demaille <akim@epita.fr>
1175
1176 Bison dumps core on bash.y.
1177 Reported by Pascal Bart.
1178
1179 * src/warshall.c (bitmatrix_print): New.
1180 (TC): Use it.
1181 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1182 j must be the outer loop.
1183 * tests/regression.at (Broken Closure): New.
1184
11852001-12-05 Akim Demaille <akim@epita.fr>
1186
1187 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1188 its argument.
1189