]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-03-04 Akim Demaille <akim@epita.fr>
2
3 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
4 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
5 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
6 * tests/semantic.at (Parsing Guards): Similarly.
7 * src/reader.at (readgram): Complain if the last rule is not ended
8 with a semi-colon.
9
102002-03-04 Akim Demaille <akim@epita.fr>
11
12 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
13 * src/closure.c: here.
14 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
15 RTC.
16 * src/warshall.h, src/warshall.c: Remove.
17 * tests/sets.at (Broken Closure): Adjust.
18
192002-03-04 Akim Demaille <akim@epita.fr>
20
21 * src/output.c (output_skeleton): tempdir is const.
22 bytes_read is unused.
23
242002-03-04 Akim Demaille <akim@epita.fr>
25
26 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
27 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
28 Update.
29 From Michael Hayes.
30
312002-03-04 Akim Demaille <akim@epita.fr>
32
33 * src/closure.c (closure): `r' is unused.
34
352002-03-04 Akim Demaille <akim@epita.fr>
36
37 * tests/sets.at (Broken Closure): Add the ending `;'.
38 * src/reader.at (readgram): Complain if a rule is not ended with a
39 semi-colon.
40
412002-03-04 Akim Demaille <akim@epita.fr>
42
43 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
44 (count_sr_conflicts): Use bitset_count.
45 * src/reduce.c (inaccessable_symbols): Ditto.
46 (bits_size): Remove.
47 * src/warshall.h, src/warshall.c: Convert to bitsetv.
48
492002-03-04 Akim Demaille <akim@epita.fr>
50
51 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
52 * src/reduce.c: Remove the `bitset_zero's following the
53 `bitset_create's, as now it is performed by the latter.
54
552002-03-04 Akim Demaille <akim@epita.fr>
56
57 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
58 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
59 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
60 latest sources from Michael.
61
622002-03-04 Akim Demaille <akim@epita.fr>
63
64 * src/output.c (output): Don't free the grammar.
65 * src/reader.c (grammar_free): New.
66 * src/main.c (main): Call it and don't free symtab here.
67
682002-03-04 Akim Demaille <akim@epita.fr>
69
70 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
71 before returning.
72 Reported by Benoit Perrot.
73
742002-03-04 Akim Demaille <akim@epita.fr>
75
76 Use bitset operations when possible, not loops over bits.
77
78 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
79 bitset_or.
80 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
81 * src/reduce.c (useless_nonterminals): Formatting changes.
82 * src/warshall.c (TC): Use bitset_or.
83
842002-03-04 Akim Demaille <akim@epita.fr>
85
86 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
87 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
88 Ditto.
89
902002-03-04 Akim Demaille <akim@epita.fr>
91
92 * src/lalr.c (F): Now a bitset*.
93 Adjust all dependencies.
94
952002-03-04 Akim Demaille <akim@epita.fr>
96
97 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
98 Adjust all dependencies.
99
1002002-03-04 Akim Demaille <akim@epita.fr>
101
102 * src/L0.c, src/LR0.h (nstates): Be size_t.
103 Adjust comparisons (signed vs unsigned).
104 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
105 bitset*.
106 Adjust all dependencies.
107
1082002-03-04 Akim Demaille <akim@epita.fr>
109
110 * src/closure.c (firsts): Now, also a bitset.
111 Adjust all dependencies.
112 (varsetsize): Remove, now unused.
113 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
114
1152002-03-04 Akim Demaille <akim@epita.fr>
116
117 * src/print.c: Convert to use bitset.h, not hand coded iterations
118 over ints.
119
1202002-03-04 Akim Demaille <akim@epita.fr>
121
122 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
123
1242002-03-04 Akim Demaille <akim@epita.fr>
125
126 * src/closure.c (ruleset): Be a bitset.
127 (rulesetsize): Remove.
128
1292002-03-04 Akim Demaille <akim@epita.fr>
130
131 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
132 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
133 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
134 * src/closure.c (fderives): Be an array of bitsets.
135
1362002-02-28 Robert Anisko <robert@lrde.epita.fr>
137
138 * data/bison.c++: Merge the two generated headers. Insert a copyright
139 notice in each output file.
140
1412002-02-28 Akim Demaille <akim@epita.fr>
142
143 * data/bison.c++: Copy the prologue of bison.simple to fetch
144 useful M4 definitions, such as b4_header_guard.
145
1462002-02-25 Akim Demaille <akim@epita.fr>
147
148 * src/getargs.c (version): Give the name of the authors, and use a
149 translator friendly scheme for the bgr
150 copyright notice.
151
1522002-02-25 Akim Demaille <akim@epita.fr>
153
154 * src/output.c (header_output): Remove, now handled completely via
155 M4.
156
1572002-02-25 Akim Demaille <akim@epita.fr>
158
159 * m4/m4.m4: New, from CVS Autoconf.
160 * configure.in: Invoke it.
161 * src/output.c (output_skeleton): Use its result instead of the
162 hard coded name.
163
1642002-02-25 Akim Demaille <akim@epita.fr>
165
166 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
167 Fileutils 4.1.5.
168 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
169 * src/output.c (output_skeleton): Use mkstemp to create a real
170 temporary file.
171 Move the filling of `skeleton' and its muscle to...
172 (prepare): here.
173 (output): Move the definition of the prologue muscle to...
174 (prepare): here.
175 * src/system.h (DEFAULT_TMPDIR): New.
176
1772002-02-14 Paul Eggert <eggert@twinsun.com>
178
179 Remove the support for C++ namespace cleanliness; it was
180 causing more problems than it was curing, since it didn't work
181 properly on some nonstandard C++ compilers. This can wait
182 for a proper C++ parser.
183
184 * NEWS: Document this.
185 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
186 of C++, as it's treated like C now.
187 * src/bison.simple (YYSTD): Remove.
188 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
189 Treat C++ just like Standard C instead of trying to support
190 namespace cleanliness.
191
1922002-02-14 Akim Demaille <akim@epita.fr>
193
194 * tests/regression.at (else): Adjust to Andreas' change.
195
1962002-02-14 Akim Demaille <akim@epita.fr>
197
198 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
199
2002002-02-13 Andreas Schwab <schwab@suse.de>
201
202 * src/output.c (output_rule_data): Don't output NULL, it might
203 not be defined yet.
204
2052002-02-11 Robert Anisko <robert@lrde.epita.fr>
206
207 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
208 (Copyright notice): Update.
209
2102002-02-11 Akim Demaille <akim@epita.fr>
211
212 * tests/regression.at (%nonassoc and eof): Don't include
213 nonportable headers.
214
2152002-02-08 Robert Anisko <robert@lrde.epita.fr>
216
217 * data/bison.c++: Correct error recovery. Make the user able to
218 initialize the starting location.
219
2202002-02-07 Akim Demaille <akim@epita.fr>
221
222 * tests/input.at: New.
223
2242002-02-07 Robert Anisko <robert@lrde.epita.fr>
225
226 * data/bison.c++: Replace some direct m4 expansions by constants. Be
227 more consistent when naming methods and variables. Put preprocessor
228 directives around tables only needed for debugging.
229
2302002-02-07 Robert Anisko <robert@lrde.epita.fr>
231
232 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
233 C++ parsers.
234 (yy::b4_name::parse): Use print_.
235
2362002-02-07 Robert Anisko <robert@lrde.epita.fr>
237
238 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
239
2402002-02-07 Robert Anisko <robert@lrde.epita.fr>
241
242 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
243 C++ parsers.
244 (yy::b4_name::parse): Build verbose error messages, and use error_.
245
2462002-02-06 Robert Anisko <robert@lrde.epita.fr>
247
248 * data/bison.c++: Fix m4 quoting in comments.
249
2502002-02-06 Robert Anisko <robert@lrde.epita.fr>
251
252 * data/bison.c++: Adjust the parser code. Fix some muscles that were
253 not expanded by m4.
254
2552002-02-05 Akim Demaille <akim@epita.fr>
256
257 * data/bison.c++: Adjust to the M4 back end.
258 More is certainly needed.
259
2602002-02-05 Akim Demaille <akim@epita.fr>
261
262 Give a try to M4 as a back end.
263
264 * lib/readpipe.c: New, from wdiff.
265 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
266 BISON_HAIRY.
267 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
268 specific values. Now it is m4 that performs the lookup.
269 * src/parse-skel.y: Remove.
270 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
271 * src/output.c (actions_output, guards_output)
272 (token_definitions_output): No longer keeps track of the output
273 line number, hence remove the second argument.
274 (guards_output): Check against the guard member of a rule, not the
275 action member.
276 Adjust callers.
277 (output_skeleton): Don't look for the skeleton location, let m4 do
278 that.
279 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
280 file will be used.
281 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
282 (prepare): Given that for the time being changesyntax is not
283 usable in M4, rename the muscles using `-' to `_'.
284 Define `defines_flag', `output_parser_name' and `output_header_name'.
285 * src/output.h (actions_output, guards_output)
286 (token_definitions_output): Adjust prototypes.
287 * src/scan-skel.l: Instead of scanning the skeletons, it now
288 processes the output of m4: `__oline__' and `#output'.
289 * data/bison.simple: Adjust to be used by M4(sugar).
290 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
291 to date.
292 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
293 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
294 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
295 shamelessly stolen from CVS Autoconf.
296
2972002-02-05 Akim Demaille <akim@epita.fr>
298
299 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
300 * configure.in: Check for the declarations of free and malloc.
301 * src/muscle_tab.c: Adjust.
302
3032002-02-05 Akim Demaille <akim@epita.fr>
304
305 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
306 which have no values.
307
3082002-02-05 Akim Demaille <akim@epita.fr>
309
310 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
311 * data/: here.
312
3132002-01-29 Paul Eggert <eggert@twinsun.com>
314
315 * src/bison.simple (YYSIZE_T): Do not define merely because
316 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
317 On some platforms, <alloca.h> does not declare YYSTD (size_t).
318
3192002-01-27 Akim Demaille <akim@epita.fr>
320
321 Fix `%nonassoc and eof'.
322
323 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
324 which were not properly copied! Replace
325 memcpy (res->errs, src->errs, src->nerrs);
326 with
327 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
328 !!!
329 * tests/regression.at (%nonassoc and eof): Adjust to newest
330 Autotest: `.' is not in the PATH.
331
3322002-01-27 Akim Demaille <akim@epita.fr>
333
334 * tests/sets.at (AT_EXTRACT_SETS): New.
335 (Nullable): Use it.
336 (Firsts): New.
337
3382002-01-26 Akim Demaille <akim@epita.fr>
339
340 * tests/actions.at, tests/calc.at, tests/headers.at,
341 * tests/torture.at: Adjust to the newest Autotest which no longer
342 forces `.' in the PATH.
343
3442002-01-25 Akim Demaille <akim@epita.fr>
345
346 * tests/regression.at (%nonassoc and eof): New.
347 Suggested by Robert Anisko.
348
3492002-01-24 Akim Demaille <akim@epita.fr>
350
351 Bison dumps core when trying to complain about broken input files.
352 Reported by Cris van Pelt.
353
354 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
355 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
356 into...
357 (Invalid inputs): Strengthen: exercise parse_percent_token.
358
3592002-01-24 Robert Anisko <robert.anisko@epita.fr>
360
361 * src/Makefile.am: Add bison.c++.
362 * src/bison.c++: New skeleton.
363
3642002-01-21 Paolo Bonzini <bonzini@gnu.org>
365
366 * po/it.po: New.
367
3682002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
369
370 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
371
3722002-01-20 Marc Autret <marc@gnu.org>
373
374 * src/files.c (compute_output_file_names): Fix
375
3762002-01-20 Marc Autret <marc@gnu.org>
377
378 * tests/output.at: New test.
379 * src/files.c (compute_base_names): Don't map extensions when
380 the YACC flag is set, use defaults.
381 Reported by Evgeny Stambulchik.
382
3832002-01-20 Marc Autret <marc@gnu.org>
384
385 * src/system.h: Need to define __attribute__ away for non-GCC
386 compilers as well (i.e. the vendor C compiler).
387 Suggested by Albert Chin-A-Young.
388
3892002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
390
391 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
392 canonical definition.
393 * src/system.h: Use the canonical definition for PARAMS (avoids
394 a conflict with the macro from lib/hash.h).
395
3962002-01-11 Akim Demaille <akim@epita.fr>
397
398 * configure.in: Use AC_FUNC_STRNLEN.
399 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
400
4012002-01-09 Akim Demaille <akim@epita.fr>
402
403 * src/files.c, src/files.h (output_infix): New.
404 (tab_extension): Remove.
405 (compute_base_names): Compute the former, drop the latter.
406 * src/output.c (prepare): Insert the muscles `output-infix', and
407 `output-suffix'.
408 * src/parse-skel.y (string, string.1): New.
409 (section.header): Use it.
410 (section.yacc): Remove.
411 (prefix): Remove too.
412 * src/scan-skel.l: Adjust.
413 * src/bison.simple, src/bison.hairy: Adjust.
414
4152002-01-09 Akim Demaille <akim@epita.fr>
416
417 * configure.in (WERROR_CFLAGS): Compute it.
418 * src/Makefile.am (CFLAGS): Pass it.
419 * tests/atlocal.in (CFLAGS): Idem.
420 * src/files.c: Fix a few warnings.
421 (get_extension_index): Remove, unused.
422
4232002-01-08 Akim Demaille <akim@epita.fr>
424
425 * src/getargs.c (AS_FILE_NAME): New.
426 (getargs): Use it to convert DOSish file names.
427 * src/files.c (base_name): Rename as full_base_name to avoid
428 clashes with `base_name ()'.
429 (filename_split): New.
430 (compute_base_names): N-th rewrite, using filename_split.
431
4322002-01-08 Akim Demaille <akim@epita.fr>
433
434 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
435 New, stolen from the Fileutils 4.1.
436 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
437 * configure.in: Check for the presence of memrchr, and of its
438 prototype.
439
4402002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
441
442 * lib/hash.h (__P): Added definition for this macro.
443 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
444 BUILT_SOURCES, to ensure they are generated first.
445 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
446 %error-verbose to allow bootstrapping with bison 1.30x.
447
4482002-01-06 Akim Demaille <akim@epita.fr>
449
450 * src/reader.c (parse_braces): Don't fetch the next char, the
451 convention is to fetch on entry.
452 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
453 'switch' without a following semicolon.
454 * tests/regression.at (braces parsing): New.
455
4562002-01-06 Akim Demaille <akim@epita.fr>
457
458 Bison is dead wrong in its RR conflict reports.
459
460 * tests/torture.at (GNU Cim Grammar): New.
461 * src/conflicts.c (count_rr_conflicts): Fix.
462
4632002-01-06 Akim Demaille <akim@epita.fr>
464
465 Creating package.m4 from configure.ac causes too many problems.
466
467 * tests/Makefile.am (package.m4): Create it by hand,
468 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
469
4702002-01-06 Akim Demaille <akim@epita.fr>
471
472 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
473 skeleton.h.
474
4752002-01-04 Paul Eggert <eggert@twinsun.com>
476
477 * doc/bison.texinfo (Debugging):
478 Remove YYSTDERR; it's no longer defined or used.
479 Also, s/cstdio.h/cstdio/.
480
4812002-01-03 Akim Demaille <akim@epita.fr>
482
483 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
484
4852002-01-03 Akim Demaille <akim@epita.fr>
486
487 * src/parse-skel.y (process_skeleton): Don't bind the parser's
488 tracing code to --trace, wait for a better --trace option, with
489 args.
490
4912002-01-03 Akim Demaille <akim@epita.fr>
492
493 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
494 The ISO C++ standard is extremely clear about it: stderr is
495 considered a macro, not a regular symbol (see table 94 `Header
496 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
497 Therefore std:: does not apply to it. It still does with fprintf.
498 Also, s/cstdio.h/cstdio/.
499
5002002-01-03 Akim Demaille <akim@epita.fr>
501
502 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
503 for non system headers.
504
5052002-01-02 Akim Demaille <akim@epita.fr>
506
507 Equip the skeleton chain with location tracking, runtime trace,
508 pure parser and scanner.
509
510 * src/parse-skel.y: Request a pure parser, locations, and prefix
511 renaming.
512 (%union): Having several members with the same type does not help
513 type mismatches, simplify.
514 (YYPRINT, yyprint): New.
515 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
516 (skel_error): this.
517 Handle locations.
518 * src/scan-skel.l: Adjust to these changes.
519 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
520 (LOCATION_PRINT, skel_control_t): New.
521
5222001-12-30 Akim Demaille <akim@epita.fr>
523
524 * src/parse-skel.y: Get rid of the shift/reduce conflict:
525 replace `gb' with BLANKS.
526 * src/scan-skel.l: Adjust.
527
5282001-12-30 Akim Demaille <akim@epita.fr>
529
530 * src/system.h: We don't need nor want bcopy.
531 Throw away MS-DOS crap: we don't need getpid.
532 * configure.in: We don't need strndup. It was even causing
533 problems: because Flex includes the headers *before* us,
534 _GNU_SOURCE is not defined by config.h, and therefore strndup was
535 not visible.
536 * lib/xstrndup.c: New.
537 * src/scan-skel.l: Use it.
538 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
539 * src/parse-skel.y: Use %directives instead of #defines.
540
5412001-12-30 Akim Demaille <akim@epita.fr>
542
543 * src/skeleton.h: New.
544 * src/output.c (output_parser, output_master_parser): Remove, dead
545 code.
546 * src/output.h (get_lines_number, actions_output, guards_output)
547 (token_definitions_output): Prototype them.
548 * src/parse-skel.y: Add the license notice.
549 Include output.h and skeleton.h.
550 (process_skeleton): Returns void, and takes a single parameter.
551 * src/scan-skel.l: Add the license notice.
552 Include skeleton.h.
553 Don't use %option yylineno: it seems that then Flex imagines
554 REJECT has been used, and therefore it won't reallocate its
555 buffers (which makes no other sense to me than a bug). It results
556 in warnings for `unused: yy_flex_realloc'.
557
5582001-12-30 Robert Anisko <robert.anisko@epita.fr>
559
560 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
561 (MUSCLE_INSERT_PREFIX): ...to there.
562 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
563 (MUSCLE_INSERT_PREFIX): Move from here...
564
565 * src/bison.hairy: Add a section directive. Put braces around muscle
566 names. This parser skeleton is still broken, but Bison should not
567 choke on a bad muscle 'syntax'.
568 * src/bison.simple: Add a section directive. Put braces around muscle
569 names.
570
571 * src/files.h (strsuffix, stringappend): Add declarations.
572 (tab_extension): Add declaration.
573 (short_base_name): Add declaration.
574
575 * src/files.c (strsuffix, stringappend): No longer static. These
576 functions are used in the skeleton parser.
577 (tab_extension): New.
578 (compute_base_names): Use the computations done in this function
579 to guess if the generated parsers should have '.tab' in their
580 names.
581 (short_base_name): No longer static.
582
583 * src/output.c (output_skeleton): New.
584 (output): Disable call to output_master_parser, and give a try to
585 a new skeleton handling system.
586 (guards_output, actions_output): No longer static.
587 (token_definitions_output, get_lines_number): No longer static.
588
589 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
590
591 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
592 parse-skel.y.
593
594 * src/parse-skel.y: New file.
595 * src/scan-skel.l: New file.
596
5972001-12-29 Akim Demaille <akim@epita.fr>
598
599 %name-prefix is broken.
600
601 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
602 Adjust all dependencies.
603 * tests/headers.at (export YYLTYPE): Strengthen this test: use
604 %name-prefix.
605
606 Renaming yylval but not yylloc is not consistent. Now we do.
607
608 * src/bison.simple: Prefix yylloc if used.
609 * doc/bison.texinfo (Decl Summary): Document that.
610
6112001-12-29 Akim Demaille <akim@epita.fr>
612
613 * doc/bison.texinfo: Promote `%long-directive' over
614 `%long_directive'.
615 Remove all references to fixed-output-files, yacc is enough.
616
6172001-12-29 Akim Demaille <akim@epita.fr>
618
619 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
620 user prologue. These are defaults.
621 * tests/actions.at (Mid-rule actions): Make sure the user can
622 define YYDEBUG and YYERROR_VERBOSE.
623
6242001-12-29 Akim Demaille <akim@epita.fr>
625
626 * src/output.c (header_output): Don't forget to export YYLTYPE and
627 yylloc.
628 * tests/headers.at (export YYLTYPE): New, make sure it does.
629 * tests/regression.at (%union and --defines, Invalid CPP headers):
630 Move to...
631 * tests/headers.at: here.
632
6332001-12-29 Akim Demaille <akim@epita.fr>
634
635 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
636
6372001-12-29 Akim Demaille <akim@epita.fr>
638
639 * tests/actions.at (Mid-rule actions): Output on a single line
640 instead of several.
641
6422001-12-29 Akim Demaille <akim@epita.fr>
643
644 * doc/bison.texinfo: Formatting changes.
645
6462001-12-29 Akim Demaille <akim@epita.fr>
647
648 Don't store the token defs in a muscle, just be ready to output it
649 on command. Now possible via `symbols'. Fixes a memory leak.
650
651 * src/output.c (token_definitions_output): New.
652 (output_parser, header_output): Use it.
653 * src/reader.c (symbols_save): Remove.
654
6552001-12-29 Akim Demaille <akim@epita.fr>
656
657 * src/bison.simple: Do not provide a default for YYSTYPE and
658 YYLTYPE before the user's prologue. Otherwise it's hardly... a
659 default.
660
6612001-12-29 Akim Demaille <akim@epita.fr>
662
663 Mid-rule actions are simply... ignored!
664
665 * src/reader.c (readgram): Be sure to attach mid-rule actions to
666 the empty-rule associated to the dummy symbol, not to the host
667 rule.
668 * tests/actions.at (Mid-rule actions): New.
669
6702001-12-29 Akim Demaille <akim@epita.fr>
671
672 Memory leak.
673
674 * src/reader.c (reader): Free grammar.
675
6762001-12-29 Akim Demaille <akim@epita.fr>
677
678 Memory leak.
679
680 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
681 since it allocates it for each state, although only one is needed.
682 (allocate_storage): Do it here.
683
6842001-12-29 Akim Demaille <akim@epita.fr>
685
686 * src/options.h, src/options.c (create_long_option_table): Rename
687 as...
688 (long_option_table_new): this, with a clearer prototype.
689 (percent_table): Remove, unused,
690 * src/getargs.c (getargs): Adjust.
691
6922001-12-29 Akim Demaille <akim@epita.fr>
693
694 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
695 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
696 as states.
697
6982001-12-29 Akim Demaille <akim@epita.fr>
699
700 * src/lalr.c (build_relations): Rename `states' as `states1'.
701 Sorry, I don't understand exactly what it is, no better name...
702
7032001-12-29 Akim Demaille <akim@epita.fr>
704
705 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
706 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
707 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
708 as rules.
709
7102001-12-29 Akim Demaille <akim@epita.fr>
711
712 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
713 ago.
714
7152001-12-29 Akim Demaille <akim@epita.fr>
716
717 * src/reader.c, src/reader.h (user_toknums): Remove.
718 Adjust all users to use symbols[i]->user_token_number.
719
7202001-12-29 Akim Demaille <akim@epita.fr>
721
722 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
723 Adjust all users to use symbols[i]->prec or ->assoc.
724
7252001-12-29 Akim Demaille <akim@epita.fr>
726
727 * src/reader.c, src/reader.h (tags): Remove.
728 Adjust all users to use symbols[i]->tag.
729
7302001-12-29 Akim Demaille <akim@epita.fr>
731
732 * src/gram.h, src/gram.c (symbols): New, similar to state_table
733 and rule_table.
734 * src/reader.c (packsymbols): Fill this table.
735 Drop sprec.
736 * src/conflicts.c (resolve_sr_conflict): Adjust.
737 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
738 single table.
739 Use symbols[i]->tag instead of tags[i].
740
7412001-12-29 Akim Demaille <akim@epita.fr>
742
743 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
744 In addition, put a comment in there, to replace...
745 * tests/regression.at (%union and C comments): Remove.
746
7472001-12-29 Akim Demaille <akim@epita.fr>
748
749 * tests/regression.at (Web2c Actions): Blindly move the actual
750 output as expected output. The contents *seem* right to me, but I
751 can't pretend reading perfectly parser tables... Nonetheless, all
752 the other tests pass correctly, the table look OK, even though the
753 presence of `$axiom' is to be noted: AFAICS it is useless (but
754 harmless).
755
7562001-12-29 Akim Demaille <akim@epita.fr>
757
758 * src/reader.c (readgram): Don't add the rule 0 if there were no
759 rules read. In other words, add it _after_ having performed
760 grammar sanity checks.
761 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
762
7632001-12-29 Akim Demaille <akim@epita.fr>
764
765 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
766 visible, and some states have now a different number.
767
7682001-12-29 Akim Demaille <akim@epita.fr>
769
770 * src/reader.c (readgram): Bind the initial rule's lineno to that
771 of the first rule.
772 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
773 (Solved SR Conflicts): Adjust rule 0's line number.
774
7752001-12-29 Akim Demaille <akim@epita.fr>
776
777 Fix the `GAWK Grammar' failure.
778
779 * src/LR0.c (final_state): Initialize to -1 so that we do compute
780 the reductions of the first state which was mistakenly confused
781 with the final state because precisely final_state was initialized
782 to 0.
783 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
784 now noticed by Bison.
785 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
786 have a reduction on $default.
787
7882001-12-29 Akim Demaille <akim@epita.fr>
789
790 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
791 rule line numbers.
792 * src/closure.c (print_closure): Likewise.
793 * src/derives.c (print_derives): Likewise.
794 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
795 now.
796
7972001-12-29 Akim Demaille <akim@epita.fr>
798
799 * src/lalr.c (lookaheads_print): New.
800 (lalr): Call it when --trace-flag.
801 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
802 are dumped.
803
8042001-12-29 Akim Demaille <akim@epita.fr>
805
806 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
807 when walking through ritem, even via rule->rhs.
808 * src/reduce.c (dump_grammar, useful_production, reduce_output)
809 (useful_production, useless_nonterminals): Likewise.
810 (reduce_grammar_tables): Likewise, plus update nritems.
811 * src/nullable.c (set_nullable): Likewise.
812 * src/lalr.c (build_relations): Likewise.
813 * tests/sets.at (Nullable): Adjust.
814 Fortunately, now, the $axiom is no longer nullable.
815
8162001-12-29 Akim Demaille <akim@epita.fr>
817
818 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
819 the 0-sentinel.
820 * src/gram.c (ritem_longest_rhs): Likewise.
821 * src/reduce.c (nonterminals_reduce): Likewise.
822 * src/print_graph.c (print_graph): Likewise.
823 * src/output.c (output_rule_data): Likewise.
824 * src/nullable.c (set_nullable): Likewise.
825
8262001-12-29 Akim Demaille <akim@epita.fr>
827
828 * src/output.c: Comment changes.
829
8302001-12-27 Paul Eggert <eggert@twinsun.com>
831
832 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
833 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
834 Sparc, as they were causing more porting problems than the
835 (minor) performance improvement was worth.
836
837 Also, catch up with 1.31's YYSTD.
838
8392001-12-27 Akim Demaille <akim@epita.fr>
840
841 * src/output.c (output_gram): Rely on nritems, not the
842 0-sentinel. See below.
843 Use -1 as separator, not 0.
844 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
845 Rely on -1 as separator in yyrhs, instead of 0.
846 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
847 twice `Now at end of input', therefore there are two lines less to
848 expect.
849
8502001-12-27 Akim Demaille <akim@epita.fr>
851
852 * tests/regression.at (Unresolved SR Conflicts):
853 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
854 below.
855
8562001-12-27 Akim Demaille <akim@epita.fr>
857
858 * src/LR0.c (new_state): Recognize the final state by the fact it
859 is reached by eoftoken.
860 (insert_start_shifting_state, insert_eof_shifting_state)
861 (insert_accepting_state, augment_automaton): Remove, since now
862 these states are automatically computed from the initial state.
863 (generate_states): Adjust.
864 * src/print.c: When reporting a rule number to the user, substract
865 1, so that the axiom rule is rule 0, and the first user rule is 1.
866 * src/reduce.c: Likewise.
867 * src/print_graph.c (print_core): For the time being, just as for
868 the report, depend upon --trace-flags to dump the full set of
869 items.
870 * src/reader.c (readgram): Once the grammar read, insert the rule
871 0: `$axiom: START-SYMBOL $'.
872 * tests/set.at: Adjust: rule 0 is now displayed, and since the
873 number of the states has changed (the final state is no longer
874 necessarily the last), catch up.
875
8762001-12-27 Akim Demaille <akim@epita.fr>
877
878 Try to make the use of the eoftoken valid. Given that its value
879 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
880 is used instead of > 0 where appropriate, (ii), depend upon nritems
881 instead of the 0-sentinel.
882
883 * src/gram.h, src/gram.c (nritems): New.
884 Expected to be duplication of nitems, but for the time being...
885 * src/reader.c (packgram): Assert nritems and nitems are equal.
886 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
887 * src/closure.c (print_closure, print_fderives): Likewise.
888 * src/gram.c (ritem_print): Likewise.
889 * src/print.c (print_core, print_grammar): Likewise.
890 * src/print_graph.c: Likewise.
891
8922001-12-27 Akim Demaille <akim@epita.fr>
893
894 * src/main.c (main): If there are complains after grammar
895 reductions, then output the report anyway if requested, then die.
896 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
897 * src/reader.c (eoftoken): New.
898 (parse_token_decl): If the token being defined has value `0', it
899 is the eoftoken.
900 (packsymbols): No longer hack `tags' to insert `$' by hand.
901 Be sure to preserve the value of the eoftoken.
902 (reader): Make sure eoftoken is defined.
903 Initialize nsyms to 0: now eoftoken is created just like the others.
904 * src/print.c (print_grammar): Don't special case the eof token.
905 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
906 lie anyway, albeit pleasant.
907 * tests/calc.at: Exercise error messages with eoftoken.
908 Change the grammar so that empty input is invalid.
909 Adjust expectations.
910 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
911
9122001-12-27 Akim Demaille <akim@epita.fr>
913
914 * configure.in: Check the protos of strchr ans strspn.
915 Replace strchr if needed.
916 * src/system.h: Provide the protos of strchr, strspn and memchr if
917 missing.
918 * lib/strchr.c: New.
919 * src/reader.c (symbols_save): Use strchr.
920
9212001-12-27 Akim Demaille <akim@epita.fr>
922
923 * src/print.c, src/print_graph.c (escape): New.
924 Use it to quote the TAGS outputs.
925 * src/print_graph.c (print_state): Now errors are in red, and
926 reductions in green.
927 Prefer high to wide: output the state number on a line of its own.
928
9292001-12-27 Akim Demaille <akim@epita.fr>
930
931 * src/state.h, src/state.c (reductions_new): New.
932 * src/LR0.c (set_state_table): Let all the states have a
933 `reductions', even if reduced to 0.
934 (save_reductions): Adjust.
935 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
936 * src/print.c (print_reductions, print_actions): Adjust.
937 * src/output.c (action_row): Adjust.
938
9392001-12-27 Akim Demaille <akim@epita.fr>
940
941 * src/state.h, src/state.c (errs_new, errs_dup): New.
942 * src/LR0.c (set_state_table): Let all the states have an errs,
943 even if reduced to 0.
944 * src/print.c (print_errs, print_reductions): Adjust.
945 * src/output.c (output_actions, action_row): Adjust.
946 * src/conflicts.c (resolve_sr_conflict): Adjust.
947
9482001-12-27 Akim Demaille <akim@epita.fr>
949
950 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
951
9522001-12-27 Akim Demaille <akim@epita.fr>
953
954 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
955 * src/print.c: here.
956 (lookaheadset, shiftset): New, used as additional storage by
957 print_reductions.
958 (print_results): Adjust.
959 (print_shifts, print_gotos, print_errs): New, extracted from...
960 (print_actions): here.
961 * src/print_graph.c (print_actions): Remove dead code.
962
9632001-12-27 Akim Demaille <akim@epita.fr>
964
965 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
966 `$n' and `@n'.
967
9682001-12-27 Akim Demaille <akim@epita.fr>
969
970 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
971 (build_relations): Adjust.
972
9732001-12-27 Akim Demaille <akim@epita.fr>
974
975 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
976 duplication.
977
9782001-12-27 Akim Demaille <akim@epita.fr>
979
980 * src/reader.c (packgram): Catch nitems overflows.
981
9822001-12-27 Akim Demaille <akim@epita.fr>
983
984 * src/files.c, src/files.h (guard_obstack): Remove.
985 * src/output.c (output): Adjust.
986 * src/reader.c (parse_braces): New, factoring...
987 (copy_action, copy_guard): these two which are renamed as...
988 (parse_action, parse_guard): these.
989 As a voluntary consequence, using braces around guards is now
990 mandatory.
991
9922001-12-27 Akim Demaille <akim@epita.fr>
993
994 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
995 * src/reader.c (symbol_list): `guard' and `guard_line' are new
996 members.
997 (symbol_list_new): Adjust.
998 (copy_action): action_line is the first line, not the last.
999 (copy_guard): Just as for actions, store the `action' only, not
1000 the switch/case/break flesh.
1001 Don't parse the user action that might follow the guard, let...
1002 (readgram): do it, i.e., now, there can be an action after a
1003 guard.
1004 In other words the guard is just explicitly optional.
1005 (packgram): Adjust.
1006 * src/output.c (guards_output): New.
1007 (output_parser): Call it when needed.
1008 (output): Also free the guard and attrs obstacks.
1009 * src/files.c, src/files.h (obstack_save): Remove.
1010 (output_files): Remove.
1011 As a result, if one needs the former `.act' file, using an
1012 appropriate skeleton which requires actions and guards is now
1013 required.
1014 * src/main.c (main): Adjust.
1015 * tests/semantic.at: New.
1016 * tests/regression.at: Use `input.y' as input file name.
1017 Avoid 8+3 problems by requiring input.c when the test needs the
1018 parser.
1019
10202001-12-27 Akim Demaille <akim@epita.fr>
1021
1022 * src/reader.c (symbol_list_new): Be sure to initialize all the
1023 fields.
1024
10252001-12-27 Akim Demaille <akim@epita.fr>
1026
1027 All the hacks using a final pseudo state are now useless.
1028
1029 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1030 * src/lalr.c (nLA): New.
1031 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1032 instead of lookaheadsp from the pseudo state (nstate + 1).
1033
10342001-12-27 Akim Demaille <akim@epita.fr>
1035
1036 * src/output.c (action_row, token_actions): Use a state_t instead
1037 of a integer, and nlookaheads instead of the following state's
1038 lookaheadsp.
1039
10402001-12-27 Akim Demaille <akim@epita.fr>
1041
1042 * src/conflicts.c (log_resolution, flush_shift)
1043 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1044 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1045 (conflicts_print, print_reductions): Use a state_t instead of an
1046 integer when referring to a state.
1047 As much as possible, depend upon nlookaheads, instead of the
1048 `lookaheadsp' member of the following state (since lookaheads of
1049 successive states are successive, the difference between state n + 1
1050 and n served as the number of lookaheads for state n).
1051 * src/lalr.c (add_lookback_edge): Likewise.
1052 * src/print.c (print_core, print_actions, print_state)
1053 (print_results): Likewise.
1054 * src/print_graph.c (print_core, print_actions, print_state)
1055 (print_graph): Likewise.
1056 * src/conflicts.h: Adjust.
1057
10582001-12-27 Akim Demaille <akim@epita.fr>
1059
1060 * src/bison.hairy: Formatting/comment changes.
1061 ANSIfy.
1062 Remove `register' indications.
1063 Add plenty of `static'.
1064
10652001-12-27 Akim Demaille <akim@epita.fr>
1066
1067 * src/output.c (prepare): Drop the muscle `ntbase' which
1068 duplicates ntokens.
1069 * src/bison.simple: Formatting/comment changes.
1070 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1071 is an undocumented synonym.
1072
10732001-12-22 Akim Demaille <akim@epita.fr>
1074
1075 * src/output.c (output_table_data): Change the prototype to use
1076 `int' for array ranges: some invocations do pass an int, not a
1077 short.
1078 Reported by Wayne Green.
1079
10802001-12-22 Akim Demaille <akim@epita.fr>
1081
1082 Some actions of web2c.y are improperly triggered.
1083 Reported by Mike Castle.
1084
1085 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1086 * tests/regression.at (Web2c): Rename as...
1087 (Web2c Report): this.
1088 (Web2c Actions): New.
1089
10902001-12-22 Akim Demaille <akim@epita.fr>
1091
1092 Reductions in web2c.y are improperly reported.
1093 Reported by Mike Castle.
1094
1095 * src/conflicts.c (print_reductions): Fix.
1096 * tests/regression.at (Web2c): New.
1097
10982001-12-18 Akim Demaille <akim@epita.fr>
1099
1100 Some host fail on `assert (!"foo")', which expands to
1101 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1102 Reported by Nelson Beebee.
1103
1104 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1105 `#define it_succeeded 0' and `assert (it_succeeded)'.
1106
11072001-12-17 Marc Autret <autret_m@epita.fr>
1108
1109 * src/bison.simple: Don't hard code the skeleton line and filename.
1110 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1111 New line counter 'skeleton_line' (skeleton-line muscle).
1112
11132001-12-17 Paul Eggert <eggert@twinsun.com>
1114
1115 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1116 YYDEBUG must be defined to a nonzero value.
1117
1118 * src/bison.simple (yytname): Do not assume that the user defines
1119 YYDEBUG to a properly parenthesized expression.
1120
11212001-12-17 Akim Demaille <akim@epita.fr>
1122
1123 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1124 nlookaheads is a new member.
1125 Adjust all users.
1126 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1127 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1128 state.
1129
11302001-12-17 Akim Demaille <akim@epita.fr>
1131
1132 * src/files.h, src/files.c (open_files, close_files): Remove.
1133 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1134 let...
1135 * src/reader.c (reader): Do it.
1136
11372001-12-17 Akim Demaille <akim@epita.fr>
1138
1139 * src/conflicts.c (print_reductions): Formatting changes.
1140
11412001-12-17 Akim Demaille <akim@epita.fr>
1142
1143 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1144 (flush_reduce): New.
1145 (resolve_sr_conflict): Adjust.
1146
11472001-12-17 Akim Demaille <akim@epita.fr>
1148
1149 * src/output.c (output_obstack): Be static and rename as...
1150 (format_obstack): this, to avoid any confusion with files.c's
1151 output_obstack.
1152 * src/reader.h (muscle_obstack): Move to...
1153 * src/output.h: here, since it's defined in output.c.
1154
11552001-12-17 Akim Demaille <akim@epita.fr>
1156
1157 * src/output.c (action_row, save_column, default_goto)
1158 (sort_actions, matching_state, pack_vector): Better variable
1159 locality.
1160
11612001-12-17 Akim Demaille <akim@epita.fr>
1162
1163 * src/output.c: Various formatting changes.
1164
11652001-12-17 Akim Demaille <akim@epita.fr>
1166
1167 * src/files.c (output_files): Free the output_obstack.
1168 * src/main.c (main): Call print and print_graph conditionally.
1169 * src/print.c (print): Work unconditionally.
1170 * src/print_graph.c (print_graph): Work unconditionally.
1171 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1172
11732001-12-16 Marc Autret <autret_m@epita.fr>
1174
1175 * src/output.c (actions_output): Fix. When we use %no-lines,
1176 there is one less line per action.
1177
11782001-12-16 Marc Autret <autret_m@epita.fr>
1179
1180 * src/bison.simple: Remove a useless #line directive.
1181 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1182 * src/output.c (get_lines_number): New.
1183 (output_parser): Adjust, now takes care about the lines of a
1184 output muscles.
1185 Fix line numbering.
1186 (actions_output): Computes the number of lines taken by actions.
1187 (output_master_parser): Insert new skeleton which is the name of
1188 the output parser file name.
1189
11902001-12-15 Marc Autret <autret_m@epita.fr>
1191
1192 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1193
11942001-12-15 Marc Autret <autret_m@epita.fr>
1195
1196 * src/output.c (output_gram): Keep track of the hairy one.
1197
11982001-12-15 Akim Demaille <akim@epita.fr>
1199
1200 Make `make distcheck' work.
1201
1202 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1203 system.h which uses libgettext.h.
1204
12052001-12-15 Akim Demaille <akim@epita.fr>
1206
1207 * src/nullable.c (set_nullable): Useless rules must be skipped,
1208 otherwise, since we range over their symbols, we might look at a
1209 nonterminal which no longer ``exists'', i.e., it is not counted in
1210 `nvars', hence we overflow our arrays.
1211
12122001-12-15 Akim Demaille <akim@epita.fr>
1213
1214 The header can also be produced directly, without any obstack!
1215 Yahoo!
1216
1217 * src/files.c, src/files.h (defines_obstack): Remove.
1218 (compute_header_macro): Global.
1219 (defines_obstack_save): Remove.
1220 * src/reader.c (parse_union_decl): No longer output to
1221 defines_obstack: its content can be found in the `stype' muscle
1222 anyway.
1223 (output_token_translations): Merge into...
1224 (symbols_output): this.
1225 Rename as...
1226 (symbols_save): this.
1227 (reader): Adjust.
1228 * src/output.c (header_output): New.
1229 (output): Call it.
1230
12312001-12-15 Akim Demaille <akim@epita.fr>
1232
1233 * src/reader.c (parse_union_decl): Instead of handling two obstack
1234 simultaneously, use one to define the `stype' muscle, and use the
1235 value of the latter to fill defines_obstack.
1236 (copy_comment): Remove.
1237 (copy_comment2): Work for a single obstack.
1238 Rename as...
1239 (copy_comment): this.
1240
12412001-12-15 Akim Demaille <akim@epita.fr>
1242
1243 * src/lex.c, src/lex.h (xgetc): No longer static.
1244 * src/reader.c (parse_union_decl): Revamp.
1245
12462001-12-15 Akim Demaille <akim@epita.fr>
1247
1248 Still making progress in separating Bison into (i) input, (ii)
1249 process, (iii) output: now we can directly output the parser file
1250 without using table_obstack at all.
1251
1252 * src/files.c, src/files.h (table_obstack): Bye bye.
1253 (parser_file_name): New.
1254 * src/files.c (compute_output_file_names): Compute it.
1255 * src/output.c (actions_output, output_parser)
1256 (output_master_parser): To a file instead of an obstack.
1257
12582001-12-15 Akim Demaille <akim@epita.fr>
1259
1260 Attach actions to rules, instead of pre-outputting them to
1261 actions_obstack.
1262
1263 * src/gram.h (rule_t): action and action_line are new members.
1264 * src/reader.c (symbol_list): Likewise.
1265 (copy_action): Save the actions within the rule.
1266 (packgram): Save them in rule_table.
1267 * src/output.c (actions_output): New.
1268 (output_parser): Use it on `%%actions'.
1269 (output_rule_data): Don't free rule_table.
1270 (output): Do it.
1271 (prepare): Don't save the `action' muscle.
1272 * src/bison.simple: s/%%action/%%actions/.
1273
12742001-12-15 Akim Demaille <akim@epita.fr>
1275
1276 * src/reader.c (copy_action): When --yacc, don't append a `;'
1277 to the user action: let it fail if lacking.
1278 Suggested by Arnold Robbins and Tom Tromey.
1279
12802001-12-14 Akim Demaille <akim@epita.fr>
1281
1282 * src/lex.c (literalchar): Simply return the char you decoded, non
1283 longer mess around with obstacks and int pointers.
1284 Adjust all callers.
1285
12862001-12-14 Akim Demaille <akim@epita.fr>
1287
1288 * src/lex.c (literalchar): Don't escape the special characters,
1289 just decode them, and keep them as char (before, eol was output as
1290 the 2 char string `\n' etc.).
1291 * src/output.c (output_rule_data): Use quotearg to output the
1292 token strings.
1293
12942001-12-13 Paul Eggert <eggert@twinsun.com>
1295
1296 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1297 Do not infringe on the global user namespace when using C++.
1298 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1299 All uses of `fprintf' and `stderr' changed.
1300
1301 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1302
13032001-12-13 Akim Demaille <akim@epita.fr>
1304
1305 The computation of nullable is broken: it doesn't handle empty
1306 RHS's properly.
1307
1308 * tests/torture.at (GNU AWK Grammar): New.
1309 * tests/sets.at (Nullable): New.
1310 * src/nullable.c (set_nullable): Instead of blindly looping over
1311 `ritems', loop over the rules, and then over their rhs's.
1312
1313 Work around Autotest bugs.
1314
1315 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1316 frame, because Autotest understand lines starting with a `+' as
1317 traces from the shell. Then, they are not processed properly.
1318 Admittedly an Autotest bug, but we don't have time to wait for
1319 Autotest to catch up.
1320 * tests/regression.at (Broken Closure): Adjust to the new table
1321 frames.
1322 Move to...
1323 * tests/sets.at: here.
1324
13252001-12-13 Akim Demaille <akim@epita.fr>
1326
1327 * src/closure.c (closure): Use nrules instead of playing tricks
1328 with BITS_PER_WORD.
1329
13302001-12-13 Akim Demaille <akim@epita.fr>
1331
1332 * src/print.c (print_actions): Output the handling of `$' as the
1333 traces do: shifting the token EOF. Before EOF was treated as a
1334 nonterminal.
1335 * tests/regression.at: Adjust some tests.
1336 * src/print_graph.c (print_core): Complete the set of items via
1337 closure. The next-to-final and final states are still unsatisfying,
1338 but that's to be addressed elsewhere.
1339 No longer output the rule numbers, but do output the state number.
1340 A single loop for the shifts + gotos is enough, but picked a
1341 distinct color for each.
1342 (print_graph): Initialize and finalize closure.
1343
13442001-12-13 Akim Demaille <akim@epita.fr>
1345
1346 * src/reader.c (readgram): Remove dead code, an strip useless
1347 braces.
1348 (get_type): Remove, unused.
1349
13502001-12-12 Akim Demaille <akim@epita.fr>
1351
1352 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1353 on that of lib/error.c.
1354
13552001-12-12 Akim Demaille <akim@epita.fr>
1356
1357 Some hosts don't like `/' in includes.
1358
1359 * src/system.h: Include libgettext.h without qualifying the path.
1360 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1361 $(top_srcdir).
1362
13632001-12-11 Marc Autret <autret_m@epita.fr>
1364
1365 * src/output.c (output_parser): Remove useless muscle.
1366
13672001-12-11 Marc Autret <autret_m@epita.fr>
1368
1369 * src/bison.simple: Remove #line just before %%epilogue. It
1370 is now handled in ...
1371 * src/reader.c (read_additionnal_code): Add the output of a
1372 #line for the epilogue.
1373
13742001-12-10 Marc Autret <autret_m@epita.fr>
1375
1376 * src/reader.c (copy_definition): Re-use CPP-outed code which
1377 replace precedent remove.
1378 * src/bison.simple: Remove #line before %%prologue because
1379 %%input-line is wrong at this time.
1380
13812001-12-10 Marc Autret <autret_m@epita.fr>
1382
1383 * src/reader.c (symbols_output): Clean up.
1384 * src/output.c (output_gram, output): Clean up.
1385
13862001-12-10 Akim Demaille <akim@epita.fr>
1387
1388 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1389 * src/LR0.c (set_state_table): here.
1390 * src/lalr.c (lalr): Call it.
1391
13922001-12-10 Akim Demaille <akim@epita.fr>
1393
1394 * src/state.h (shifts): Remove the `number' member: shifts are
1395 attached to state, hence no longer need to be labelled with a
1396 state number.
1397
13982001-12-10 Akim Demaille <akim@epita.fr>
1399
1400 Now that states have a complete set of members, the linked list of
1401 shifts is useless: just fill directly the state's shifts member.
1402
1403 * src/state.h (shifts): Remove the `next' member.
1404 * src/LR0.c (first_state, last_state): Remove.
1405 Adjust the callers.
1406 (augment_automaton): Don't look for the shifts that must be added
1407 a shift on EOF: it is those of the state we looked for! But now,
1408 since shifts are attached, it is no longer needed to looking
1409 merely by its id: its number.
1410
14112001-12-10 Akim Demaille <akim@epita.fr>
1412
1413 * src/LR0.c (augment_automaton): Better variable locality.
1414 Remove an impossible branch: if there is a state corresponding to
1415 the start symbol being shifted, then there is shift for the start
1416 symbol from the initial state.
1417
14182001-12-10 Akim Demaille <akim@epita.fr>
1419
1420 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1421 only when appropriate: when insert_start_shifting_state' is not
1422 invoked.
1423 * tests/regression.at (Rule Line Numbers): Adjust.
1424
14252001-12-10 Akim Demaille <akim@epita.fr>
1426
1427 * src/LR0.c (augment_automaton): Now that all states have shifts,
1428 merge the two cases addition shifts to the initial state.
1429
14302001-12-10 Akim Demaille <akim@epita.fr>
1431
1432 * src/lalr.c (set_state_table): Move to...
1433 * src/LR0.c: here.
1434 * src/lalr.c (lalr): Don't call it...
1435 * src/LR0.c (generate_states): do it.
1436 * src/LR0.h (first_state): Remove, only the table is used.
1437
14382001-12-10 Akim Demaille <akim@epita.fr>
1439
1440 * src/LR0.h (first_shift, first_reduction): Remove.
1441 * src/lalr.c: Don't use first_shift: find shifts through the
1442 states.
1443
14442001-12-10 Akim Demaille <akim@epita.fr>
1445
1446 * src/LR0.c: Attach shifts to states as soon as they are
1447 computed.
1448 * src/lalr.c (set_state_table): Instead of assigning shifts to
1449 state, just assert that the mapping was properly done.
1450
14512001-12-10 Akim Demaille <akim@epita.fr>
1452
1453 * src/LR0.c (insert_start_shift): Rename as...
1454 (insert_start_shifting_state): this.
1455 (insert_eof_shifting_state, insert_accepting_state): New.
1456 (augment_automaton): Adjust.
1457 Better locality of the variables.
1458 When looking if the start_symbol is shifted from the initial
1459 state, using `while (... symbol != start_symbol ...)' sounds
1460 better than `while (... symbol < start_symbol ...)': If fail
1461 to see how the order between symbols could be relevant!
1462
14632001-12-10 Akim Demaille <akim@epita.fr>
1464
1465 * src/getargs.h: Don't declare `spec_name_prefix' and
1466 `spec_file_prefix', declared by src/files.h.
1467 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1468 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1469 * src/output.c (prepare): Adjust.
1470 * src/reader.c (symbols_output): Likewise.
1471 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1472
14732001-12-10 Akim Demaille <akim@epita.fr>
1474
1475 * src/muscle_tab.c (muscle_init): NULL is a better default than
1476 `"0"'.
1477
14782001-12-10 Akim Demaille <akim@epita.fr>
1479
1480 * src/reader.c (reader): Calling symbols_output once is enough.
1481
14822001-12-10 Akim Demaille <akim@epita.fr>
1483
1484 Now that states have a complete set of members, the linked list of
1485 reductions is useless: just fill directly the state's reductions
1486 member.
1487
1488 * src/state.h (struct reductions): Remove member `number' and
1489 `next'.
1490 * src/LR0.c (first_reduction, last_reduction): Remove.
1491 (save_reductions): Don't link the new reductions, store them in
1492 this_state.
1493 * src/lalr.c (set_state_table): No need to attach reductions to
1494 states, it's already done.
1495 * src/output.c (output_actions): No longer free the shifts, then
1496 the reductions, then the states: free all the states and their
1497 members.
1498
14992001-12-10 Akim Demaille <akim@epita.fr>
1500
1501 * src/options.c (OPTN, DRTV, BOTH): New.
1502 (option_table): Use them.
1503
1504 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1505 the job of system.h.
1506 * src/options.c: Don't include stdio.h and xalloc.h for the same
1507 reasons.
1508
15092001-12-10 Akim Demaille <akim@epita.fr>
1510
1511 * src/output.c (output, prepare): Make sure the values of the
1512 muscles `action' and `prologue' are 0-terminated.
1513
15142001-12-10 Akim Demaille <akim@epita.fr>
1515
1516 Clean up GCC warnings.
1517
1518 * src/reader.c (copy_action): `buf' is not used.
1519 (parse_skel_decl): Be static.
1520 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1521 * src/options.h (create_long_option_table): Have a real prototype.
1522 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1523 (hash_delete_at): Return const void *.
1524 Adjust casts to preserve the const.
1525
15262001-12-10 Akim Demaille <akim@epita.fr>
1527
1528 * configure.in: Require 2.52g.
1529 M4 is not needed, but AUTOM4TE is.
1530 * m4/m4.m4: Remove.
1531 * tests/Makefile.am: Adjust.
1532
15332001-12-10 Akim Demaille <akim@epita.fr>
1534
1535 One structure for states is enough, even though theoretically
1536 there are LR(0) states and LALR(1) states.
1537
1538 * src/lalr.h (state_t): Remove.
1539 (state_table): Be state_t **, not state_t *.
1540 * src/state.h (core, CORE_ALLOC): Rename as...
1541 (state_t, STATE_ALLOC): this.
1542 Add the LALR(1) members: shifts, reductions, errs.
1543 * src/LR0.c (state_table): Rename as...
1544 (state_hash): this, to avoid name clashes with the global
1545 `state_table'.
1546 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1547 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1548
15492001-12-10 Akim Demaille <akim@epita.fr>
1550
1551 Bison dumps core on bash.y.
1552 Reported by Pascal Bart.
1553
1554 * src/warshall.c (bitmatrix_print): New.
1555 (TC): Use it.
1556 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1557 j must be the outer loop.
1558 * tests/regression.at (Broken Closure): New.
1559
15602001-12-05 Akim Demaille <akim@epita.fr>
1561
1562 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1563 its argument.
1564