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