]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/lalr.c (F): Now a bitset*.
[bison.git] / ChangeLog
CommitLineData
0fb1ffb1
AD
12002-03-04 Akim Demaille <akim@epita.fr>
2
3 * src/lalr.c (F): Now a bitset*.
4 Adjust all dependencies.
5
6
b86796bf
AD
72002-03-04 Akim Demaille <akim@epita.fr>
8
9 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
10 Adjust all dependencies.
11
12
602bbf31
AD
132002-03-04 Akim Demaille <akim@epita.fr>
14
15 * src/L0.c, src/LR0.h (nstates): Be size_t.
16 Adjust comparisons (signed vs unsigned).
17 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18 bitset*.
19 Adjust all dependencies.
20
21
d8a0245c
AD
222002-03-04 Akim Demaille <akim@epita.fr>
23
24 * src/closure.c (firsts): Now, also a bitset.
25 Adjust all dependencies.
26 (varsetsize): Remove, now unused.
27 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
28
34ba9743
AD
292002-03-04 Akim Demaille <akim@epita.fr>
30
31 * src/print.c: Convert to use bitset.h, not hand coded iterations
32 over ints.
33
34
ed86e78c
AD
352002-03-04 Akim Demaille <akim@epita.fr>
36
37 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
38
dfdb1797
AD
392002-03-04 Akim Demaille <akim@epita.fr>
40
41 * src/closure.c (ruleset): Be a bitset.
42 (rulesetsize): Remove.
43
44
7086e707
AD
452002-03-04 Akim Demaille <akim@epita.fr>
46
47 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
48 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
49 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
50 * src/closure.c (fderives): Be an array of bitsets.
51
98254360
RA
522002-02-28 Robert Anisko <robert@lrde.epita.fr>
53
54 * data/bison.c++: Merge the two generated headers. Insert a copyright
55 notice in each output file.
56
a75c057f
AD
572002-02-28 Akim Demaille <akim@epita.fr>
58
59 * data/bison.c++: Copy the prologue of bison.simple to fetch
60 useful M4 definitions, such as b4_header_guard.
61
06b00abc
AD
622002-02-25 Akim Demaille <akim@epita.fr>
63
64 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
65 translator friendly scheme for the bgr
66 copyright notice.
06b00abc 67
70e7d534
AD
682002-02-25 Akim Demaille <akim@epita.fr>
69
70 * src/output.c (header_output): Remove, now handled completely via
71 M4.
72
abe017f6
AD
732002-02-25 Akim Demaille <akim@epita.fr>
74
75 * m4/m4.m4: New, from CVS Autoconf.
76 * configure.in: Invoke it.
77 * src/output.c (output_skeleton): Use its result instead of the
78 hard coded name.
79
381fb12e
AD
802002-02-25 Akim Demaille <akim@epita.fr>
81
82 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
83 Fileutils 4.1.5.
84 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
85 * src/output.c (output_skeleton): Use mkstemp to create a real
86 temporary file.
87 Move the filling of `skeleton' and its muscle to...
88 (prepare): here.
89 (output): Move the definition of the prologue muscle to...
90 (prepare): here.
91 * src/system.h (DEFAULT_TMPDIR): New.
92
6f38107f
PE
932002-02-14 Paul Eggert <eggert@twinsun.com>
94
95 Remove the support for C++ namespace cleanliness; it was
96 causing more problems than it was curing, since it didn't work
97 properly on some nonstandard C++ compilers. This can wait
98 for a proper C++ parser.
99
100 * NEWS: Document this.
101 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
102 of C++, as it's treated like C now.
103 * src/bison.simple (YYSTD): Remove.
104 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
105 Treat C++ just like Standard C instead of trying to support
106 namespace cleanliness.
107
80cce3da
AD
1082002-02-14 Akim Demaille <akim@epita.fr>
109
110 * tests/regression.at (else): Adjust to Andreas' change.
111
842e8679
AD
1122002-02-14 Akim Demaille <akim@epita.fr>
113
114 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
115
4bda3f10
AD
1162002-02-13 Andreas Schwab <schwab@suse.de>
117
118 * src/output.c (output_rule_data): Don't output NULL, it might
119 not be defined yet.
120
4162fa07 1212002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 122
4162fa07
RA
123 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
124 (Copyright notice): Update.
b418ecd8 125
bd16a5dc
AD
1262002-02-11 Akim Demaille <akim@epita.fr>
127
128 * tests/regression.at (%nonassoc and eof): Don't include
129 nonportable headers.
130
8d69a1a3
RA
1312002-02-08 Robert Anisko <robert@lrde.epita.fr>
132
133 * data/bison.c++: Correct error recovery. Make the user able to
134 initialize the starting location.
135
9b2d0677
AD
1362002-02-07 Akim Demaille <akim@epita.fr>
137
138 * tests/input.at: New.
139
69e2658b
RA
1402002-02-07 Robert Anisko <robert@lrde.epita.fr>
141
142 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 143 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
144 directives around tables only needed for debugging.
145
4aacc3a7
RA
1462002-02-07 Robert Anisko <robert@lrde.epita.fr>
147
148 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
149 C++ parsers.
150 (yy::b4_name::parse): Use print_.
151
762a801e
RA
1522002-02-07 Robert Anisko <robert@lrde.epita.fr>
153
154 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
155
4bb2bc3f
RA
1562002-02-07 Robert Anisko <robert@lrde.epita.fr>
157
158 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
159 C++ parsers.
160 (yy::b4_name::parse): Build verbose error messages, and use error_.
161
6b45a3ca
RA
1622002-02-06 Robert Anisko <robert@lrde.epita.fr>
163
164 * data/bison.c++: Fix m4 quoting in comments.
165
50997c6e
RA
1662002-02-06 Robert Anisko <robert@lrde.epita.fr>
167
168 * data/bison.c++: Adjust the parser code. Fix some muscles that were
169 not expanded by m4.
170
3f3eed27
AD
1712002-02-05 Akim Demaille <akim@epita.fr>
172
173 * data/bison.c++: Adjust to the M4 back end.
174 More is certainly needed.
175
be2a1a68
AD
1762002-02-05 Akim Demaille <akim@epita.fr>
177
178 Give a try to M4 as a back end.
179
180 * lib/readpipe.c: New, from wdiff.
181 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
182 BISON_HAIRY.
183 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
184 specific values. Now it is m4 that performs the lookup.
185 * src/parse-skel.y: Remove.
186 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
187 * src/output.c (actions_output, guards_output)
188 (token_definitions_output): No longer keeps track of the output
189 line number, hence remove the second argument.
190 (guards_output): Check against the guard member of a rule, not the
191 action member.
192 Adjust callers.
193 (output_skeleton): Don't look for the skeleton location, let m4 do
194 that.
195 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
196 file will be used.
197 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
198 (prepare): Given that for the time being changesyntax is not
199 usable in M4, rename the muscles using `-' to `_'.
200 Define `defines_flag', `output_parser_name' and `output_header_name'.
201 * src/output.h (actions_output, guards_output)
202 (token_definitions_output): Adjust prototypes.
203 * src/scan-skel.l: Instead of scanning the skeletons, it now
204 processes the output of m4: `__oline__' and `#output'.
205 * data/bison.simple: Adjust to be used by M4(sugar).
206 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
207 to date.
208 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
209 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
210 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
211 shamelessly stolen from CVS Autoconf.
212
beda758b
AD
2132002-02-05 Akim Demaille <akim@epita.fr>
214
215 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
216 * configure.in: Check for the declarations of free and malloc.
217 * src/muscle_tab.c: Adjust.
218
5ece6d43
AD
2192002-02-05 Akim Demaille <akim@epita.fr>
220
221 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
222 which have no values.
223
5bb18f9a
AD
2242002-02-05 Akim Demaille <akim@epita.fr>
225
226 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
227 * data/: here.
228
894dd62e
PE
2292002-01-29 Paul Eggert <eggert@twinsun.com>
230
231 * src/bison.simple (YYSIZE_T): Do not define merely because
232 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
233 On some platforms, <alloca.h> does not declare YYSTD (size_t).
234
82841af7
AD
2352002-01-27 Akim Demaille <akim@epita.fr>
236
237 Fix `%nonassoc and eof'.
238
239 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
240 which were not properly copied! Replace
241 memcpy (res->errs, src->errs, src->nerrs);
242 with
243 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
244 !!!
245 * tests/regression.at (%nonassoc and eof): Adjust to newest
246 Autotest: `.' is not in the PATH.
247
318b76e9
AD
2482002-01-27 Akim Demaille <akim@epita.fr>
249
250 * tests/sets.at (AT_EXTRACT_SETS): New.
251 (Nullable): Use it.
252 (Firsts): New.
253
30d2f3d5
AD
2542002-01-26 Akim Demaille <akim@epita.fr>
255
256 * tests/actions.at, tests/calc.at, tests/headers.at,
257 * tests/torture.at: Adjust to the newest Autotest which no longer
258 forces `.' in the PATH.
259
30f8c395
AD
2602002-01-25 Akim Demaille <akim@epita.fr>
261
262 * tests/regression.at (%nonassoc and eof): New.
263 Suggested by Robert Anisko.
264
29ae55f1
AD
2652002-01-24 Akim Demaille <akim@epita.fr>
266
267 Bison dumps core when trying to complain about broken input files.
268 Reported by Cris van Pelt.
269
270 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
271 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
272 into...
273 (Invalid inputs): Strengthen: exercise parse_percent_token.
274
2b548aa6
RA
2752002-01-24 Robert Anisko <robert.anisko@epita.fr>
276
277 * src/Makefile.am: Add bison.c++.
278 * src/bison.c++: New skeleton.
279
bb0146c2
AD
2802002-01-21 Paolo Bonzini <bonzini@gnu.org>
281
282 * po/it.po: New.
283
bec30531
AD
2842002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
285
286 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
287
fc6edc45
MA
2882002-01-20 Marc Autret <marc@gnu.org>
289
290 * src/files.c (compute_output_file_names): Fix
291
5e5d5415
MA
2922002-01-20 Marc Autret <marc@gnu.org>
293
294 * tests/output.at: New test.
295 * src/files.c (compute_base_names): Don't map extensions when
296 the YACC flag is set, use defaults.
297 Reported by Evgeny Stambulchik.
298
44ea3fbd
MA
2992002-01-20 Marc Autret <marc@gnu.org>
300
bb0146c2 301 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
302 compilers as well (i.e. the vendor C compiler).
303 Suggested by Albert Chin-A-Young.
304
338963d1
TVH
3052002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
306
307 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
308 canonical definition.
309 * src/system.h: Use the canonical definition for PARAMS (avoids
310 a conflict with the macro from lib/hash.h).
311
c57b2479
AD
3122002-01-11 Akim Demaille <akim@epita.fr>
313
314 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 315 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 316
b85810ae
AD
3172002-01-09 Akim Demaille <akim@epita.fr>
318
319 * src/files.c, src/files.h (output_infix): New.
320 (tab_extension): Remove.
321 (compute_base_names): Compute the former, drop the latter.
322 * src/output.c (prepare): Insert the muscles `output-infix', and
323 `output-suffix'.
324 * src/parse-skel.y (string, string.1): New.
325 (section.header): Use it.
326 (section.yacc): Remove.
327 (prefix): Remove too.
328 * src/scan-skel.l: Adjust.
329 * src/bison.simple, src/bison.hairy: Adjust.
330
cae60122
AD
3312002-01-09 Akim Demaille <akim@epita.fr>
332
333 * configure.in (WERROR_CFLAGS): Compute it.
334 * src/Makefile.am (CFLAGS): Pass it.
335 * tests/atlocal.in (CFLAGS): Idem.
336 * src/files.c: Fix a few warnings.
337 (get_extension_index): Remove, unused.
338
ae404801
AD
3392002-01-08 Akim Demaille <akim@epita.fr>
340
341 * src/getargs.c (AS_FILE_NAME): New.
342 (getargs): Use it to convert DOSish file names.
343 * src/files.c (base_name): Rename as full_base_name to avoid
344 clashes with `base_name ()'.
345 (filename_split): New.
346 (compute_base_names): N-th rewrite, using filename_split.
347
22312b71
AD
3482002-01-08 Akim Demaille <akim@epita.fr>
349
350 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
351 New, stolen from the Fileutils 4.1.
352 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
353 * configure.in: Check for the presence of memrchr, and of its
354 prototype.
355
a67cef01
TVH
3562002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
357
358 * lib/hash.h (__P): Added definition for this macro.
359 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
360 BUILT_SOURCES, to ensure they are generated first.
361 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
362 %error-verbose to allow bootstrapping with bison 1.30x.
363
2b25d624
AD
3642002-01-06 Akim Demaille <akim@epita.fr>
365
366 * src/reader.c (parse_braces): Don't fetch the next char, the
367 convention is to fetch on entry.
368 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
369 'switch' without a following semicolon.
370 * tests/regression.at (braces parsing): New.
371
3460813b
AD
3722002-01-06 Akim Demaille <akim@epita.fr>
373
374 Bison is dead wrong in its RR conflict reports.
375
376 * tests/torture.at (GNU Cim Grammar): New.
377 * src/conflicts.c (count_rr_conflicts): Fix.
378
73784c64
AD
3792002-01-06 Akim Demaille <akim@epita.fr>
380
381 Creating package.m4 from configure.ac causes too many problems.
382
383 * tests/Makefile.am (package.m4): Create it by hand,
384 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
385
25d81090
AD
3862002-01-06 Akim Demaille <akim@epita.fr>
387
388 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
389 skeleton.h.
390
a9b8959e
PE
3912002-01-04 Paul Eggert <eggert@twinsun.com>
392
393 * doc/bison.texinfo (Debugging):
394 Remove YYSTDERR; it's no longer defined or used.
395 Also, s/cstdio.h/cstdio/.
396
25d81090
AD
3972002-01-03 Akim Demaille <akim@epita.fr>
398
399 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
400
1109455c
AD
4012002-01-03 Akim Demaille <akim@epita.fr>
402
403 * src/parse-skel.y (process_skeleton): Don't bind the parser's
404 tracing code to --trace, wait for a better --trace option, with
405 args.
406
7ea5e977
AD
4072002-01-03 Akim Demaille <akim@epita.fr>
408
409 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
410 The ISO C++ standard is extremely clear about it: stderr is
411 considered a macro, not a regular symbol (see table 94 `Header
412 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
413 Therefore std:: does not apply to it. It still does with fprintf.
414 Also, s/cstdio.h/cstdio/.
415
fab5b110
AD
4162002-01-03 Akim Demaille <akim@epita.fr>
417
418 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
419 for non system headers.
420
aed7fd9b
AD
4212002-01-02 Akim Demaille <akim@epita.fr>
422
423 Equip the skeleton chain with location tracking, runtime trace,
424 pure parser and scanner.
425
426 * src/parse-skel.y: Request a pure parser, locations, and prefix
427 renaming.
428 (%union): Having several members with the same type does not help
429 type mismatches, simplify.
430 (YYPRINT, yyprint): New.
431 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
432 (skel_error): this.
433 Handle locations.
434 * src/scan-skel.l: Adjust to these changes.
435 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
436 (LOCATION_PRINT, skel_control_t): New.
437
24fad99e
AD
4382001-12-30 Akim Demaille <akim@epita.fr>
439
440 * src/parse-skel.y: Get rid of the shift/reduce conflict:
441 replace `gb' with BLANKS.
442 * src/scan-skel.l: Adjust.
443
a4b36db4
AD
4442001-12-30 Akim Demaille <akim@epita.fr>
445
446 * src/system.h: We don't need nor want bcopy.
447 Throw away MS-DOS crap: we don't need getpid.
448 * configure.in: We don't need strndup. It was even causing
449 problems: because Flex includes the headers *before* us,
450 _GNU_SOURCE is not defined by config.h, and therefore strndup was
451 not visible.
452 * lib/xstrndup.c: New.
453 * src/scan-skel.l: Use it.
454 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
455 * src/parse-skel.y: Use %directives instead of #defines.
456
1239777d
AD
4572001-12-30 Akim Demaille <akim@epita.fr>
458
459 * src/skeleton.h: New.
460 * src/output.c (output_parser, output_master_parser): Remove, dead
461 code.
462 * src/output.h (get_lines_number, actions_output, guards_output)
463 (token_definitions_output): Prototype them.
464 * src/parse-skel.y: Add the license notice.
465 Include output.h and skeleton.h.
466 (process_skeleton): Returns void, and takes a single parameter.
467 * src/scan-skel.l: Add the license notice.
468 Include skeleton.h.
469 Don't use %option yylineno: it seems that then Flex imagines
470 REJECT has been used, and therefore it won't reallocate its
471 buffers (which makes no other sense to me than a bug). It results
472 in warnings for `unused: yy_flex_realloc'.
473
9b3add5b
RA
4742001-12-30 Robert Anisko <robert.anisko@epita.fr>
475
476 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
477 (MUSCLE_INSERT_PREFIX): ...to there.
478 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
479 (MUSCLE_INSERT_PREFIX): Move from here...
480
481 * src/bison.hairy: Add a section directive. Put braces around muscle
482 names. This parser skeleton is still broken, but Bison should not
483 choke on a bad muscle 'syntax'.
484 * src/bison.simple: Add a section directive. Put braces around muscle
485 names.
486
487 * src/files.h (strsuffix, stringappend): Add declarations.
488 (tab_extension): Add declaration.
489 (short_base_name): Add declaration.
490
491 * src/files.c (strsuffix, stringappend): No longer static. These
492 functions are used in the skeleton parser.
493 (tab_extension): New.
494 (compute_base_names): Use the computations done in this function
fab5b110 495 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
496 names.
497 (short_base_name): No longer static.
498
499 * src/output.c (output_skeleton): New.
500 (output): Disable call to output_master_parser, and give a try to
501 a new skeleton handling system.
502 (guards_output, actions_output): No longer static.
503 (token_definitions_output, get_lines_number): No longer static.
504
505 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
506
fab5b110 507 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
508 parse-skel.y.
509
510 * src/parse-skel.y: New file.
511 * src/scan-skel.l: New file.
512
b5b61c61
AD
5132001-12-29 Akim Demaille <akim@epita.fr>
514
515 %name-prefix is broken.
516
517 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
518 Adjust all dependencies.
519 * tests/headers.at (export YYLTYPE): Strengthen this test: use
520 %name-prefix.
521
522 Renaming yylval but not yylloc is not consistent. Now we do.
523
524 * src/bison.simple: Prefix yylloc if used.
525 * doc/bison.texinfo (Decl Summary): Document that.
526
8c9a50be
AD
5272001-12-29 Akim Demaille <akim@epita.fr>
528
529 * doc/bison.texinfo: Promote `%long-directive' over
530 `%long_directive'.
531 Remove all references to fixed-output-files, yacc is enough.
532
d99361e6
AD
5332001-12-29 Akim Demaille <akim@epita.fr>
534
535 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
536 user prologue. These are defaults.
537 * tests/actions.at (Mid-rule actions): Make sure the user can
538 define YYDEBUG and YYERROR_VERBOSE.
539
b9cecb91
AD
5402001-12-29 Akim Demaille <akim@epita.fr>
541
542 * src/output.c (header_output): Don't forget to export YYLTYPE and
543 yylloc.
544 * tests/headers.at (export YYLTYPE): New, make sure it does.
545 * tests/regression.at (%union and --defines, Invalid CPP headers):
546 Move to...
547 * tests/headers.at: here.
548
aea13e97
AD
5492001-12-29 Akim Demaille <akim@epita.fr>
550
551 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
552
931394cb
AD
5532001-12-29 Akim Demaille <akim@epita.fr>
554
555 * tests/actions.at (Mid-rule actions): Output on a single line
556 instead of several.
557
704a47c4
AD
5582001-12-29 Akim Demaille <akim@epita.fr>
559
560 * doc/bison.texinfo: Formatting changes.
561
091e20bb
AD
5622001-12-29 Akim Demaille <akim@epita.fr>
563
564 Don't store the token defs in a muscle, just be ready to output it
565 on command. Now possible via `symbols'. Fixes a memory leak.
566
567 * src/output.c (token_definitions_output): New.
568 (output_parser, header_output): Use it.
569 * src/reader.c (symbols_save): Remove.
570
cce71710
AD
5712001-12-29 Akim Demaille <akim@epita.fr>
572
573 * src/bison.simple: Do not provide a default for YYSTYPE and
574 YYLTYPE before the user's prologue. Otherwise it's hardly... a
575 default.
576
82c035a8
AD
5772001-12-29 Akim Demaille <akim@epita.fr>
578
579 Mid-rule actions are simply... ignored!
580
581 * src/reader.c (readgram): Be sure to attach mid-rule actions to
582 the empty-rule associated to the dummy symbol, not to the host
583 rule.
584 * tests/actions.at (Mid-rule actions): New.
585
8419d367
AD
5862001-12-29 Akim Demaille <akim@epita.fr>
587
588 Memory leak.
589
590 * src/reader.c (reader): Free grammar.
591
375d5806
AD
5922001-12-29 Akim Demaille <akim@epita.fr>
593
594 Memory leak.
595
596 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
597 since it allocates it for each state, although only one is needed.
598 (allocate_storage): Do it here.
599
f51cb8ff
AD
6002001-12-29 Akim Demaille <akim@epita.fr>
601
602 * src/options.h, src/options.c (create_long_option_table): Rename
603 as...
604 (long_option_table_new): this, with a clearer prototype.
605 (percent_table): Remove, unused,
606 * src/getargs.c (getargs): Adjust.
607
29e88316
AD
6082001-12-29 Akim Demaille <akim@epita.fr>
609
610 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
611 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
612 as states.
613
b9f71f19
AD
6142001-12-29 Akim Demaille <akim@epita.fr>
615
616 * src/lalr.c (build_relations): Rename `states' as `states1'.
617 Sorry, I don't understand exactly what it is, no better name...
618
1a2b5d37
AD
6192001-12-29 Akim Demaille <akim@epita.fr>
620
621 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
622 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
623 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
624 as rules.
625
1cca533e
AD
6262001-12-29 Akim Demaille <akim@epita.fr>
627
628 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
629 ago.
630
c03ae966
AD
6312001-12-29 Akim Demaille <akim@epita.fr>
632
633 * src/reader.c, src/reader.h (user_toknums): Remove.
634 Adjust all users to use symbols[i]->user_token_number.
635
5a670b1e
AD
6362001-12-29 Akim Demaille <akim@epita.fr>
637
638 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
639 Adjust all users to use symbols[i]->prec or ->assoc.
640
ad949da9
AD
6412001-12-29 Akim Demaille <akim@epita.fr>
642
643 * src/reader.c, src/reader.h (tags): Remove.
644 Adjust all users to use symbols[i]->tag.
645
0e78e603
AD
6462001-12-29 Akim Demaille <akim@epita.fr>
647
648 * src/gram.h, src/gram.c (symbols): New, similar to state_table
649 and rule_table.
650 * src/reader.c (packsymbols): Fill this table.
651 Drop sprec.
652 * src/conflicts.c (resolve_sr_conflict): Adjust.
653 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
654 single table.
655 Use symbols[i]->tag instead of tags[i].
656
213e640e
AD
6572001-12-29 Akim Demaille <akim@epita.fr>
658
659 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
660 In addition, put a comment in there, to replace...
661 * tests/regression.at (%union and C comments): Remove.
662
e7b8bef1
AD
6632001-12-29 Akim Demaille <akim@epita.fr>
664
665 * tests/regression.at (Web2c Actions): Blindly move the actual
666 output as expected output. The contents *seem* right to me, but I
667 can't pretend reading perfectly parser tables... Nonetheless, all
668 the other tests pass correctly, the table look OK, even though the
669 presence of `$axiom' is to be noted: AFAICS it is useless (but
670 harmless).
671
b68e7744
AD
6722001-12-29 Akim Demaille <akim@epita.fr>
673
674 * src/reader.c (readgram): Don't add the rule 0 if there were no
675 rules read. In other words, add it _after_ having performed
676 grammar sanity checks.
677 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
678
78d5bae9
AD
6792001-12-29 Akim Demaille <akim@epita.fr>
680
681 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
682 visible, and some states have now a different number.
683
ff442794
AD
6842001-12-29 Akim Demaille <akim@epita.fr>
685
686 * src/reader.c (readgram): Bind the initial rule's lineno to that
687 of the first rule.
688 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
689 (Solved SR Conflicts): Adjust rule 0's line number.
690
610ab194
AD
6912001-12-29 Akim Demaille <akim@epita.fr>
692
693 Fix the `GAWK Grammar' failure.
694
695 * src/LR0.c (final_state): Initialize to -1 so that we do compute
696 the reductions of the first state which was mistakenly confused
697 with the final state because precisely final_state was initialized
698 to 0.
699 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
700 now noticed by Bison.
701 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
702 have a reduction on $default.
703
29d29c8f
AD
7042001-12-29 Akim Demaille <akim@epita.fr>
705
706 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
707 rule line numbers.
708 * src/closure.c (print_closure): Likewise.
709 * src/derives.c (print_derives): Likewise.
710 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
711 now.
712
7c6b64d0
AD
7132001-12-29 Akim Demaille <akim@epita.fr>
714
715 * src/lalr.c (lookaheads_print): New.
716 (lalr): Call it when --trace-flag.
717 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
718 are dumped.
719
3d4daee3
AD
7202001-12-29 Akim Demaille <akim@epita.fr>
721
722 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
723 when walking through ritem, even via rule->rhs.
724 * src/reduce.c (dump_grammar, useful_production, reduce_output)
725 (useful_production, useless_nonterminals): Likewise.
726 (reduce_grammar_tables): Likewise, plus update nritems.
727 * src/nullable.c (set_nullable): Likewise.
728 * src/lalr.c (build_relations): Likewise.
729 * tests/sets.at (Nullable): Adjust.
730 Fortunately, now, the $axiom is no longer nullable.
731
9e7f6bbd
AD
7322001-12-29 Akim Demaille <akim@epita.fr>
733
734 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
735 the 0-sentinel.
736 * src/gram.c (ritem_longest_rhs): Likewise.
737 * src/reduce.c (nonterminals_reduce): Likewise.
738 * src/print_graph.c (print_graph): Likewise.
739 * src/output.c (output_rule_data): Likewise.
740 * src/nullable.c (set_nullable): Likewise.
741
255ef638
AD
7422001-12-29 Akim Demaille <akim@epita.fr>
743
744 * src/output.c: Comment changes.
745
0d8a7363
AD
7462001-12-27 Paul Eggert <eggert@twinsun.com>
747
748 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
749 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
750 Sparc, as they were causing more porting problems than the
751 (minor) performance improvement was worth.
752
753 Also, catch up with 1.31's YYSTD.
754
3db472b9
AD
7552001-12-27 Akim Demaille <akim@epita.fr>
756
757 * src/output.c (output_gram): Rely on nritems, not the
758 0-sentinel. See below.
759 Use -1 as separator, not 0.
760 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
761 Rely on -1 as separator in yyrhs, instead of 0.
762 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
763 twice `Now at end of input', therefore there are two lines less to
764 expect.
765
b365aa05
AD
7662001-12-27 Akim Demaille <akim@epita.fr>
767
768 * tests/regression.at (Unresolved SR Conflicts):
769 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
770 below.
771
30171f79
AD
7722001-12-27 Akim Demaille <akim@epita.fr>
773
774 * src/LR0.c (new_state): Recognize the final state by the fact it
775 is reached by eoftoken.
776 (insert_start_shifting_state, insert_eof_shifting_state)
777 (insert_accepting_state, augment_automaton): Remove, since now
778 these states are automatically computed from the initial state.
779 (generate_states): Adjust.
780 * src/print.c: When reporting a rule number to the user, substract
781 1, so that the axiom rule is rule 0, and the first user rule is 1.
782 * src/reduce.c: Likewise.
783 * src/print_graph.c (print_core): For the time being, just as for
784 the report, depend upon --trace-flags to dump the full set of
785 items.
786 * src/reader.c (readgram): Once the grammar read, insert the rule
787 0: `$axiom: START-SYMBOL $'.
788 * tests/set.at: Adjust: rule 0 is now displayed, and since the
789 number of the states has changed (the final state is no longer
790 necessarily the last), catch up.
791
75142d45
AD
7922001-12-27 Akim Demaille <akim@epita.fr>
793
794 Try to make the use of the eoftoken valid. Given that its value
795 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
796 is used instead of > 0 where appropriate, (ii), depend upon nritems
797 instead of the 0-sentinel.
798
799 * src/gram.h, src/gram.c (nritems): New.
800 Expected to be duplication of nitems, but for the time being...
801 * src/reader.c (packgram): Assert nritems and nitems are equal.
802 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
803 * src/closure.c (print_closure, print_fderives): Likewise.
804 * src/gram.c (ritem_print): Likewise.
805 * src/print.c (print_core, print_grammar): Likewise.
806 * src/print_graph.c: Likewise.
807
b7c49edf
AD
8082001-12-27 Akim Demaille <akim@epita.fr>
809
810 * src/main.c (main): If there are complains after grammar
811 reductions, then output the report anyway if requested, then die.
812 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
813 * src/reader.c (eoftoken): New.
814 (parse_token_decl): If the token being defined has value `0', it
815 is the eoftoken.
816 (packsymbols): No longer hack `tags' to insert `$' by hand.
817 Be sure to preserve the value of the eoftoken.
818 (reader): Make sure eoftoken is defined.
819 Initialize nsyms to 0: now eoftoken is created just like the others.
820 * src/print.c (print_grammar): Don't special case the eof token.
821 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
822 lie anyway, albeit pleasant.
823 * tests/calc.at: Exercise error messages with eoftoken.
824 Change the grammar so that empty input is invalid.
825 Adjust expectations.
826 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
827
ec2da99f
AD
8282001-12-27 Akim Demaille <akim@epita.fr>
829
830 * configure.in: Check the protos of strchr ans strspn.
831 Replace strchr if needed.
832 * src/system.h: Provide the protos of strchr, strspn and memchr if
833 missing.
834 * lib/strchr.c: New.
835 * src/reader.c (symbols_save): Use strchr.
836
8adfa272
AD
8372001-12-27 Akim Demaille <akim@epita.fr>
838
839 * src/print.c, src/print_graph.c (escape): New.
840 Use it to quote the TAGS outputs.
841 * src/print_graph.c (print_state): Now errors are in red, and
842 reductions in green.
843 Prefer high to wide: output the state number on a line of its own.
844
80dac38c
AD
8452001-12-27 Akim Demaille <akim@epita.fr>
846
847 * src/state.h, src/state.c (reductions_new): New.
848 * src/LR0.c (set_state_table): Let all the states have a
849 `reductions', even if reduced to 0.
850 (save_reductions): Adjust.
851 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
852 * src/print.c (print_reductions, print_actions): Adjust.
853 * src/output.c (action_row): Adjust.
854
2cec70b9
AD
8552001-12-27 Akim Demaille <akim@epita.fr>
856
857 * src/state.h, src/state.c (errs_new, errs_dup): New.
858 * src/LR0.c (set_state_table): Let all the states have an errs,
859 even if reduced to 0.
860 * src/print.c (print_errs, print_reductions): Adjust.
861 * src/output.c (output_actions, action_row): Adjust.
862 * src/conflicts.c (resolve_sr_conflict): Adjust.
863
13ca549a
AD
8642001-12-27 Akim Demaille <akim@epita.fr>
865
866 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
867
5092aba5
AD
8682001-12-27 Akim Demaille <akim@epita.fr>
869
870 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
871 * src/print.c: here.
872 (lookaheadset, shiftset): New, used as additional storage by
873 print_reductions.
874 (print_results): Adjust.
875 (print_shifts, print_gotos, print_errs): New, extracted from...
876 (print_actions): here.
877 * src/print_graph.c (print_actions): Remove dead code.
878
11e2beca
AD
8792001-12-27 Akim Demaille <akim@epita.fr>
880
881 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
882 `$n' and `@n'.
883
dac3c910
AD
8842001-12-27 Akim Demaille <akim@epita.fr>
885
886 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
887 (build_relations): Adjust.
888
d0b0fefa
AD
8892001-12-27 Akim Demaille <akim@epita.fr>
890
891 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
892 duplication.
893
adc8c848
AD
8942001-12-27 Akim Demaille <akim@epita.fr>
895
896 * src/reader.c (packgram): Catch nitems overflows.
897
14d293ac
AD
8982001-12-27 Akim Demaille <akim@epita.fr>
899
900 * src/files.c, src/files.h (guard_obstack): Remove.
901 * src/output.c (output): Adjust.
902 * src/reader.c (parse_braces): New, factoring...
903 (copy_action, copy_guard): these two which are renamed as...
904 (parse_action, parse_guard): these.
905 As a voluntary consequence, using braces around guards is now
906 mandatory.
907
f499b062
AD
9082001-12-27 Akim Demaille <akim@epita.fr>
909
910 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
911 * src/reader.c (symbol_list): `guard' and `guard_line' are new
912 members.
913 (symbol_list_new): Adjust.
914 (copy_action): action_line is the first line, not the last.
915 (copy_guard): Just as for actions, store the `action' only, not
916 the switch/case/break flesh.
917 Don't parse the user action that might follow the guard, let...
918 (readgram): do it, i.e., now, there can be an action after a
919 guard.
920 In other words the guard is just explicitly optional.
921 (packgram): Adjust.
922 * src/output.c (guards_output): New.
923 (output_parser): Call it when needed.
924 (output): Also free the guard and attrs obstacks.
925 * src/files.c, src/files.h (obstack_save): Remove.
926 (output_files): Remove.
927 As a result, if one needs the former `.act' file, using an
928 appropriate skeleton which requires actions and guards is now
929 required.
930 * src/main.c (main): Adjust.
931 * tests/semantic.at: New.
932 * tests/regression.at: Use `input.y' as input file name.
933 Avoid 8+3 problems by requiring input.c when the test needs the
934 parser.
935
d945f5cd
AD
9362001-12-27 Akim Demaille <akim@epita.fr>
937
938 * src/reader.c (symbol_list_new): Be sure to initialize all the
939 fields.
940
d200e455
AD
9412001-12-27 Akim Demaille <akim@epita.fr>
942
943 All the hacks using a final pseudo state are now useless.
944
945 * src/LR0.c (set_state_table): state_table holds exactly nstates.
946 * src/lalr.c (nLA): New.
947 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
948 instead of lookaheadsp from the pseudo state (nstate + 1).
949
f9507c28
AD
9502001-12-27 Akim Demaille <akim@epita.fr>
951
952 * src/output.c (action_row, token_actions): Use a state_t instead
953 of a integer, and nlookaheads instead of the following state's
954 lookaheadsp.
955
065fbd27
AD
9562001-12-27 Akim Demaille <akim@epita.fr>
957
958 * src/conflicts.c (log_resolution, flush_shift)
959 (resolve_sr_conflict, set_conflicts, solve_conflicts)
960 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
961 (conflicts_print, print_reductions): Use a state_t instead of an
962 integer when referring to a state.
963 As much as possible, depend upon nlookaheads, instead of the
964 `lookaheadsp' member of the following state (since lookaheads of
965 successive states are successive, the difference between state n + 1
966 and n served as the number of lookaheads for state n).
967 * src/lalr.c (add_lookback_edge): Likewise.
968 * src/print.c (print_core, print_actions, print_state)
969 (print_results): Likewise.
970 * src/print_graph.c (print_core, print_actions, print_state)
971 (print_graph): Likewise.
972 * src/conflicts.h: Adjust.
973
1b177bd7
AD
9742001-12-27 Akim Demaille <akim@epita.fr>
975
976 * src/bison.hairy: Formatting/comment changes.
977 ANSIfy.
978 Remove `register' indications.
979 Add plenty of `static'.
980
7742ddeb
AD
9812001-12-27 Akim Demaille <akim@epita.fr>
982
983 * src/output.c (prepare): Drop the muscle `ntbase' which
984 duplicates ntokens.
985 * src/bison.simple: Formatting/comment changes.
986 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
987 is an undocumented synonym.
988
1fa14068
AD
9892001-12-22 Akim Demaille <akim@epita.fr>
990
991 * src/output.c (output_table_data): Change the prototype to use
992 `int' for array ranges: some invocations do pass an int, not a
993 short.
994 Reported by Wayne Green.
995
b9752825
AD
9962001-12-22 Akim Demaille <akim@epita.fr>
997
998 Some actions of web2c.y are improperly triggered.
999 Reported by Mike Castle.
1000
1001 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1002 * tests/regression.at (Web2c): Rename as...
1003 (Web2c Report): this.
1004 (Web2c Actions): New.
1005
776209d6
AD
10062001-12-22 Akim Demaille <akim@epita.fr>
1007
1008 Reductions in web2c.y are improperly reported.
1009 Reported by Mike Castle.
1010
1011 * src/conflicts.c (print_reductions): Fix.
1012 * tests/regression.at (Web2c): New.
1013
275fc3ad
AD
10142001-12-18 Akim Demaille <akim@epita.fr>
1015
1016 Some host fail on `assert (!"foo")', which expands to
1017 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1018 Reported by Nelson Beebee.
1019
1020 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1021 `#define it_succeeded 0' and `assert (it_succeeded)'.
1022
897668ee
MA
10232001-12-17 Marc Autret <autret_m@epita.fr>
1024
1025 * src/bison.simple: Don't hard code the skeleton line and filename.
1026 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1027 New line counter 'skeleton_line' (skeleton-line muscle).
1028
ab3399e0
PE
10292001-12-17 Paul Eggert <eggert@twinsun.com>
1030
1031 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1032 YYDEBUG must be defined to a nonzero value.
1033
1034 * src/bison.simple (yytname): Do not assume that the user defines
1035 YYDEBUG to a properly parenthesized expression.
1036
3877f72b
AD
10372001-12-17 Akim Demaille <akim@epita.fr>
1038
1039 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1040 nlookaheads is a new member.
1041 Adjust all users.
1042 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1043 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1044 state.
776209d6 1045
331dbc1b
AD
10462001-12-17 Akim Demaille <akim@epita.fr>
1047
1048 * src/files.h, src/files.c (open_files, close_files): Remove.
1049 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1050 let...
1051 * src/reader.c (reader): Do it.
776209d6 1052
be750e4c
AD
10532001-12-17 Akim Demaille <akim@epita.fr>
1054
1055 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1056
709ae8c6
AD
10572001-12-17 Akim Demaille <akim@epita.fr>
1058
1059 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1060 (flush_reduce): New.
1061 (resolve_sr_conflict): Adjust.
776209d6 1062
f87685c3
AD
10632001-12-17 Akim Demaille <akim@epita.fr>
1064
1065 * src/output.c (output_obstack): Be static and rename as...
1066 (format_obstack): this, to avoid any confusion with files.c's
1067 output_obstack.
1068 * src/reader.h (muscle_obstack): Move to...
1069 * src/output.h: here, since it's defined in output.c.
1070
837491d8
AD
10712001-12-17 Akim Demaille <akim@epita.fr>
1072
1073 * src/output.c (action_row, save_column, default_goto)
1074 (sort_actions, matching_state, pack_vector): Better variable
1075 locality.
1076
796d61fb
AD
10772001-12-17 Akim Demaille <akim@epita.fr>
1078
1079 * src/output.c: Various formatting changes.
776209d6 1080
64d15509
AD
10812001-12-17 Akim Demaille <akim@epita.fr>
1082
1083 * src/files.c (output_files): Free the output_obstack.
1084 * src/main.c (main): Call print and print_graph conditionally.
1085 * src/print.c (print): Work unconditionally.
1086 * src/print_graph.c (print_graph): Work unconditionally.
1087 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1088
fbc8ecb7
MA
10892001-12-16 Marc Autret <autret_m@epita.fr>
1090
1091 * src/output.c (actions_output): Fix. When we use %no-lines,
1092 there is one less line per action.
1093
f0440388
MA
10942001-12-16 Marc Autret <autret_m@epita.fr>
1095
1096 * src/bison.simple: Remove a useless #line directive.
1097 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1098 * src/output.c (get_lines_number): New.
776209d6 1099 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1100 output muscles.
1101 Fix line numbering.
1102 (actions_output): Computes the number of lines taken by actions.
1103 (output_master_parser): Insert new skeleton which is the name of
1104 the output parser file name.
1105
a79986b8
MA
11062001-12-15 Marc Autret <autret_m@epita.fr>
1107
1108 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1109
4ec8e00f
MA
11102001-12-15 Marc Autret <autret_m@epita.fr>
1111
1112 * src/output.c (output_gram): Keep track of the hairy one.
1113
1a4648ff
AD
11142001-12-15 Akim Demaille <akim@epita.fr>
1115
1116 Make `make distcheck' work.
1117
1118 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1119 system.h which uses libgettext.h.
1120
9c2c67e6
AD
11212001-12-15 Akim Demaille <akim@epita.fr>
1122
1123 * src/nullable.c (set_nullable): Useless rules must be skipped,
1124 otherwise, since we range over their symbols, we might look at a
1125 nonterminal which no longer ``exists'', i.e., it is not counted in
1126 `nvars', hence we overflow our arrays.
1127
93ede233
AD
11282001-12-15 Akim Demaille <akim@epita.fr>
1129
1130 The header can also be produced directly, without any obstack!
1131 Yahoo!
1132
1133 * src/files.c, src/files.h (defines_obstack): Remove.
1134 (compute_header_macro): Global.
1135 (defines_obstack_save): Remove.
1136 * src/reader.c (parse_union_decl): No longer output to
1137 defines_obstack: its content can be found in the `stype' muscle
1138 anyway.
1139 (output_token_translations): Merge into...
1140 (symbols_output): this.
1141 Rename as...
1142 (symbols_save): this.
1143 (reader): Adjust.
1144 * src/output.c (header_output): New.
1145 (output): Call it.
1146
2666f928
AD
11472001-12-15 Akim Demaille <akim@epita.fr>
1148
1149 * src/reader.c (parse_union_decl): Instead of handling two obstack
1150 simultaneously, use one to define the `stype' muscle, and use the
1151 value of the latter to fill defines_obstack.
1152 (copy_comment): Remove.
1153 (copy_comment2): Work for a single obstack.
1154 Rename as...
1155 (copy_comment): this.
1156
428046f8
AD
11572001-12-15 Akim Demaille <akim@epita.fr>
1158
1159 * src/lex.c, src/lex.h (xgetc): No longer static.
1160 * src/reader.c (parse_union_decl): Revamp.
1161
ea52d706
AD
11622001-12-15 Akim Demaille <akim@epita.fr>
1163
1164 Still making progress in separating Bison into (i) input, (ii)
1165 process, (iii) output: now we can directly output the parser file
1166 without using table_obstack at all.
1167
1168 * src/files.c, src/files.h (table_obstack): Bye bye.
1169 (parser_file_name): New.
1170 * src/files.c (compute_output_file_names): Compute it.
1171 * src/output.c (actions_output, output_parser)
1172 (output_master_parser): To a file instead of an obstack.
1173
3f96f4dc
AD
11742001-12-15 Akim Demaille <akim@epita.fr>
1175
1176 Attach actions to rules, instead of pre-outputting them to
1177 actions_obstack.
1178
1179 * src/gram.h (rule_t): action and action_line are new members.
1180 * src/reader.c (symbol_list): Likewise.
1181 (copy_action): Save the actions within the rule.
1182 (packgram): Save them in rule_table.
1183 * src/output.c (actions_output): New.
1184 (output_parser): Use it on `%%actions'.
1185 (output_rule_data): Don't free rule_table.
1186 (output): Do it.
1187 (prepare): Don't save the `action' muscle.
1188 * src/bison.simple: s/%%action/%%actions/.
1189
51576fb3
AD
11902001-12-15 Akim Demaille <akim@epita.fr>
1191
1192 * src/reader.c (copy_action): When --yacc, don't append a `;'
1193 to the user action: let it fail if lacking.
dee049eb 1194 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1195
2648a72d
AD
11962001-12-14 Akim Demaille <akim@epita.fr>
1197
1198 * src/lex.c (literalchar): Simply return the char you decoded, non
1199 longer mess around with obstacks and int pointers.
1200 Adjust all callers.
1201
92790e5b
AD
12022001-12-14 Akim Demaille <akim@epita.fr>
1203
1204 * src/lex.c (literalchar): Don't escape the special characters,
1205 just decode them, and keep them as char (before, eol was output as
1206 the 2 char string `\n' etc.).
1207 * src/output.c (output_rule_data): Use quotearg to output the
1208 token strings.
1209
927c1557
PE
12102001-12-13 Paul Eggert <eggert@twinsun.com>
1211
1212 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1213 Do not infringe on the global user namespace when using C++.
1214 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1215 All uses of `fprintf' and `stderr' changed.
1216
1217 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1218
ed8e1f68
AD
12192001-12-13 Akim Demaille <akim@epita.fr>
1220
1221 The computation of nullable is broken: it doesn't handle empty
1222 RHS's properly.
1223
1224 * tests/torture.at (GNU AWK Grammar): New.
1225 * tests/sets.at (Nullable): New.
1226 * src/nullable.c (set_nullable): Instead of blindly looping over
1227 `ritems', loop over the rules, and then over their rhs's.
1228
1229 Work around Autotest bugs.
1230
1231 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1232 frame, because Autotest understand lines starting with a `+' as
1233 traces from the shell. Then, they are not processed properly.
1234 Admittedly an Autotest bug, but we don't have time to wait for
1235 Autotest to catch up.
1236 * tests/regression.at (Broken Closure): Adjust to the new table
1237 frames.
1238 Move to...
1239 * tests/sets.at: here.
1240
cb581495
AD
12412001-12-13 Akim Demaille <akim@epita.fr>
1242
1243 * src/closure.c (closure): Use nrules instead of playing tricks
1244 with BITS_PER_WORD.
1245
2e729273
AD
12462001-12-13 Akim Demaille <akim@epita.fr>
1247
1248 * src/print.c (print_actions): Output the handling of `$' as the
1249 traces do: shifting the token EOF. Before EOF was treated as a
1250 nonterminal.
1251 * tests/regression.at: Adjust some tests.
1252 * src/print_graph.c (print_core): Complete the set of items via
1253 closure. The next-to-final and final states are still unsatisfying,
1254 but that's to be addressed elsewhere.
1255 No longer output the rule numbers, but do output the state number.
1256 A single loop for the shifts + gotos is enough, but picked a
1257 distinct color for each.
1258 (print_graph): Initialize and finalize closure.
1259
107f7dfb
AD
12602001-12-13 Akim Demaille <akim@epita.fr>
1261
1262 * src/reader.c (readgram): Remove dead code, an strip useless
1263 braces.
1264 (get_type): Remove, unused.
1265
9b53a24f
AD
12662001-12-12 Akim Demaille <akim@epita.fr>
1267
1268 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1269 on that of lib/error.c.
1270
dbfb6dcd
AD
12712001-12-12 Akim Demaille <akim@epita.fr>
1272
1273 Some hosts don't like `/' in includes.
1274
1275 * src/system.h: Include libgettext.h without qualifying the path.
1276 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1277 $(top_srcdir).
1278
c25fb648
MA
12792001-12-11 Marc Autret <autret_m@epita.fr>
1280
1281 * src/output.c (output_parser): Remove useless muscle.
1282
710ddc4f
MA
12832001-12-11 Marc Autret <autret_m@epita.fr>
1284
1285 * src/bison.simple: Remove #line just before %%epilogue. It
1286 is now handled in ...
1287 * src/reader.c (read_additionnal_code): Add the output of a
1288 #line for the epilogue.
1289
e83d80b8
MA
12902001-12-10 Marc Autret <autret_m@epita.fr>
1291
927c1557 1292 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1293 replace precedent remove.
1294 * src/bison.simple: Remove #line before %%prologue because
1295 %%input-line is wrong at this time.
1296
971d5158
MA
12972001-12-10 Marc Autret <autret_m@epita.fr>
1298
1299 * src/reader.c (symbols_output): Clean up.
927c1557 1300 * src/output.c (output_gram, output): Clean up.
971d5158 1301
5edafffd
AD
13022001-12-10 Akim Demaille <akim@epita.fr>
1303
1304 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1305 * src/LR0.c (set_state_table): here.
1306 * src/lalr.c (lalr): Call it.
1307
0279f8e9
AD
13082001-12-10 Akim Demaille <akim@epita.fr>
1309
1310 * src/state.h (shifts): Remove the `number' member: shifts are
1311 attached to state, hence no longer need to be labelled with a
1312 state number.
1313
190c4f5f
AD
13142001-12-10 Akim Demaille <akim@epita.fr>
1315
1316 Now that states have a complete set of members, the linked list of
1317 shifts is useless: just fill directly the state's shifts member.
1318
1319 * src/state.h (shifts): Remove the `next' member.
1320 * src/LR0.c (first_state, last_state): Remove.
1321 Adjust the callers.
1322 (augment_automaton): Don't look for the shifts that must be added
1323 a shift on EOF: it is those of the state we looked for! But now,
1324 since shifts are attached, it is no longer needed to looking
1325 merely by its id: its number.
1326
2a73b93d
AD
13272001-12-10 Akim Demaille <akim@epita.fr>
1328
1329 * src/LR0.c (augment_automaton): Better variable locality.
1330 Remove an impossible branch: if there is a state corresponding to
1331 the start symbol being shifted, then there is shift for the start
1332 symbol from the initial state.
1333
74392f6a
AD
13342001-12-10 Akim Demaille <akim@epita.fr>
1335
1336 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1337 only when appropriate: when insert_start_shifting_state' is not
1338 invoked.
1339 * tests/regression.at (Rule Line Numbers): Adjust.
1340
37c82725
AD
13412001-12-10 Akim Demaille <akim@epita.fr>
1342
1343 * src/LR0.c (augment_automaton): Now that all states have shifts,
1344 merge the two cases addition shifts to the initial state.
1345
6a164e0c
AD
13462001-12-10 Akim Demaille <akim@epita.fr>
1347
1348 * src/lalr.c (set_state_table): Move to...
1349 * src/LR0.c: here.
1350 * src/lalr.c (lalr): Don't call it...
1351 * src/LR0.c (generate_states): do it.
1352 * src/LR0.h (first_state): Remove, only the table is used.
1353
7215de24
AD
13542001-12-10 Akim Demaille <akim@epita.fr>
1355
1356 * src/LR0.h (first_shift, first_reduction): Remove.
1357 * src/lalr.c: Don't use first_shift: find shifts through the
1358 states.
1359
80e25d4d
AD
13602001-12-10 Akim Demaille <akim@epita.fr>
1361
1362 * src/LR0.c: Attach shifts to states as soon as they are
1363 computed.
1364 * src/lalr.c (set_state_table): Instead of assigning shifts to
1365 state, just assert that the mapping was properly done.
1366
0ab3728b
AD
13672001-12-10 Akim Demaille <akim@epita.fr>
1368
1369 * src/LR0.c (insert_start_shift): Rename as...
1370 (insert_start_shifting_state): this.
1371 (insert_eof_shifting_state, insert_accepting_state): New.
1372 (augment_automaton): Adjust.
1373 Better locality of the variables.
1374 When looking if the start_symbol is shifted from the initial
1375 state, using `while (... symbol != start_symbol ...)' sounds
1376 better than `while (... symbol < start_symbol ...)': If fail
1377 to see how the order between symbols could be relevant!
1378
78af9bbc
AD
13792001-12-10 Akim Demaille <akim@epita.fr>
1380
1381 * src/getargs.h: Don't declare `spec_name_prefix' and
1382 `spec_file_prefix', declared by src/files.h.
1383 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1384 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1385 * src/output.c (prepare): Adjust.
1386 * src/reader.c (symbols_output): Likewise.
1387 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1388
bdef2a41
AD
13892001-12-10 Akim Demaille <akim@epita.fr>
1390
1391 * src/muscle_tab.c (muscle_init): NULL is a better default than
1392 `"0"'.
1393
3735969c
AD
13942001-12-10 Akim Demaille <akim@epita.fr>
1395
1396 * src/reader.c (reader): Calling symbols_output once is enough.
1397
49701457
AD
13982001-12-10 Akim Demaille <akim@epita.fr>
1399
1400 Now that states have a complete set of members, the linked list of
1401 reductions is useless: just fill directly the state's reductions
1402 member.
1403
1404 * src/state.h (struct reductions): Remove member `number' and
1405 `next'.
1406 * src/LR0.c (first_reduction, last_reduction): Remove.
1407 (save_reductions): Don't link the new reductions, store them in
1408 this_state.
1409 * src/lalr.c (set_state_table): No need to attach reductions to
1410 states, it's already done.
1411 * src/output.c (output_actions): No longer free the shifts, then
1412 the reductions, then the states: free all the states and their
1413 members.
1414
0edad749
AD
14152001-12-10 Akim Demaille <akim@epita.fr>
1416
1417 * src/options.c (OPTN, DRTV, BOTH): New.
1418 (option_table): Use them.
1419
0edad749
AD
1420 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1421 the job of system.h.
1422 * src/options.c: Don't include stdio.h and xalloc.h for the same
1423 reasons.
1424
5449dd0f
AD
14252001-12-10 Akim Demaille <akim@epita.fr>
1426
1427 * src/output.c (output, prepare): Make sure the values of the
1428 muscles `action' and `prologue' are 0-terminated.
1429
a870c567
AD
14302001-12-10 Akim Demaille <akim@epita.fr>
1431
1432 Clean up GCC warnings.
1433
1434 * src/reader.c (copy_action): `buf' is not used.
1435 (parse_skel_decl): Be static.
1436 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1437 * src/options.h (create_long_option_table): Have a real prototype.
1438 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1439 (hash_delete_at): Return const void *.
1440 Adjust casts to preserve the const.
1441
80df8768
AD
14422001-12-10 Akim Demaille <akim@epita.fr>
1443
1444 * configure.in: Require 2.52g.
1445 M4 is not needed, but AUTOM4TE is.
1446 * m4/m4.m4: Remove.
1447 * tests/Makefile.am: Adjust.
1448
f693ad14
AD
14492001-12-10 Akim Demaille <akim@epita.fr>
1450
1451 One structure for states is enough, even though theoretically
1452 there are LR(0) states and LALR(1) states.
1453
1454 * src/lalr.h (state_t): Remove.
1455 (state_table): Be state_t **, not state_t *.
1456 * src/state.h (core, CORE_ALLOC): Rename as...
1457 (state_t, STATE_ALLOC): this.
1458 Add the LALR(1) members: shifts, reductions, errs.
1459 * src/LR0.c (state_table): Rename as...
1460 (state_hash): this, to avoid name clashes with the global
1461 `state_table'.
1462 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1463 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1464
74ffbcb6
AD
14652001-12-10 Akim Demaille <akim@epita.fr>
1466
1467 Bison dumps core on bash.y.
1468 Reported by Pascal Bart.
1469
1470 * src/warshall.c (bitmatrix_print): New.
1471 (TC): Use it.
1472 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1473 j must be the outer loop.
1474 * tests/regression.at (Broken Closure): New.
1475
07708e19
AD
14762001-12-05 Akim Demaille <akim@epita.fr>
1477
1478 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1479 its argument.
1480