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