]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-03-04 Akim Demaille <akim@epita.fr>
2
3 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
4 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
5 Update.
6 From Michael Hayes.
7
82002-03-04 Akim Demaille <akim@epita.fr>
9
10 * src/closure.c (closure): `r' is unused.
11
122002-03-04 Akim Demaille <akim@epita.fr>
13
14 * tests/sets.at (Broken Closure): Add the ending `;'.
15 * src/reader.at (readgram): Complain if a rule is not ended with a
16 semi-colon.
17
182002-03-04 Akim Demaille <akim@epita.fr>
19
20 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
21 (count_sr_conflicts): Use bitset_count.
22 * src/reduce.c (inaccessable_symbols): Ditto.
23 (bits_size): Remove.
24 * src/warshall.h, src/warshall.c: Convert to bitsetv.
25
262002-03-04 Akim Demaille <akim@epita.fr>
27
28 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
29 * src/reduce.c: Remove the `bitset_zero's following the
30 `bitset_create's, as now it is performed by the latter.
31
322002-03-04 Akim Demaille <akim@epita.fr>
33
34 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
35 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
36 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
37 latest sources from Michael.
38
392002-03-04 Akim Demaille <akim@epita.fr>
40
41 * src/output.c (output): Don't free the grammar.
42 * src/reader.c (grammar_free): New.
43 * src/main.c (main): Call it and don't free symtab here.
44
452002-03-04 Akim Demaille <akim@epita.fr>
46
47 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
48 before returning.
49 Reported by Benoit Perrot.
50
512002-03-04 Akim Demaille <akim@epita.fr>
52
53 Use bitset operations when possible, not loops over bits.
54
55 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
56 bitset_or.
57 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
58 * src/reduce.c (useless_nonterminals): Formatting changes.
59 * src/warshall.c (TC): Use bitset_or.
60
612002-03-04 Akim Demaille <akim@epita.fr>
62
63 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
64 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
65 Ditto.
66
672002-03-04 Akim Demaille <akim@epita.fr>
68
69 * src/lalr.c (F): Now a bitset*.
70 Adjust all dependencies.
71
722002-03-04 Akim Demaille <akim@epita.fr>
73
74 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
75 Adjust all dependencies.
76
772002-03-04 Akim Demaille <akim@epita.fr>
78
79 * src/L0.c, src/LR0.h (nstates): Be size_t.
80 Adjust comparisons (signed vs unsigned).
81 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
82 bitset*.
83 Adjust all dependencies.
84
852002-03-04 Akim Demaille <akim@epita.fr>
86
87 * src/closure.c (firsts): Now, also a bitset.
88 Adjust all dependencies.
89 (varsetsize): Remove, now unused.
90 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
91
922002-03-04 Akim Demaille <akim@epita.fr>
93
94 * src/print.c: Convert to use bitset.h, not hand coded iterations
95 over ints.
96
972002-03-04 Akim Demaille <akim@epita.fr>
98
99 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
100
1012002-03-04 Akim Demaille <akim@epita.fr>
102
103 * src/closure.c (ruleset): Be a bitset.
104 (rulesetsize): Remove.
105
1062002-03-04 Akim Demaille <akim@epita.fr>
107
108 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
109 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
110 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
111 * src/closure.c (fderives): Be an array of bitsets.
112
1132002-02-28 Robert Anisko <robert@lrde.epita.fr>
114
115 * data/bison.c++: Merge the two generated headers. Insert a copyright
116 notice in each output file.
117
1182002-02-28 Akim Demaille <akim@epita.fr>
119
120 * data/bison.c++: Copy the prologue of bison.simple to fetch
121 useful M4 definitions, such as b4_header_guard.
122
1232002-02-25 Akim Demaille <akim@epita.fr>
124
125 * src/getargs.c (version): Give the name of the authors, and use a
126 translator friendly scheme for the bgr
127 copyright notice.
128
1292002-02-25 Akim Demaille <akim@epita.fr>
130
131 * src/output.c (header_output): Remove, now handled completely via
132 M4.
133
1342002-02-25 Akim Demaille <akim@epita.fr>
135
136 * m4/m4.m4: New, from CVS Autoconf.
137 * configure.in: Invoke it.
138 * src/output.c (output_skeleton): Use its result instead of the
139 hard coded name.
140
1412002-02-25 Akim Demaille <akim@epita.fr>
142
143 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
144 Fileutils 4.1.5.
145 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
146 * src/output.c (output_skeleton): Use mkstemp to create a real
147 temporary file.
148 Move the filling of `skeleton' and its muscle to...
149 (prepare): here.
150 (output): Move the definition of the prologue muscle to...
151 (prepare): here.
152 * src/system.h (DEFAULT_TMPDIR): New.
153
1542002-02-14 Paul Eggert <eggert@twinsun.com>
155
156 Remove the support for C++ namespace cleanliness; it was
157 causing more problems than it was curing, since it didn't work
158 properly on some nonstandard C++ compilers. This can wait
159 for a proper C++ parser.
160
161 * NEWS: Document this.
162 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
163 of C++, as it's treated like C now.
164 * src/bison.simple (YYSTD): Remove.
165 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
166 Treat C++ just like Standard C instead of trying to support
167 namespace cleanliness.
168
1692002-02-14 Akim Demaille <akim@epita.fr>
170
171 * tests/regression.at (else): Adjust to Andreas' change.
172
1732002-02-14 Akim Demaille <akim@epita.fr>
174
175 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
176
1772002-02-13 Andreas Schwab <schwab@suse.de>
178
179 * src/output.c (output_rule_data): Don't output NULL, it might
180 not be defined yet.
181
1822002-02-11 Robert Anisko <robert@lrde.epita.fr>
183
184 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
185 (Copyright notice): Update.
186
1872002-02-11 Akim Demaille <akim@epita.fr>
188
189 * tests/regression.at (%nonassoc and eof): Don't include
190 nonportable headers.
191
1922002-02-08 Robert Anisko <robert@lrde.epita.fr>
193
194 * data/bison.c++: Correct error recovery. Make the user able to
195 initialize the starting location.
196
1972002-02-07 Akim Demaille <akim@epita.fr>
198
199 * tests/input.at: New.
200
2012002-02-07 Robert Anisko <robert@lrde.epita.fr>
202
203 * data/bison.c++: Replace some direct m4 expansions by constants. Be
204 more consistent when naming methods and variables. Put preprocessor
205 directives around tables only needed for debugging.
206
2072002-02-07 Robert Anisko <robert@lrde.epita.fr>
208
209 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
210 C++ parsers.
211 (yy::b4_name::parse): Use print_.
212
2132002-02-07 Robert Anisko <robert@lrde.epita.fr>
214
215 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
216
2172002-02-07 Robert Anisko <robert@lrde.epita.fr>
218
219 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
220 C++ parsers.
221 (yy::b4_name::parse): Build verbose error messages, and use error_.
222
2232002-02-06 Robert Anisko <robert@lrde.epita.fr>
224
225 * data/bison.c++: Fix m4 quoting in comments.
226
2272002-02-06 Robert Anisko <robert@lrde.epita.fr>
228
229 * data/bison.c++: Adjust the parser code. Fix some muscles that were
230 not expanded by m4.
231
2322002-02-05 Akim Demaille <akim@epita.fr>
233
234 * data/bison.c++: Adjust to the M4 back end.
235 More is certainly needed.
236
2372002-02-05 Akim Demaille <akim@epita.fr>
238
239 Give a try to M4 as a back end.
240
241 * lib/readpipe.c: New, from wdiff.
242 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
243 BISON_HAIRY.
244 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
245 specific values. Now it is m4 that performs the lookup.
246 * src/parse-skel.y: Remove.
247 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
248 * src/output.c (actions_output, guards_output)
249 (token_definitions_output): No longer keeps track of the output
250 line number, hence remove the second argument.
251 (guards_output): Check against the guard member of a rule, not the
252 action member.
253 Adjust callers.
254 (output_skeleton): Don't look for the skeleton location, let m4 do
255 that.
256 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
257 file will be used.
258 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
259 (prepare): Given that for the time being changesyntax is not
260 usable in M4, rename the muscles using `-' to `_'.
261 Define `defines_flag', `output_parser_name' and `output_header_name'.
262 * src/output.h (actions_output, guards_output)
263 (token_definitions_output): Adjust prototypes.
264 * src/scan-skel.l: Instead of scanning the skeletons, it now
265 processes the output of m4: `__oline__' and `#output'.
266 * data/bison.simple: Adjust to be used by M4(sugar).
267 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
268 to date.
269 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
270 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
271 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
272 shamelessly stolen from CVS Autoconf.
273
2742002-02-05 Akim Demaille <akim@epita.fr>
275
276 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
277 * configure.in: Check for the declarations of free and malloc.
278 * src/muscle_tab.c: Adjust.
279
2802002-02-05 Akim Demaille <akim@epita.fr>
281
282 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
283 which have no values.
284
2852002-02-05 Akim Demaille <akim@epita.fr>
286
287 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
288 * data/: here.
289
2902002-01-29 Paul Eggert <eggert@twinsun.com>
291
292 * src/bison.simple (YYSIZE_T): Do not define merely because
293 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
294 On some platforms, <alloca.h> does not declare YYSTD (size_t).
295
2962002-01-27 Akim Demaille <akim@epita.fr>
297
298 Fix `%nonassoc and eof'.
299
300 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
301 which were not properly copied! Replace
302 memcpy (res->errs, src->errs, src->nerrs);
303 with
304 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
305 !!!
306 * tests/regression.at (%nonassoc and eof): Adjust to newest
307 Autotest: `.' is not in the PATH.
308
3092002-01-27 Akim Demaille <akim@epita.fr>
310
311 * tests/sets.at (AT_EXTRACT_SETS): New.
312 (Nullable): Use it.
313 (Firsts): New.
314
3152002-01-26 Akim Demaille <akim@epita.fr>
316
317 * tests/actions.at, tests/calc.at, tests/headers.at,
318 * tests/torture.at: Adjust to the newest Autotest which no longer
319 forces `.' in the PATH.
320
3212002-01-25 Akim Demaille <akim@epita.fr>
322
323 * tests/regression.at (%nonassoc and eof): New.
324 Suggested by Robert Anisko.
325
3262002-01-24 Akim Demaille <akim@epita.fr>
327
328 Bison dumps core when trying to complain about broken input files.
329 Reported by Cris van Pelt.
330
331 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
332 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
333 into...
334 (Invalid inputs): Strengthen: exercise parse_percent_token.
335
3362002-01-24 Robert Anisko <robert.anisko@epita.fr>
337
338 * src/Makefile.am: Add bison.c++.
339 * src/bison.c++: New skeleton.
340
3412002-01-21 Paolo Bonzini <bonzini@gnu.org>
342
343 * po/it.po: New.
344
3452002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
346
347 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
348
3492002-01-20 Marc Autret <marc@gnu.org>
350
351 * src/files.c (compute_output_file_names): Fix
352
3532002-01-20 Marc Autret <marc@gnu.org>
354
355 * tests/output.at: New test.
356 * src/files.c (compute_base_names): Don't map extensions when
357 the YACC flag is set, use defaults.
358 Reported by Evgeny Stambulchik.
359
3602002-01-20 Marc Autret <marc@gnu.org>
361
362 * src/system.h: Need to define __attribute__ away for non-GCC
363 compilers as well (i.e. the vendor C compiler).
364 Suggested by Albert Chin-A-Young.
365
3662002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
367
368 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
369 canonical definition.
370 * src/system.h: Use the canonical definition for PARAMS (avoids
371 a conflict with the macro from lib/hash.h).
372
3732002-01-11 Akim Demaille <akim@epita.fr>
374
375 * configure.in: Use AC_FUNC_STRNLEN.
376 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
377
3782002-01-09 Akim Demaille <akim@epita.fr>
379
380 * src/files.c, src/files.h (output_infix): New.
381 (tab_extension): Remove.
382 (compute_base_names): Compute the former, drop the latter.
383 * src/output.c (prepare): Insert the muscles `output-infix', and
384 `output-suffix'.
385 * src/parse-skel.y (string, string.1): New.
386 (section.header): Use it.
387 (section.yacc): Remove.
388 (prefix): Remove too.
389 * src/scan-skel.l: Adjust.
390 * src/bison.simple, src/bison.hairy: Adjust.
391
3922002-01-09 Akim Demaille <akim@epita.fr>
393
394 * configure.in (WERROR_CFLAGS): Compute it.
395 * src/Makefile.am (CFLAGS): Pass it.
396 * tests/atlocal.in (CFLAGS): Idem.
397 * src/files.c: Fix a few warnings.
398 (get_extension_index): Remove, unused.
399
4002002-01-08 Akim Demaille <akim@epita.fr>
401
402 * src/getargs.c (AS_FILE_NAME): New.
403 (getargs): Use it to convert DOSish file names.
404 * src/files.c (base_name): Rename as full_base_name to avoid
405 clashes with `base_name ()'.
406 (filename_split): New.
407 (compute_base_names): N-th rewrite, using filename_split.
408
4092002-01-08 Akim Demaille <akim@epita.fr>
410
411 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
412 New, stolen from the Fileutils 4.1.
413 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
414 * configure.in: Check for the presence of memrchr, and of its
415 prototype.
416
4172002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
418
419 * lib/hash.h (__P): Added definition for this macro.
420 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
421 BUILT_SOURCES, to ensure they are generated first.
422 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
423 %error-verbose to allow bootstrapping with bison 1.30x.
424
4252002-01-06 Akim Demaille <akim@epita.fr>
426
427 * src/reader.c (parse_braces): Don't fetch the next char, the
428 convention is to fetch on entry.
429 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
430 'switch' without a following semicolon.
431 * tests/regression.at (braces parsing): New.
432
4332002-01-06 Akim Demaille <akim@epita.fr>
434
435 Bison is dead wrong in its RR conflict reports.
436
437 * tests/torture.at (GNU Cim Grammar): New.
438 * src/conflicts.c (count_rr_conflicts): Fix.
439
4402002-01-06 Akim Demaille <akim@epita.fr>
441
442 Creating package.m4 from configure.ac causes too many problems.
443
444 * tests/Makefile.am (package.m4): Create it by hand,
445 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
446
4472002-01-06 Akim Demaille <akim@epita.fr>
448
449 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
450 skeleton.h.
451
4522002-01-04 Paul Eggert <eggert@twinsun.com>
453
454 * doc/bison.texinfo (Debugging):
455 Remove YYSTDERR; it's no longer defined or used.
456 Also, s/cstdio.h/cstdio/.
457
4582002-01-03 Akim Demaille <akim@epita.fr>
459
460 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
461
4622002-01-03 Akim Demaille <akim@epita.fr>
463
464 * src/parse-skel.y (process_skeleton): Don't bind the parser's
465 tracing code to --trace, wait for a better --trace option, with
466 args.
467
4682002-01-03 Akim Demaille <akim@epita.fr>
469
470 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
471 The ISO C++ standard is extremely clear about it: stderr is
472 considered a macro, not a regular symbol (see table 94 `Header
473 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
474 Therefore std:: does not apply to it. It still does with fprintf.
475 Also, s/cstdio.h/cstdio/.
476
4772002-01-03 Akim Demaille <akim@epita.fr>
478
479 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
480 for non system headers.
481
4822002-01-02 Akim Demaille <akim@epita.fr>
483
484 Equip the skeleton chain with location tracking, runtime trace,
485 pure parser and scanner.
486
487 * src/parse-skel.y: Request a pure parser, locations, and prefix
488 renaming.
489 (%union): Having several members with the same type does not help
490 type mismatches, simplify.
491 (YYPRINT, yyprint): New.
492 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
493 (skel_error): this.
494 Handle locations.
495 * src/scan-skel.l: Adjust to these changes.
496 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
497 (LOCATION_PRINT, skel_control_t): New.
498
4992001-12-30 Akim Demaille <akim@epita.fr>
500
501 * src/parse-skel.y: Get rid of the shift/reduce conflict:
502 replace `gb' with BLANKS.
503 * src/scan-skel.l: Adjust.
504
5052001-12-30 Akim Demaille <akim@epita.fr>
506
507 * src/system.h: We don't need nor want bcopy.
508 Throw away MS-DOS crap: we don't need getpid.
509 * configure.in: We don't need strndup. It was even causing
510 problems: because Flex includes the headers *before* us,
511 _GNU_SOURCE is not defined by config.h, and therefore strndup was
512 not visible.
513 * lib/xstrndup.c: New.
514 * src/scan-skel.l: Use it.
515 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
516 * src/parse-skel.y: Use %directives instead of #defines.
517
5182001-12-30 Akim Demaille <akim@epita.fr>
519
520 * src/skeleton.h: New.
521 * src/output.c (output_parser, output_master_parser): Remove, dead
522 code.
523 * src/output.h (get_lines_number, actions_output, guards_output)
524 (token_definitions_output): Prototype them.
525 * src/parse-skel.y: Add the license notice.
526 Include output.h and skeleton.h.
527 (process_skeleton): Returns void, and takes a single parameter.
528 * src/scan-skel.l: Add the license notice.
529 Include skeleton.h.
530 Don't use %option yylineno: it seems that then Flex imagines
531 REJECT has been used, and therefore it won't reallocate its
532 buffers (which makes no other sense to me than a bug). It results
533 in warnings for `unused: yy_flex_realloc'.
534
5352001-12-30 Robert Anisko <robert.anisko@epita.fr>
536
537 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
538 (MUSCLE_INSERT_PREFIX): ...to there.
539 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
540 (MUSCLE_INSERT_PREFIX): Move from here...
541
542 * src/bison.hairy: Add a section directive. Put braces around muscle
543 names. This parser skeleton is still broken, but Bison should not
544 choke on a bad muscle 'syntax'.
545 * src/bison.simple: Add a section directive. Put braces around muscle
546 names.
547
548 * src/files.h (strsuffix, stringappend): Add declarations.
549 (tab_extension): Add declaration.
550 (short_base_name): Add declaration.
551
552 * src/files.c (strsuffix, stringappend): No longer static. These
553 functions are used in the skeleton parser.
554 (tab_extension): New.
555 (compute_base_names): Use the computations done in this function
556 to guess if the generated parsers should have '.tab' in their
557 names.
558 (short_base_name): No longer static.
559
560 * src/output.c (output_skeleton): New.
561 (output): Disable call to output_master_parser, and give a try to
562 a new skeleton handling system.
563 (guards_output, actions_output): No longer static.
564 (token_definitions_output, get_lines_number): No longer static.
565
566 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
567
568 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
569 parse-skel.y.
570
571 * src/parse-skel.y: New file.
572 * src/scan-skel.l: New file.
573
5742001-12-29 Akim Demaille <akim@epita.fr>
575
576 %name-prefix is broken.
577
578 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
579 Adjust all dependencies.
580 * tests/headers.at (export YYLTYPE): Strengthen this test: use
581 %name-prefix.
582
583 Renaming yylval but not yylloc is not consistent. Now we do.
584
585 * src/bison.simple: Prefix yylloc if used.
586 * doc/bison.texinfo (Decl Summary): Document that.
587
5882001-12-29 Akim Demaille <akim@epita.fr>
589
590 * doc/bison.texinfo: Promote `%long-directive' over
591 `%long_directive'.
592 Remove all references to fixed-output-files, yacc is enough.
593
5942001-12-29 Akim Demaille <akim@epita.fr>
595
596 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
597 user prologue. These are defaults.
598 * tests/actions.at (Mid-rule actions): Make sure the user can
599 define YYDEBUG and YYERROR_VERBOSE.
600
6012001-12-29 Akim Demaille <akim@epita.fr>
602
603 * src/output.c (header_output): Don't forget to export YYLTYPE and
604 yylloc.
605 * tests/headers.at (export YYLTYPE): New, make sure it does.
606 * tests/regression.at (%union and --defines, Invalid CPP headers):
607 Move to...
608 * tests/headers.at: here.
609
6102001-12-29 Akim Demaille <akim@epita.fr>
611
612 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
613
6142001-12-29 Akim Demaille <akim@epita.fr>
615
616 * tests/actions.at (Mid-rule actions): Output on a single line
617 instead of several.
618
6192001-12-29 Akim Demaille <akim@epita.fr>
620
621 * doc/bison.texinfo: Formatting changes.
622
6232001-12-29 Akim Demaille <akim@epita.fr>
624
625 Don't store the token defs in a muscle, just be ready to output it
626 on command. Now possible via `symbols'. Fixes a memory leak.
627
628 * src/output.c (token_definitions_output): New.
629 (output_parser, header_output): Use it.
630 * src/reader.c (symbols_save): Remove.
631
6322001-12-29 Akim Demaille <akim@epita.fr>
633
634 * src/bison.simple: Do not provide a default for YYSTYPE and
635 YYLTYPE before the user's prologue. Otherwise it's hardly... a
636 default.
637
6382001-12-29 Akim Demaille <akim@epita.fr>
639
640 Mid-rule actions are simply... ignored!
641
642 * src/reader.c (readgram): Be sure to attach mid-rule actions to
643 the empty-rule associated to the dummy symbol, not to the host
644 rule.
645 * tests/actions.at (Mid-rule actions): New.
646
6472001-12-29 Akim Demaille <akim@epita.fr>
648
649 Memory leak.
650
651 * src/reader.c (reader): Free grammar.
652
6532001-12-29 Akim Demaille <akim@epita.fr>
654
655 Memory leak.
656
657 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
658 since it allocates it for each state, although only one is needed.
659 (allocate_storage): Do it here.
660
6612001-12-29 Akim Demaille <akim@epita.fr>
662
663 * src/options.h, src/options.c (create_long_option_table): Rename
664 as...
665 (long_option_table_new): this, with a clearer prototype.
666 (percent_table): Remove, unused,
667 * src/getargs.c (getargs): Adjust.
668
6692001-12-29 Akim Demaille <akim@epita.fr>
670
671 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
672 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
673 as states.
674
6752001-12-29 Akim Demaille <akim@epita.fr>
676
677 * src/lalr.c (build_relations): Rename `states' as `states1'.
678 Sorry, I don't understand exactly what it is, no better name...
679
6802001-12-29 Akim Demaille <akim@epita.fr>
681
682 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
683 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
684 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
685 as rules.
686
6872001-12-29 Akim Demaille <akim@epita.fr>
688
689 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
690 ago.
691
6922001-12-29 Akim Demaille <akim@epita.fr>
693
694 * src/reader.c, src/reader.h (user_toknums): Remove.
695 Adjust all users to use symbols[i]->user_token_number.
696
6972001-12-29 Akim Demaille <akim@epita.fr>
698
699 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
700 Adjust all users to use symbols[i]->prec or ->assoc.
701
7022001-12-29 Akim Demaille <akim@epita.fr>
703
704 * src/reader.c, src/reader.h (tags): Remove.
705 Adjust all users to use symbols[i]->tag.
706
7072001-12-29 Akim Demaille <akim@epita.fr>
708
709 * src/gram.h, src/gram.c (symbols): New, similar to state_table
710 and rule_table.
711 * src/reader.c (packsymbols): Fill this table.
712 Drop sprec.
713 * src/conflicts.c (resolve_sr_conflict): Adjust.
714 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
715 single table.
716 Use symbols[i]->tag instead of tags[i].
717
7182001-12-29 Akim Demaille <akim@epita.fr>
719
720 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
721 In addition, put a comment in there, to replace...
722 * tests/regression.at (%union and C comments): Remove.
723
7242001-12-29 Akim Demaille <akim@epita.fr>
725
726 * tests/regression.at (Web2c Actions): Blindly move the actual
727 output as expected output. The contents *seem* right to me, but I
728 can't pretend reading perfectly parser tables... Nonetheless, all
729 the other tests pass correctly, the table look OK, even though the
730 presence of `$axiom' is to be noted: AFAICS it is useless (but
731 harmless).
732
7332001-12-29 Akim Demaille <akim@epita.fr>
734
735 * src/reader.c (readgram): Don't add the rule 0 if there were no
736 rules read. In other words, add it _after_ having performed
737 grammar sanity checks.
738 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
739
7402001-12-29 Akim Demaille <akim@epita.fr>
741
742 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
743 visible, and some states have now a different number.
744
7452001-12-29 Akim Demaille <akim@epita.fr>
746
747 * src/reader.c (readgram): Bind the initial rule's lineno to that
748 of the first rule.
749 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
750 (Solved SR Conflicts): Adjust rule 0's line number.
751
7522001-12-29 Akim Demaille <akim@epita.fr>
753
754 Fix the `GAWK Grammar' failure.
755
756 * src/LR0.c (final_state): Initialize to -1 so that we do compute
757 the reductions of the first state which was mistakenly confused
758 with the final state because precisely final_state was initialized
759 to 0.
760 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
761 now noticed by Bison.
762 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
763 have a reduction on $default.
764
7652001-12-29 Akim Demaille <akim@epita.fr>
766
767 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
768 rule line numbers.
769 * src/closure.c (print_closure): Likewise.
770 * src/derives.c (print_derives): Likewise.
771 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
772 now.
773
7742001-12-29 Akim Demaille <akim@epita.fr>
775
776 * src/lalr.c (lookaheads_print): New.
777 (lalr): Call it when --trace-flag.
778 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
779 are dumped.
780
7812001-12-29 Akim Demaille <akim@epita.fr>
782
783 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
784 when walking through ritem, even via rule->rhs.
785 * src/reduce.c (dump_grammar, useful_production, reduce_output)
786 (useful_production, useless_nonterminals): Likewise.
787 (reduce_grammar_tables): Likewise, plus update nritems.
788 * src/nullable.c (set_nullable): Likewise.
789 * src/lalr.c (build_relations): Likewise.
790 * tests/sets.at (Nullable): Adjust.
791 Fortunately, now, the $axiom is no longer nullable.
792
7932001-12-29 Akim Demaille <akim@epita.fr>
794
795 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
796 the 0-sentinel.
797 * src/gram.c (ritem_longest_rhs): Likewise.
798 * src/reduce.c (nonterminals_reduce): Likewise.
799 * src/print_graph.c (print_graph): Likewise.
800 * src/output.c (output_rule_data): Likewise.
801 * src/nullable.c (set_nullable): Likewise.
802
8032001-12-29 Akim Demaille <akim@epita.fr>
804
805 * src/output.c: Comment changes.
806
8072001-12-27 Paul Eggert <eggert@twinsun.com>
808
809 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
810 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
811 Sparc, as they were causing more porting problems than the
812 (minor) performance improvement was worth.
813
814 Also, catch up with 1.31's YYSTD.
815
8162001-12-27 Akim Demaille <akim@epita.fr>
817
818 * src/output.c (output_gram): Rely on nritems, not the
819 0-sentinel. See below.
820 Use -1 as separator, not 0.
821 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
822 Rely on -1 as separator in yyrhs, instead of 0.
823 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
824 twice `Now at end of input', therefore there are two lines less to
825 expect.
826
8272001-12-27 Akim Demaille <akim@epita.fr>
828
829 * tests/regression.at (Unresolved SR Conflicts):
830 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
831 below.
832
8332001-12-27 Akim Demaille <akim@epita.fr>
834
835 * src/LR0.c (new_state): Recognize the final state by the fact it
836 is reached by eoftoken.
837 (insert_start_shifting_state, insert_eof_shifting_state)
838 (insert_accepting_state, augment_automaton): Remove, since now
839 these states are automatically computed from the initial state.
840 (generate_states): Adjust.
841 * src/print.c: When reporting a rule number to the user, substract
842 1, so that the axiom rule is rule 0, and the first user rule is 1.
843 * src/reduce.c: Likewise.
844 * src/print_graph.c (print_core): For the time being, just as for
845 the report, depend upon --trace-flags to dump the full set of
846 items.
847 * src/reader.c (readgram): Once the grammar read, insert the rule
848 0: `$axiom: START-SYMBOL $'.
849 * tests/set.at: Adjust: rule 0 is now displayed, and since the
850 number of the states has changed (the final state is no longer
851 necessarily the last), catch up.
852
8532001-12-27 Akim Demaille <akim@epita.fr>
854
855 Try to make the use of the eoftoken valid. Given that its value
856 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
857 is used instead of > 0 where appropriate, (ii), depend upon nritems
858 instead of the 0-sentinel.
859
860 * src/gram.h, src/gram.c (nritems): New.
861 Expected to be duplication of nitems, but for the time being...
862 * src/reader.c (packgram): Assert nritems and nitems are equal.
863 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
864 * src/closure.c (print_closure, print_fderives): Likewise.
865 * src/gram.c (ritem_print): Likewise.
866 * src/print.c (print_core, print_grammar): Likewise.
867 * src/print_graph.c: Likewise.
868
8692001-12-27 Akim Demaille <akim@epita.fr>
870
871 * src/main.c (main): If there are complains after grammar
872 reductions, then output the report anyway if requested, then die.
873 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
874 * src/reader.c (eoftoken): New.
875 (parse_token_decl): If the token being defined has value `0', it
876 is the eoftoken.
877 (packsymbols): No longer hack `tags' to insert `$' by hand.
878 Be sure to preserve the value of the eoftoken.
879 (reader): Make sure eoftoken is defined.
880 Initialize nsyms to 0: now eoftoken is created just like the others.
881 * src/print.c (print_grammar): Don't special case the eof token.
882 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
883 lie anyway, albeit pleasant.
884 * tests/calc.at: Exercise error messages with eoftoken.
885 Change the grammar so that empty input is invalid.
886 Adjust expectations.
887 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
888
8892001-12-27 Akim Demaille <akim@epita.fr>
890
891 * configure.in: Check the protos of strchr ans strspn.
892 Replace strchr if needed.
893 * src/system.h: Provide the protos of strchr, strspn and memchr if
894 missing.
895 * lib/strchr.c: New.
896 * src/reader.c (symbols_save): Use strchr.
897
8982001-12-27 Akim Demaille <akim@epita.fr>
899
900 * src/print.c, src/print_graph.c (escape): New.
901 Use it to quote the TAGS outputs.
902 * src/print_graph.c (print_state): Now errors are in red, and
903 reductions in green.
904 Prefer high to wide: output the state number on a line of its own.
905
9062001-12-27 Akim Demaille <akim@epita.fr>
907
908 * src/state.h, src/state.c (reductions_new): New.
909 * src/LR0.c (set_state_table): Let all the states have a
910 `reductions', even if reduced to 0.
911 (save_reductions): Adjust.
912 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
913 * src/print.c (print_reductions, print_actions): Adjust.
914 * src/output.c (action_row): Adjust.
915
9162001-12-27 Akim Demaille <akim@epita.fr>
917
918 * src/state.h, src/state.c (errs_new, errs_dup): New.
919 * src/LR0.c (set_state_table): Let all the states have an errs,
920 even if reduced to 0.
921 * src/print.c (print_errs, print_reductions): Adjust.
922 * src/output.c (output_actions, action_row): Adjust.
923 * src/conflicts.c (resolve_sr_conflict): Adjust.
924
9252001-12-27 Akim Demaille <akim@epita.fr>
926
927 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
928
9292001-12-27 Akim Demaille <akim@epita.fr>
930
931 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
932 * src/print.c: here.
933 (lookaheadset, shiftset): New, used as additional storage by
934 print_reductions.
935 (print_results): Adjust.
936 (print_shifts, print_gotos, print_errs): New, extracted from...
937 (print_actions): here.
938 * src/print_graph.c (print_actions): Remove dead code.
939
9402001-12-27 Akim Demaille <akim@epita.fr>
941
942 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
943 `$n' and `@n'.
944
9452001-12-27 Akim Demaille <akim@epita.fr>
946
947 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
948 (build_relations): Adjust.
949
9502001-12-27 Akim Demaille <akim@epita.fr>
951
952 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
953 duplication.
954
9552001-12-27 Akim Demaille <akim@epita.fr>
956
957 * src/reader.c (packgram): Catch nitems overflows.
958
9592001-12-27 Akim Demaille <akim@epita.fr>
960
961 * src/files.c, src/files.h (guard_obstack): Remove.
962 * src/output.c (output): Adjust.
963 * src/reader.c (parse_braces): New, factoring...
964 (copy_action, copy_guard): these two which are renamed as...
965 (parse_action, parse_guard): these.
966 As a voluntary consequence, using braces around guards is now
967 mandatory.
968
9692001-12-27 Akim Demaille <akim@epita.fr>
970
971 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
972 * src/reader.c (symbol_list): `guard' and `guard_line' are new
973 members.
974 (symbol_list_new): Adjust.
975 (copy_action): action_line is the first line, not the last.
976 (copy_guard): Just as for actions, store the `action' only, not
977 the switch/case/break flesh.
978 Don't parse the user action that might follow the guard, let...
979 (readgram): do it, i.e., now, there can be an action after a
980 guard.
981 In other words the guard is just explicitly optional.
982 (packgram): Adjust.
983 * src/output.c (guards_output): New.
984 (output_parser): Call it when needed.
985 (output): Also free the guard and attrs obstacks.
986 * src/files.c, src/files.h (obstack_save): Remove.
987 (output_files): Remove.
988 As a result, if one needs the former `.act' file, using an
989 appropriate skeleton which requires actions and guards is now
990 required.
991 * src/main.c (main): Adjust.
992 * tests/semantic.at: New.
993 * tests/regression.at: Use `input.y' as input file name.
994 Avoid 8+3 problems by requiring input.c when the test needs the
995 parser.
996
9972001-12-27 Akim Demaille <akim@epita.fr>
998
999 * src/reader.c (symbol_list_new): Be sure to initialize all the
1000 fields.
1001
10022001-12-27 Akim Demaille <akim@epita.fr>
1003
1004 All the hacks using a final pseudo state are now useless.
1005
1006 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1007 * src/lalr.c (nLA): New.
1008 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1009 instead of lookaheadsp from the pseudo state (nstate + 1).
1010
10112001-12-27 Akim Demaille <akim@epita.fr>
1012
1013 * src/output.c (action_row, token_actions): Use a state_t instead
1014 of a integer, and nlookaheads instead of the following state's
1015 lookaheadsp.
1016
10172001-12-27 Akim Demaille <akim@epita.fr>
1018
1019 * src/conflicts.c (log_resolution, flush_shift)
1020 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1021 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1022 (conflicts_print, print_reductions): Use a state_t instead of an
1023 integer when referring to a state.
1024 As much as possible, depend upon nlookaheads, instead of the
1025 `lookaheadsp' member of the following state (since lookaheads of
1026 successive states are successive, the difference between state n + 1
1027 and n served as the number of lookaheads for state n).
1028 * src/lalr.c (add_lookback_edge): Likewise.
1029 * src/print.c (print_core, print_actions, print_state)
1030 (print_results): Likewise.
1031 * src/print_graph.c (print_core, print_actions, print_state)
1032 (print_graph): Likewise.
1033 * src/conflicts.h: Adjust.
1034
10352001-12-27 Akim Demaille <akim@epita.fr>
1036
1037 * src/bison.hairy: Formatting/comment changes.
1038 ANSIfy.
1039 Remove `register' indications.
1040 Add plenty of `static'.
1041
10422001-12-27 Akim Demaille <akim@epita.fr>
1043
1044 * src/output.c (prepare): Drop the muscle `ntbase' which
1045 duplicates ntokens.
1046 * src/bison.simple: Formatting/comment changes.
1047 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1048 is an undocumented synonym.
1049
10502001-12-22 Akim Demaille <akim@epita.fr>
1051
1052 * src/output.c (output_table_data): Change the prototype to use
1053 `int' for array ranges: some invocations do pass an int, not a
1054 short.
1055 Reported by Wayne Green.
1056
10572001-12-22 Akim Demaille <akim@epita.fr>
1058
1059 Some actions of web2c.y are improperly triggered.
1060 Reported by Mike Castle.
1061
1062 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1063 * tests/regression.at (Web2c): Rename as...
1064 (Web2c Report): this.
1065 (Web2c Actions): New.
1066
10672001-12-22 Akim Demaille <akim@epita.fr>
1068
1069 Reductions in web2c.y are improperly reported.
1070 Reported by Mike Castle.
1071
1072 * src/conflicts.c (print_reductions): Fix.
1073 * tests/regression.at (Web2c): New.
1074
10752001-12-18 Akim Demaille <akim@epita.fr>
1076
1077 Some host fail on `assert (!"foo")', which expands to
1078 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1079 Reported by Nelson Beebee.
1080
1081 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1082 `#define it_succeeded 0' and `assert (it_succeeded)'.
1083
10842001-12-17 Marc Autret <autret_m@epita.fr>
1085
1086 * src/bison.simple: Don't hard code the skeleton line and filename.
1087 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1088 New line counter 'skeleton_line' (skeleton-line muscle).
1089
10902001-12-17 Paul Eggert <eggert@twinsun.com>
1091
1092 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1093 YYDEBUG must be defined to a nonzero value.
1094
1095 * src/bison.simple (yytname): Do not assume that the user defines
1096 YYDEBUG to a properly parenthesized expression.
1097
10982001-12-17 Akim Demaille <akim@epita.fr>
1099
1100 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1101 nlookaheads is a new member.
1102 Adjust all users.
1103 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1104 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1105 state.
1106
11072001-12-17 Akim Demaille <akim@epita.fr>
1108
1109 * src/files.h, src/files.c (open_files, close_files): Remove.
1110 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1111 let...
1112 * src/reader.c (reader): Do it.
1113
11142001-12-17 Akim Demaille <akim@epita.fr>
1115
1116 * src/conflicts.c (print_reductions): Formatting changes.
1117
11182001-12-17 Akim Demaille <akim@epita.fr>
1119
1120 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1121 (flush_reduce): New.
1122 (resolve_sr_conflict): Adjust.
1123
11242001-12-17 Akim Demaille <akim@epita.fr>
1125
1126 * src/output.c (output_obstack): Be static and rename as...
1127 (format_obstack): this, to avoid any confusion with files.c's
1128 output_obstack.
1129 * src/reader.h (muscle_obstack): Move to...
1130 * src/output.h: here, since it's defined in output.c.
1131
11322001-12-17 Akim Demaille <akim@epita.fr>
1133
1134 * src/output.c (action_row, save_column, default_goto)
1135 (sort_actions, matching_state, pack_vector): Better variable
1136 locality.
1137
11382001-12-17 Akim Demaille <akim@epita.fr>
1139
1140 * src/output.c: Various formatting changes.
1141
11422001-12-17 Akim Demaille <akim@epita.fr>
1143
1144 * src/files.c (output_files): Free the output_obstack.
1145 * src/main.c (main): Call print and print_graph conditionally.
1146 * src/print.c (print): Work unconditionally.
1147 * src/print_graph.c (print_graph): Work unconditionally.
1148 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1149
11502001-12-16 Marc Autret <autret_m@epita.fr>
1151
1152 * src/output.c (actions_output): Fix. When we use %no-lines,
1153 there is one less line per action.
1154
11552001-12-16 Marc Autret <autret_m@epita.fr>
1156
1157 * src/bison.simple: Remove a useless #line directive.
1158 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1159 * src/output.c (get_lines_number): New.
1160 (output_parser): Adjust, now takes care about the lines of a
1161 output muscles.
1162 Fix line numbering.
1163 (actions_output): Computes the number of lines taken by actions.
1164 (output_master_parser): Insert new skeleton which is the name of
1165 the output parser file name.
1166
11672001-12-15 Marc Autret <autret_m@epita.fr>
1168
1169 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1170
11712001-12-15 Marc Autret <autret_m@epita.fr>
1172
1173 * src/output.c (output_gram): Keep track of the hairy one.
1174
11752001-12-15 Akim Demaille <akim@epita.fr>
1176
1177 Make `make distcheck' work.
1178
1179 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1180 system.h which uses libgettext.h.
1181
11822001-12-15 Akim Demaille <akim@epita.fr>
1183
1184 * src/nullable.c (set_nullable): Useless rules must be skipped,
1185 otherwise, since we range over their symbols, we might look at a
1186 nonterminal which no longer ``exists'', i.e., it is not counted in
1187 `nvars', hence we overflow our arrays.
1188
11892001-12-15 Akim Demaille <akim@epita.fr>
1190
1191 The header can also be produced directly, without any obstack!
1192 Yahoo!
1193
1194 * src/files.c, src/files.h (defines_obstack): Remove.
1195 (compute_header_macro): Global.
1196 (defines_obstack_save): Remove.
1197 * src/reader.c (parse_union_decl): No longer output to
1198 defines_obstack: its content can be found in the `stype' muscle
1199 anyway.
1200 (output_token_translations): Merge into...
1201 (symbols_output): this.
1202 Rename as...
1203 (symbols_save): this.
1204 (reader): Adjust.
1205 * src/output.c (header_output): New.
1206 (output): Call it.
1207
12082001-12-15 Akim Demaille <akim@epita.fr>
1209
1210 * src/reader.c (parse_union_decl): Instead of handling two obstack
1211 simultaneously, use one to define the `stype' muscle, and use the
1212 value of the latter to fill defines_obstack.
1213 (copy_comment): Remove.
1214 (copy_comment2): Work for a single obstack.
1215 Rename as...
1216 (copy_comment): this.
1217
12182001-12-15 Akim Demaille <akim@epita.fr>
1219
1220 * src/lex.c, src/lex.h (xgetc): No longer static.
1221 * src/reader.c (parse_union_decl): Revamp.
1222
12232001-12-15 Akim Demaille <akim@epita.fr>
1224
1225 Still making progress in separating Bison into (i) input, (ii)
1226 process, (iii) output: now we can directly output the parser file
1227 without using table_obstack at all.
1228
1229 * src/files.c, src/files.h (table_obstack): Bye bye.
1230 (parser_file_name): New.
1231 * src/files.c (compute_output_file_names): Compute it.
1232 * src/output.c (actions_output, output_parser)
1233 (output_master_parser): To a file instead of an obstack.
1234
12352001-12-15 Akim Demaille <akim@epita.fr>
1236
1237 Attach actions to rules, instead of pre-outputting them to
1238 actions_obstack.
1239
1240 * src/gram.h (rule_t): action and action_line are new members.
1241 * src/reader.c (symbol_list): Likewise.
1242 (copy_action): Save the actions within the rule.
1243 (packgram): Save them in rule_table.
1244 * src/output.c (actions_output): New.
1245 (output_parser): Use it on `%%actions'.
1246 (output_rule_data): Don't free rule_table.
1247 (output): Do it.
1248 (prepare): Don't save the `action' muscle.
1249 * src/bison.simple: s/%%action/%%actions/.
1250
12512001-12-15 Akim Demaille <akim@epita.fr>
1252
1253 * src/reader.c (copy_action): When --yacc, don't append a `;'
1254 to the user action: let it fail if lacking.
1255 Suggested by Arnold Robbins and Tom Tromey.
1256
12572001-12-14 Akim Demaille <akim@epita.fr>
1258
1259 * src/lex.c (literalchar): Simply return the char you decoded, non
1260 longer mess around with obstacks and int pointers.
1261 Adjust all callers.
1262
12632001-12-14 Akim Demaille <akim@epita.fr>
1264
1265 * src/lex.c (literalchar): Don't escape the special characters,
1266 just decode them, and keep them as char (before, eol was output as
1267 the 2 char string `\n' etc.).
1268 * src/output.c (output_rule_data): Use quotearg to output the
1269 token strings.
1270
12712001-12-13 Paul Eggert <eggert@twinsun.com>
1272
1273 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1274 Do not infringe on the global user namespace when using C++.
1275 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1276 All uses of `fprintf' and `stderr' changed.
1277
1278 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1279
12802001-12-13 Akim Demaille <akim@epita.fr>
1281
1282 The computation of nullable is broken: it doesn't handle empty
1283 RHS's properly.
1284
1285 * tests/torture.at (GNU AWK Grammar): New.
1286 * tests/sets.at (Nullable): New.
1287 * src/nullable.c (set_nullable): Instead of blindly looping over
1288 `ritems', loop over the rules, and then over their rhs's.
1289
1290 Work around Autotest bugs.
1291
1292 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1293 frame, because Autotest understand lines starting with a `+' as
1294 traces from the shell. Then, they are not processed properly.
1295 Admittedly an Autotest bug, but we don't have time to wait for
1296 Autotest to catch up.
1297 * tests/regression.at (Broken Closure): Adjust to the new table
1298 frames.
1299 Move to...
1300 * tests/sets.at: here.
1301
13022001-12-13 Akim Demaille <akim@epita.fr>
1303
1304 * src/closure.c (closure): Use nrules instead of playing tricks
1305 with BITS_PER_WORD.
1306
13072001-12-13 Akim Demaille <akim@epita.fr>
1308
1309 * src/print.c (print_actions): Output the handling of `$' as the
1310 traces do: shifting the token EOF. Before EOF was treated as a
1311 nonterminal.
1312 * tests/regression.at: Adjust some tests.
1313 * src/print_graph.c (print_core): Complete the set of items via
1314 closure. The next-to-final and final states are still unsatisfying,
1315 but that's to be addressed elsewhere.
1316 No longer output the rule numbers, but do output the state number.
1317 A single loop for the shifts + gotos is enough, but picked a
1318 distinct color for each.
1319 (print_graph): Initialize and finalize closure.
1320
13212001-12-13 Akim Demaille <akim@epita.fr>
1322
1323 * src/reader.c (readgram): Remove dead code, an strip useless
1324 braces.
1325 (get_type): Remove, unused.
1326
13272001-12-12 Akim Demaille <akim@epita.fr>
1328
1329 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1330 on that of lib/error.c.
1331
13322001-12-12 Akim Demaille <akim@epita.fr>
1333
1334 Some hosts don't like `/' in includes.
1335
1336 * src/system.h: Include libgettext.h without qualifying the path.
1337 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1338 $(top_srcdir).
1339
13402001-12-11 Marc Autret <autret_m@epita.fr>
1341
1342 * src/output.c (output_parser): Remove useless muscle.
1343
13442001-12-11 Marc Autret <autret_m@epita.fr>
1345
1346 * src/bison.simple: Remove #line just before %%epilogue. It
1347 is now handled in ...
1348 * src/reader.c (read_additionnal_code): Add the output of a
1349 #line for the epilogue.
1350
13512001-12-10 Marc Autret <autret_m@epita.fr>
1352
1353 * src/reader.c (copy_definition): Re-use CPP-outed code which
1354 replace precedent remove.
1355 * src/bison.simple: Remove #line before %%prologue because
1356 %%input-line is wrong at this time.
1357
13582001-12-10 Marc Autret <autret_m@epita.fr>
1359
1360 * src/reader.c (symbols_output): Clean up.
1361 * src/output.c (output_gram, output): Clean up.
1362
13632001-12-10 Akim Demaille <akim@epita.fr>
1364
1365 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1366 * src/LR0.c (set_state_table): here.
1367 * src/lalr.c (lalr): Call it.
1368
13692001-12-10 Akim Demaille <akim@epita.fr>
1370
1371 * src/state.h (shifts): Remove the `number' member: shifts are
1372 attached to state, hence no longer need to be labelled with a
1373 state number.
1374
13752001-12-10 Akim Demaille <akim@epita.fr>
1376
1377 Now that states have a complete set of members, the linked list of
1378 shifts is useless: just fill directly the state's shifts member.
1379
1380 * src/state.h (shifts): Remove the `next' member.
1381 * src/LR0.c (first_state, last_state): Remove.
1382 Adjust the callers.
1383 (augment_automaton): Don't look for the shifts that must be added
1384 a shift on EOF: it is those of the state we looked for! But now,
1385 since shifts are attached, it is no longer needed to looking
1386 merely by its id: its number.
1387
13882001-12-10 Akim Demaille <akim@epita.fr>
1389
1390 * src/LR0.c (augment_automaton): Better variable locality.
1391 Remove an impossible branch: if there is a state corresponding to
1392 the start symbol being shifted, then there is shift for the start
1393 symbol from the initial state.
1394
13952001-12-10 Akim Demaille <akim@epita.fr>
1396
1397 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1398 only when appropriate: when insert_start_shifting_state' is not
1399 invoked.
1400 * tests/regression.at (Rule Line Numbers): Adjust.
1401
14022001-12-10 Akim Demaille <akim@epita.fr>
1403
1404 * src/LR0.c (augment_automaton): Now that all states have shifts,
1405 merge the two cases addition shifts to the initial state.
1406
14072001-12-10 Akim Demaille <akim@epita.fr>
1408
1409 * src/lalr.c (set_state_table): Move to...
1410 * src/LR0.c: here.
1411 * src/lalr.c (lalr): Don't call it...
1412 * src/LR0.c (generate_states): do it.
1413 * src/LR0.h (first_state): Remove, only the table is used.
1414
14152001-12-10 Akim Demaille <akim@epita.fr>
1416
1417 * src/LR0.h (first_shift, first_reduction): Remove.
1418 * src/lalr.c: Don't use first_shift: find shifts through the
1419 states.
1420
14212001-12-10 Akim Demaille <akim@epita.fr>
1422
1423 * src/LR0.c: Attach shifts to states as soon as they are
1424 computed.
1425 * src/lalr.c (set_state_table): Instead of assigning shifts to
1426 state, just assert that the mapping was properly done.
1427
14282001-12-10 Akim Demaille <akim@epita.fr>
1429
1430 * src/LR0.c (insert_start_shift): Rename as...
1431 (insert_start_shifting_state): this.
1432 (insert_eof_shifting_state, insert_accepting_state): New.
1433 (augment_automaton): Adjust.
1434 Better locality of the variables.
1435 When looking if the start_symbol is shifted from the initial
1436 state, using `while (... symbol != start_symbol ...)' sounds
1437 better than `while (... symbol < start_symbol ...)': If fail
1438 to see how the order between symbols could be relevant!
1439
14402001-12-10 Akim Demaille <akim@epita.fr>
1441
1442 * src/getargs.h: Don't declare `spec_name_prefix' and
1443 `spec_file_prefix', declared by src/files.h.
1444 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1445 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1446 * src/output.c (prepare): Adjust.
1447 * src/reader.c (symbols_output): Likewise.
1448 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1449
14502001-12-10 Akim Demaille <akim@epita.fr>
1451
1452 * src/muscle_tab.c (muscle_init): NULL is a better default than
1453 `"0"'.
1454
14552001-12-10 Akim Demaille <akim@epita.fr>
1456
1457 * src/reader.c (reader): Calling symbols_output once is enough.
1458
14592001-12-10 Akim Demaille <akim@epita.fr>
1460
1461 Now that states have a complete set of members, the linked list of
1462 reductions is useless: just fill directly the state's reductions
1463 member.
1464
1465 * src/state.h (struct reductions): Remove member `number' and
1466 `next'.
1467 * src/LR0.c (first_reduction, last_reduction): Remove.
1468 (save_reductions): Don't link the new reductions, store them in
1469 this_state.
1470 * src/lalr.c (set_state_table): No need to attach reductions to
1471 states, it's already done.
1472 * src/output.c (output_actions): No longer free the shifts, then
1473 the reductions, then the states: free all the states and their
1474 members.
1475
14762001-12-10 Akim Demaille <akim@epita.fr>
1477
1478 * src/options.c (OPTN, DRTV, BOTH): New.
1479 (option_table): Use them.
1480
1481 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1482 the job of system.h.
1483 * src/options.c: Don't include stdio.h and xalloc.h for the same
1484 reasons.
1485
14862001-12-10 Akim Demaille <akim@epita.fr>
1487
1488 * src/output.c (output, prepare): Make sure the values of the
1489 muscles `action' and `prologue' are 0-terminated.
1490
14912001-12-10 Akim Demaille <akim@epita.fr>
1492
1493 Clean up GCC warnings.
1494
1495 * src/reader.c (copy_action): `buf' is not used.
1496 (parse_skel_decl): Be static.
1497 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1498 * src/options.h (create_long_option_table): Have a real prototype.
1499 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1500 (hash_delete_at): Return const void *.
1501 Adjust casts to preserve the const.
1502
15032001-12-10 Akim Demaille <akim@epita.fr>
1504
1505 * configure.in: Require 2.52g.
1506 M4 is not needed, but AUTOM4TE is.
1507 * m4/m4.m4: Remove.
1508 * tests/Makefile.am: Adjust.
1509
15102001-12-10 Akim Demaille <akim@epita.fr>
1511
1512 One structure for states is enough, even though theoretically
1513 there are LR(0) states and LALR(1) states.
1514
1515 * src/lalr.h (state_t): Remove.
1516 (state_table): Be state_t **, not state_t *.
1517 * src/state.h (core, CORE_ALLOC): Rename as...
1518 (state_t, STATE_ALLOC): this.
1519 Add the LALR(1) members: shifts, reductions, errs.
1520 * src/LR0.c (state_table): Rename as...
1521 (state_hash): this, to avoid name clashes with the global
1522 `state_table'.
1523 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1524 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1525
15262001-12-10 Akim Demaille <akim@epita.fr>
1527
1528 Bison dumps core on bash.y.
1529 Reported by Pascal Bart.
1530
1531 * src/warshall.c (bitmatrix_print): New.
1532 (TC): Use it.
1533 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1534 j must be the outer loop.
1535 * tests/regression.at (Broken Closure): New.
1536
15372001-12-05 Akim Demaille <akim@epita.fr>
1538
1539 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1540 its argument.
1541