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