]> git.saurik.com Git - bison.git/blame - ChangeLog
Use Gettext 0.11.1.
[bison.git] / ChangeLog
CommitLineData
9208d17f
AD
12002-03-14 Akim Demaille <akim@epita.fr>
2
3 Use Gettext 0.11.1.
4
af27eacb
RA
52002-03-09 Robert Anisko <robert@lrde.epita.fr>
6
7 * data/bison.c++: Make the user able to add members to the generated
8 parser by subclassing.
9
9101a310
RA
102002-03-05 Robert Anisko <robert@lrde.epita.fr>
11
12 * src/reader.c (read_additionnal_code): `c' should be an integer, not
13 a character.
14 Reported by Nicolas Tisserand and Nicolas Burrus.
15
fff9bf0b
RA
162002-03-04 Robert Anisko <robert@lrde.epita.fr>
17
18 * src/reader.c: Warn about lacking semi-colons, do not complain.
19
64dba31e
RA
202002-03-04 Robert Anisko <robert@lrde.epita.fr>
21
22 * data/bison.c++: Remove a debug line.
23
374f5a14
RA
242002-03-04 Robert Anisko <robert@lrde.epita.fr>
25
26 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
27 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
28 provide a default implementation.
29
bfcf1f3a
AD
302002-03-04 Akim Demaille <akim@epita.fr>
31
32 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
33 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
34 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
35 * tests/semantic.at (Parsing Guards): Similarly.
36 * src/reader.at (readgram): Complain if the last rule is not ended
37 with a semi-colon.
38
65ccf9fc
AD
392002-03-04 Akim Demaille <akim@epita.fr>
40
41 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
42 * src/closure.c: here.
43 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
44 RTC.
45 * src/warshall.h, src/warshall.c: Remove.
46 * tests/sets.at (Broken Closure): Adjust.
47
d0039cbc
AD
482002-03-04 Akim Demaille <akim@epita.fr>
49
50 * src/output.c (output_skeleton): tempdir is const.
51 bytes_read is unused.
52
345cea78
AD
532002-03-04 Akim Demaille <akim@epita.fr>
54
55 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
56 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
57 Update.
58 From Michael Hayes.
59
564801f7
AD
602002-03-04 Akim Demaille <akim@epita.fr>
61
62 * src/closure.c (closure): `r' is unused.
63
e5352bc7
AD
642002-03-04 Akim Demaille <akim@epita.fr>
65
66 * tests/sets.at (Broken Closure): Add the ending `;'.
67 * src/reader.at (readgram): Complain if a rule is not ended with a
68 semi-colon.
69
914feea9
AD
702002-03-04 Akim Demaille <akim@epita.fr>
71
72 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
73 (count_sr_conflicts): Use bitset_count.
74 * src/reduce.c (inaccessable_symbols): Ditto.
75 (bits_size): Remove.
76 * src/warshall.h, src/warshall.c: Convert to bitsetv.
77
f0250de6
AD
782002-03-04 Akim Demaille <akim@epita.fr>
79
80 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
81 * src/reduce.c: Remove the `bitset_zero's following the
82 `bitset_create's, as now it is performed by the latter.
83
ef017502
AD
842002-03-04 Akim Demaille <akim@epita.fr>
85
86 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
87 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
88 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
89 latest sources from Michael.
90
76514394
AD
912002-03-04 Akim Demaille <akim@epita.fr>
92
93 * src/output.c (output): Don't free the grammar.
94 * src/reader.c (grammar_free): New.
95 * src/main.c (main): Call it and don't free symtab here.
96
55024580
AD
972002-03-04 Akim Demaille <akim@epita.fr>
98
99 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
100 before returning.
101 Reported by Benoit Perrot.
102
f9abaa2c
AD
1032002-03-04 Akim Demaille <akim@epita.fr>
104
105 Use bitset operations when possible, not loops over bits.
106
107 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
108 bitset_or.
109 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
110 * src/reduce.c (useless_nonterminals): Formatting changes.
111 * src/warshall.c (TC): Use bitset_or.
112
0e721e75
AD
1132002-03-04 Akim Demaille <akim@epita.fr>
114
115 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
116 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
117 Ditto.
118
0fb1ffb1
AD
1192002-03-04 Akim Demaille <akim@epita.fr>
120
121 * src/lalr.c (F): Now a bitset*.
122 Adjust all dependencies.
123
b86796bf
AD
1242002-03-04 Akim Demaille <akim@epita.fr>
125
126 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
127 Adjust all dependencies.
128
602bbf31
AD
1292002-03-04 Akim Demaille <akim@epita.fr>
130
131 * src/L0.c, src/LR0.h (nstates): Be size_t.
132 Adjust comparisons (signed vs unsigned).
133 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
134 bitset*.
135 Adjust all dependencies.
136
d8a0245c
AD
1372002-03-04 Akim Demaille <akim@epita.fr>
138
139 * src/closure.c (firsts): Now, also a bitset.
140 Adjust all dependencies.
141 (varsetsize): Remove, now unused.
142 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
143
34ba9743
AD
1442002-03-04 Akim Demaille <akim@epita.fr>
145
146 * src/print.c: Convert to use bitset.h, not hand coded iterations
147 over ints.
148
ed86e78c
AD
1492002-03-04 Akim Demaille <akim@epita.fr>
150
151 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
152
dfdb1797
AD
1532002-03-04 Akim Demaille <akim@epita.fr>
154
155 * src/closure.c (ruleset): Be a bitset.
156 (rulesetsize): Remove.
157
7086e707
AD
1582002-03-04 Akim Demaille <akim@epita.fr>
159
160 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
161 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
162 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
163 * src/closure.c (fderives): Be an array of bitsets.
164
98254360
RA
1652002-02-28 Robert Anisko <robert@lrde.epita.fr>
166
167 * data/bison.c++: Merge the two generated headers. Insert a copyright
168 notice in each output file.
169
a75c057f
AD
1702002-02-28 Akim Demaille <akim@epita.fr>
171
172 * data/bison.c++: Copy the prologue of bison.simple to fetch
173 useful M4 definitions, such as b4_header_guard.
174
06b00abc
AD
1752002-02-25 Akim Demaille <akim@epita.fr>
176
177 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
178 translator friendly scheme for the bgr
179 copyright notice.
06b00abc 180
70e7d534
AD
1812002-02-25 Akim Demaille <akim@epita.fr>
182
183 * src/output.c (header_output): Remove, now handled completely via
184 M4.
185
abe017f6
AD
1862002-02-25 Akim Demaille <akim@epita.fr>
187
188 * m4/m4.m4: New, from CVS Autoconf.
189 * configure.in: Invoke it.
190 * src/output.c (output_skeleton): Use its result instead of the
191 hard coded name.
192
381fb12e
AD
1932002-02-25 Akim Demaille <akim@epita.fr>
194
195 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
196 Fileutils 4.1.5.
197 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
198 * src/output.c (output_skeleton): Use mkstemp to create a real
199 temporary file.
200 Move the filling of `skeleton' and its muscle to...
201 (prepare): here.
202 (output): Move the definition of the prologue muscle to...
203 (prepare): here.
204 * src/system.h (DEFAULT_TMPDIR): New.
205
6f38107f
PE
2062002-02-14 Paul Eggert <eggert@twinsun.com>
207
208 Remove the support for C++ namespace cleanliness; it was
209 causing more problems than it was curing, since it didn't work
210 properly on some nonstandard C++ compilers. This can wait
211 for a proper C++ parser.
212
213 * NEWS: Document this.
214 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
215 of C++, as it's treated like C now.
216 * src/bison.simple (YYSTD): Remove.
217 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
218 Treat C++ just like Standard C instead of trying to support
219 namespace cleanliness.
220
80cce3da
AD
2212002-02-14 Akim Demaille <akim@epita.fr>
222
223 * tests/regression.at (else): Adjust to Andreas' change.
224
842e8679
AD
2252002-02-14 Akim Demaille <akim@epita.fr>
226
227 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
228
4bda3f10
AD
2292002-02-13 Andreas Schwab <schwab@suse.de>
230
231 * src/output.c (output_rule_data): Don't output NULL, it might
232 not be defined yet.
233
4162fa07 2342002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 235
4162fa07
RA
236 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
237 (Copyright notice): Update.
b418ecd8 238
bd16a5dc
AD
2392002-02-11 Akim Demaille <akim@epita.fr>
240
241 * tests/regression.at (%nonassoc and eof): Don't include
242 nonportable headers.
243
8d69a1a3
RA
2442002-02-08 Robert Anisko <robert@lrde.epita.fr>
245
246 * data/bison.c++: Correct error recovery. Make the user able to
247 initialize the starting location.
248
9b2d0677
AD
2492002-02-07 Akim Demaille <akim@epita.fr>
250
251 * tests/input.at: New.
252
69e2658b
RA
2532002-02-07 Robert Anisko <robert@lrde.epita.fr>
254
255 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 256 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
257 directives around tables only needed for debugging.
258
4aacc3a7
RA
2592002-02-07 Robert Anisko <robert@lrde.epita.fr>
260
261 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
262 C++ parsers.
263 (yy::b4_name::parse): Use print_.
264
762a801e
RA
2652002-02-07 Robert Anisko <robert@lrde.epita.fr>
266
267 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
268
4bb2bc3f
RA
2692002-02-07 Robert Anisko <robert@lrde.epita.fr>
270
271 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
272 C++ parsers.
273 (yy::b4_name::parse): Build verbose error messages, and use error_.
274
6b45a3ca
RA
2752002-02-06 Robert Anisko <robert@lrde.epita.fr>
276
277 * data/bison.c++: Fix m4 quoting in comments.
278
50997c6e
RA
2792002-02-06 Robert Anisko <robert@lrde.epita.fr>
280
281 * data/bison.c++: Adjust the parser code. Fix some muscles that were
282 not expanded by m4.
283
3f3eed27
AD
2842002-02-05 Akim Demaille <akim@epita.fr>
285
286 * data/bison.c++: Adjust to the M4 back end.
287 More is certainly needed.
288
be2a1a68
AD
2892002-02-05 Akim Demaille <akim@epita.fr>
290
291 Give a try to M4 as a back end.
292
293 * lib/readpipe.c: New, from wdiff.
294 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
295 BISON_HAIRY.
296 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
297 specific values. Now it is m4 that performs the lookup.
298 * src/parse-skel.y: Remove.
299 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
300 * src/output.c (actions_output, guards_output)
301 (token_definitions_output): No longer keeps track of the output
302 line number, hence remove the second argument.
303 (guards_output): Check against the guard member of a rule, not the
304 action member.
305 Adjust callers.
306 (output_skeleton): Don't look for the skeleton location, let m4 do
307 that.
308 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
309 file will be used.
310 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
311 (prepare): Given that for the time being changesyntax is not
312 usable in M4, rename the muscles using `-' to `_'.
313 Define `defines_flag', `output_parser_name' and `output_header_name'.
314 * src/output.h (actions_output, guards_output)
315 (token_definitions_output): Adjust prototypes.
316 * src/scan-skel.l: Instead of scanning the skeletons, it now
317 processes the output of m4: `__oline__' and `#output'.
318 * data/bison.simple: Adjust to be used by M4(sugar).
319 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
320 to date.
321 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
322 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
323 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
324 shamelessly stolen from CVS Autoconf.
325
beda758b
AD
3262002-02-05 Akim Demaille <akim@epita.fr>
327
328 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
329 * configure.in: Check for the declarations of free and malloc.
330 * src/muscle_tab.c: Adjust.
331
5ece6d43
AD
3322002-02-05 Akim Demaille <akim@epita.fr>
333
334 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
335 which have no values.
336
5bb18f9a
AD
3372002-02-05 Akim Demaille <akim@epita.fr>
338
339 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
340 * data/: here.
341
894dd62e
PE
3422002-01-29 Paul Eggert <eggert@twinsun.com>
343
344 * src/bison.simple (YYSIZE_T): Do not define merely because
345 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
346 On some platforms, <alloca.h> does not declare YYSTD (size_t).
347
82841af7
AD
3482002-01-27 Akim Demaille <akim@epita.fr>
349
350 Fix `%nonassoc and eof'.
351
352 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
353 which were not properly copied! Replace
354 memcpy (res->errs, src->errs, src->nerrs);
355 with
356 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
357 !!!
358 * tests/regression.at (%nonassoc and eof): Adjust to newest
359 Autotest: `.' is not in the PATH.
360
318b76e9
AD
3612002-01-27 Akim Demaille <akim@epita.fr>
362
363 * tests/sets.at (AT_EXTRACT_SETS): New.
364 (Nullable): Use it.
365 (Firsts): New.
366
30d2f3d5
AD
3672002-01-26 Akim Demaille <akim@epita.fr>
368
369 * tests/actions.at, tests/calc.at, tests/headers.at,
370 * tests/torture.at: Adjust to the newest Autotest which no longer
371 forces `.' in the PATH.
372
30f8c395
AD
3732002-01-25 Akim Demaille <akim@epita.fr>
374
375 * tests/regression.at (%nonassoc and eof): New.
376 Suggested by Robert Anisko.
377
29ae55f1
AD
3782002-01-24 Akim Demaille <akim@epita.fr>
379
380 Bison dumps core when trying to complain about broken input files.
381 Reported by Cris van Pelt.
382
383 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
384 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
385 into...
386 (Invalid inputs): Strengthen: exercise parse_percent_token.
387
2b548aa6
RA
3882002-01-24 Robert Anisko <robert.anisko@epita.fr>
389
390 * src/Makefile.am: Add bison.c++.
391 * src/bison.c++: New skeleton.
392
bb0146c2
AD
3932002-01-21 Paolo Bonzini <bonzini@gnu.org>
394
395 * po/it.po: New.
396
bec30531
AD
3972002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
398
399 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
400
fc6edc45
MA
4012002-01-20 Marc Autret <marc@gnu.org>
402
403 * src/files.c (compute_output_file_names): Fix
404
5e5d5415
MA
4052002-01-20 Marc Autret <marc@gnu.org>
406
407 * tests/output.at: New test.
408 * src/files.c (compute_base_names): Don't map extensions when
409 the YACC flag is set, use defaults.
410 Reported by Evgeny Stambulchik.
411
44ea3fbd
MA
4122002-01-20 Marc Autret <marc@gnu.org>
413
bb0146c2 414 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
415 compilers as well (i.e. the vendor C compiler).
416 Suggested by Albert Chin-A-Young.
417
338963d1
TVH
4182002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
419
420 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
421 canonical definition.
422 * src/system.h: Use the canonical definition for PARAMS (avoids
423 a conflict with the macro from lib/hash.h).
424
c57b2479
AD
4252002-01-11 Akim Demaille <akim@epita.fr>
426
427 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 428 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 429
b85810ae
AD
4302002-01-09 Akim Demaille <akim@epita.fr>
431
432 * src/files.c, src/files.h (output_infix): New.
433 (tab_extension): Remove.
434 (compute_base_names): Compute the former, drop the latter.
435 * src/output.c (prepare): Insert the muscles `output-infix', and
436 `output-suffix'.
437 * src/parse-skel.y (string, string.1): New.
438 (section.header): Use it.
439 (section.yacc): Remove.
440 (prefix): Remove too.
441 * src/scan-skel.l: Adjust.
442 * src/bison.simple, src/bison.hairy: Adjust.
443
cae60122
AD
4442002-01-09 Akim Demaille <akim@epita.fr>
445
446 * configure.in (WERROR_CFLAGS): Compute it.
447 * src/Makefile.am (CFLAGS): Pass it.
448 * tests/atlocal.in (CFLAGS): Idem.
449 * src/files.c: Fix a few warnings.
450 (get_extension_index): Remove, unused.
451
ae404801
AD
4522002-01-08 Akim Demaille <akim@epita.fr>
453
454 * src/getargs.c (AS_FILE_NAME): New.
455 (getargs): Use it to convert DOSish file names.
456 * src/files.c (base_name): Rename as full_base_name to avoid
457 clashes with `base_name ()'.
458 (filename_split): New.
459 (compute_base_names): N-th rewrite, using filename_split.
460
22312b71
AD
4612002-01-08 Akim Demaille <akim@epita.fr>
462
463 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
464 New, stolen from the Fileutils 4.1.
465 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
466 * configure.in: Check for the presence of memrchr, and of its
467 prototype.
468
a67cef01
TVH
4692002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
470
471 * lib/hash.h (__P): Added definition for this macro.
472 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
473 BUILT_SOURCES, to ensure they are generated first.
474 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
475 %error-verbose to allow bootstrapping with bison 1.30x.
476
2b25d624
AD
4772002-01-06 Akim Demaille <akim@epita.fr>
478
479 * src/reader.c (parse_braces): Don't fetch the next char, the
480 convention is to fetch on entry.
481 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
482 'switch' without a following semicolon.
483 * tests/regression.at (braces parsing): New.
484
3460813b
AD
4852002-01-06 Akim Demaille <akim@epita.fr>
486
487 Bison is dead wrong in its RR conflict reports.
488
489 * tests/torture.at (GNU Cim Grammar): New.
490 * src/conflicts.c (count_rr_conflicts): Fix.
491
73784c64
AD
4922002-01-06 Akim Demaille <akim@epita.fr>
493
494 Creating package.m4 from configure.ac causes too many problems.
495
496 * tests/Makefile.am (package.m4): Create it by hand,
497 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
498
25d81090
AD
4992002-01-06 Akim Demaille <akim@epita.fr>
500
501 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
502 skeleton.h.
503
a9b8959e
PE
5042002-01-04 Paul Eggert <eggert@twinsun.com>
505
506 * doc/bison.texinfo (Debugging):
507 Remove YYSTDERR; it's no longer defined or used.
508 Also, s/cstdio.h/cstdio/.
509
25d81090
AD
5102002-01-03 Akim Demaille <akim@epita.fr>
511
512 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
513
1109455c
AD
5142002-01-03 Akim Demaille <akim@epita.fr>
515
516 * src/parse-skel.y (process_skeleton): Don't bind the parser's
517 tracing code to --trace, wait for a better --trace option, with
518 args.
519
7ea5e977
AD
5202002-01-03 Akim Demaille <akim@epita.fr>
521
522 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
523 The ISO C++ standard is extremely clear about it: stderr is
524 considered a macro, not a regular symbol (see table 94 `Header
525 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
526 Therefore std:: does not apply to it. It still does with fprintf.
527 Also, s/cstdio.h/cstdio/.
528
fab5b110
AD
5292002-01-03 Akim Demaille <akim@epita.fr>
530
531 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
532 for non system headers.
533
aed7fd9b
AD
5342002-01-02 Akim Demaille <akim@epita.fr>
535
536 Equip the skeleton chain with location tracking, runtime trace,
537 pure parser and scanner.
538
539 * src/parse-skel.y: Request a pure parser, locations, and prefix
540 renaming.
541 (%union): Having several members with the same type does not help
542 type mismatches, simplify.
543 (YYPRINT, yyprint): New.
544 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
545 (skel_error): this.
546 Handle locations.
547 * src/scan-skel.l: Adjust to these changes.
548 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
549 (LOCATION_PRINT, skel_control_t): New.
550
24fad99e
AD
5512001-12-30 Akim Demaille <akim@epita.fr>
552
553 * src/parse-skel.y: Get rid of the shift/reduce conflict:
554 replace `gb' with BLANKS.
555 * src/scan-skel.l: Adjust.
556
a4b36db4
AD
5572001-12-30 Akim Demaille <akim@epita.fr>
558
559 * src/system.h: We don't need nor want bcopy.
560 Throw away MS-DOS crap: we don't need getpid.
561 * configure.in: We don't need strndup. It was even causing
562 problems: because Flex includes the headers *before* us,
563 _GNU_SOURCE is not defined by config.h, and therefore strndup was
564 not visible.
565 * lib/xstrndup.c: New.
566 * src/scan-skel.l: Use it.
567 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
568 * src/parse-skel.y: Use %directives instead of #defines.
569
1239777d
AD
5702001-12-30 Akim Demaille <akim@epita.fr>
571
572 * src/skeleton.h: New.
573 * src/output.c (output_parser, output_master_parser): Remove, dead
574 code.
575 * src/output.h (get_lines_number, actions_output, guards_output)
576 (token_definitions_output): Prototype them.
577 * src/parse-skel.y: Add the license notice.
578 Include output.h and skeleton.h.
579 (process_skeleton): Returns void, and takes a single parameter.
580 * src/scan-skel.l: Add the license notice.
581 Include skeleton.h.
582 Don't use %option yylineno: it seems that then Flex imagines
583 REJECT has been used, and therefore it won't reallocate its
584 buffers (which makes no other sense to me than a bug). It results
585 in warnings for `unused: yy_flex_realloc'.
586
9b3add5b
RA
5872001-12-30 Robert Anisko <robert.anisko@epita.fr>
588
589 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
590 (MUSCLE_INSERT_PREFIX): ...to there.
591 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
592 (MUSCLE_INSERT_PREFIX): Move from here...
593
594 * src/bison.hairy: Add a section directive. Put braces around muscle
595 names. This parser skeleton is still broken, but Bison should not
596 choke on a bad muscle 'syntax'.
597 * src/bison.simple: Add a section directive. Put braces around muscle
598 names.
599
600 * src/files.h (strsuffix, stringappend): Add declarations.
601 (tab_extension): Add declaration.
602 (short_base_name): Add declaration.
603
604 * src/files.c (strsuffix, stringappend): No longer static. These
605 functions are used in the skeleton parser.
606 (tab_extension): New.
607 (compute_base_names): Use the computations done in this function
fab5b110 608 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
609 names.
610 (short_base_name): No longer static.
611
612 * src/output.c (output_skeleton): New.
613 (output): Disable call to output_master_parser, and give a try to
614 a new skeleton handling system.
615 (guards_output, actions_output): No longer static.
616 (token_definitions_output, get_lines_number): No longer static.
617
618 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
619
fab5b110 620 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
621 parse-skel.y.
622
623 * src/parse-skel.y: New file.
624 * src/scan-skel.l: New file.
625
b5b61c61
AD
6262001-12-29 Akim Demaille <akim@epita.fr>
627
628 %name-prefix is broken.
629
630 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
631 Adjust all dependencies.
632 * tests/headers.at (export YYLTYPE): Strengthen this test: use
633 %name-prefix.
634
635 Renaming yylval but not yylloc is not consistent. Now we do.
636
637 * src/bison.simple: Prefix yylloc if used.
638 * doc/bison.texinfo (Decl Summary): Document that.
639
8c9a50be
AD
6402001-12-29 Akim Demaille <akim@epita.fr>
641
642 * doc/bison.texinfo: Promote `%long-directive' over
643 `%long_directive'.
644 Remove all references to fixed-output-files, yacc is enough.
645
d99361e6
AD
6462001-12-29 Akim Demaille <akim@epita.fr>
647
648 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
649 user prologue. These are defaults.
650 * tests/actions.at (Mid-rule actions): Make sure the user can
651 define YYDEBUG and YYERROR_VERBOSE.
652
b9cecb91
AD
6532001-12-29 Akim Demaille <akim@epita.fr>
654
655 * src/output.c (header_output): Don't forget to export YYLTYPE and
656 yylloc.
657 * tests/headers.at (export YYLTYPE): New, make sure it does.
658 * tests/regression.at (%union and --defines, Invalid CPP headers):
659 Move to...
660 * tests/headers.at: here.
661
aea13e97
AD
6622001-12-29 Akim Demaille <akim@epita.fr>
663
664 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
665
931394cb
AD
6662001-12-29 Akim Demaille <akim@epita.fr>
667
668 * tests/actions.at (Mid-rule actions): Output on a single line
669 instead of several.
670
704a47c4
AD
6712001-12-29 Akim Demaille <akim@epita.fr>
672
673 * doc/bison.texinfo: Formatting changes.
674
091e20bb
AD
6752001-12-29 Akim Demaille <akim@epita.fr>
676
677 Don't store the token defs in a muscle, just be ready to output it
678 on command. Now possible via `symbols'. Fixes a memory leak.
679
680 * src/output.c (token_definitions_output): New.
681 (output_parser, header_output): Use it.
682 * src/reader.c (symbols_save): Remove.
683
cce71710
AD
6842001-12-29 Akim Demaille <akim@epita.fr>
685
686 * src/bison.simple: Do not provide a default for YYSTYPE and
687 YYLTYPE before the user's prologue. Otherwise it's hardly... a
688 default.
689
82c035a8
AD
6902001-12-29 Akim Demaille <akim@epita.fr>
691
692 Mid-rule actions are simply... ignored!
693
694 * src/reader.c (readgram): Be sure to attach mid-rule actions to
695 the empty-rule associated to the dummy symbol, not to the host
696 rule.
697 * tests/actions.at (Mid-rule actions): New.
698
8419d367
AD
6992001-12-29 Akim Demaille <akim@epita.fr>
700
701 Memory leak.
702
703 * src/reader.c (reader): Free grammar.
704
375d5806
AD
7052001-12-29 Akim Demaille <akim@epita.fr>
706
707 Memory leak.
708
709 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
710 since it allocates it for each state, although only one is needed.
711 (allocate_storage): Do it here.
712
f51cb8ff
AD
7132001-12-29 Akim Demaille <akim@epita.fr>
714
715 * src/options.h, src/options.c (create_long_option_table): Rename
716 as...
717 (long_option_table_new): this, with a clearer prototype.
718 (percent_table): Remove, unused,
719 * src/getargs.c (getargs): Adjust.
720
29e88316
AD
7212001-12-29 Akim Demaille <akim@epita.fr>
722
723 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
724 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
725 as states.
726
b9f71f19
AD
7272001-12-29 Akim Demaille <akim@epita.fr>
728
729 * src/lalr.c (build_relations): Rename `states' as `states1'.
730 Sorry, I don't understand exactly what it is, no better name...
731
1a2b5d37
AD
7322001-12-29 Akim Demaille <akim@epita.fr>
733
734 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
735 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
736 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
737 as rules.
738
1cca533e
AD
7392001-12-29 Akim Demaille <akim@epita.fr>
740
741 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
742 ago.
743
c03ae966
AD
7442001-12-29 Akim Demaille <akim@epita.fr>
745
746 * src/reader.c, src/reader.h (user_toknums): Remove.
747 Adjust all users to use symbols[i]->user_token_number.
748
5a670b1e
AD
7492001-12-29 Akim Demaille <akim@epita.fr>
750
751 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
752 Adjust all users to use symbols[i]->prec or ->assoc.
753
ad949da9
AD
7542001-12-29 Akim Demaille <akim@epita.fr>
755
756 * src/reader.c, src/reader.h (tags): Remove.
757 Adjust all users to use symbols[i]->tag.
758
0e78e603
AD
7592001-12-29 Akim Demaille <akim@epita.fr>
760
761 * src/gram.h, src/gram.c (symbols): New, similar to state_table
762 and rule_table.
763 * src/reader.c (packsymbols): Fill this table.
764 Drop sprec.
765 * src/conflicts.c (resolve_sr_conflict): Adjust.
766 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
767 single table.
768 Use symbols[i]->tag instead of tags[i].
769
213e640e
AD
7702001-12-29 Akim Demaille <akim@epita.fr>
771
772 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
773 In addition, put a comment in there, to replace...
774 * tests/regression.at (%union and C comments): Remove.
775
e7b8bef1
AD
7762001-12-29 Akim Demaille <akim@epita.fr>
777
778 * tests/regression.at (Web2c Actions): Blindly move the actual
779 output as expected output. The contents *seem* right to me, but I
780 can't pretend reading perfectly parser tables... Nonetheless, all
781 the other tests pass correctly, the table look OK, even though the
782 presence of `$axiom' is to be noted: AFAICS it is useless (but
783 harmless).
784
b68e7744
AD
7852001-12-29 Akim Demaille <akim@epita.fr>
786
787 * src/reader.c (readgram): Don't add the rule 0 if there were no
788 rules read. In other words, add it _after_ having performed
789 grammar sanity checks.
790 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
791
78d5bae9
AD
7922001-12-29 Akim Demaille <akim@epita.fr>
793
794 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
795 visible, and some states have now a different number.
796
ff442794
AD
7972001-12-29 Akim Demaille <akim@epita.fr>
798
799 * src/reader.c (readgram): Bind the initial rule's lineno to that
800 of the first rule.
801 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
802 (Solved SR Conflicts): Adjust rule 0's line number.
803
610ab194
AD
8042001-12-29 Akim Demaille <akim@epita.fr>
805
806 Fix the `GAWK Grammar' failure.
807
808 * src/LR0.c (final_state): Initialize to -1 so that we do compute
809 the reductions of the first state which was mistakenly confused
810 with the final state because precisely final_state was initialized
811 to 0.
812 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
813 now noticed by Bison.
814 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
815 have a reduction on $default.
816
29d29c8f
AD
8172001-12-29 Akim Demaille <akim@epita.fr>
818
819 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
820 rule line numbers.
821 * src/closure.c (print_closure): Likewise.
822 * src/derives.c (print_derives): Likewise.
823 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
824 now.
825
7c6b64d0
AD
8262001-12-29 Akim Demaille <akim@epita.fr>
827
828 * src/lalr.c (lookaheads_print): New.
829 (lalr): Call it when --trace-flag.
830 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
831 are dumped.
832
3d4daee3
AD
8332001-12-29 Akim Demaille <akim@epita.fr>
834
835 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
836 when walking through ritem, even via rule->rhs.
837 * src/reduce.c (dump_grammar, useful_production, reduce_output)
838 (useful_production, useless_nonterminals): Likewise.
839 (reduce_grammar_tables): Likewise, plus update nritems.
840 * src/nullable.c (set_nullable): Likewise.
841 * src/lalr.c (build_relations): Likewise.
842 * tests/sets.at (Nullable): Adjust.
843 Fortunately, now, the $axiom is no longer nullable.
844
9e7f6bbd
AD
8452001-12-29 Akim Demaille <akim@epita.fr>
846
847 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
848 the 0-sentinel.
849 * src/gram.c (ritem_longest_rhs): Likewise.
850 * src/reduce.c (nonterminals_reduce): Likewise.
851 * src/print_graph.c (print_graph): Likewise.
852 * src/output.c (output_rule_data): Likewise.
853 * src/nullable.c (set_nullable): Likewise.
854
255ef638
AD
8552001-12-29 Akim Demaille <akim@epita.fr>
856
857 * src/output.c: Comment changes.
858
0d8a7363
AD
8592001-12-27 Paul Eggert <eggert@twinsun.com>
860
861 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
862 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
863 Sparc, as they were causing more porting problems than the
864 (minor) performance improvement was worth.
865
866 Also, catch up with 1.31's YYSTD.
867
3db472b9
AD
8682001-12-27 Akim Demaille <akim@epita.fr>
869
870 * src/output.c (output_gram): Rely on nritems, not the
871 0-sentinel. See below.
872 Use -1 as separator, not 0.
873 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
874 Rely on -1 as separator in yyrhs, instead of 0.
875 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
876 twice `Now at end of input', therefore there are two lines less to
877 expect.
878
b365aa05
AD
8792001-12-27 Akim Demaille <akim@epita.fr>
880
881 * tests/regression.at (Unresolved SR Conflicts):
882 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
883 below.
884
30171f79
AD
8852001-12-27 Akim Demaille <akim@epita.fr>
886
887 * src/LR0.c (new_state): Recognize the final state by the fact it
888 is reached by eoftoken.
889 (insert_start_shifting_state, insert_eof_shifting_state)
890 (insert_accepting_state, augment_automaton): Remove, since now
891 these states are automatically computed from the initial state.
892 (generate_states): Adjust.
893 * src/print.c: When reporting a rule number to the user, substract
894 1, so that the axiom rule is rule 0, and the first user rule is 1.
895 * src/reduce.c: Likewise.
896 * src/print_graph.c (print_core): For the time being, just as for
897 the report, depend upon --trace-flags to dump the full set of
898 items.
899 * src/reader.c (readgram): Once the grammar read, insert the rule
900 0: `$axiom: START-SYMBOL $'.
901 * tests/set.at: Adjust: rule 0 is now displayed, and since the
902 number of the states has changed (the final state is no longer
903 necessarily the last), catch up.
904
75142d45
AD
9052001-12-27 Akim Demaille <akim@epita.fr>
906
907 Try to make the use of the eoftoken valid. Given that its value
908 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
909 is used instead of > 0 where appropriate, (ii), depend upon nritems
910 instead of the 0-sentinel.
911
912 * src/gram.h, src/gram.c (nritems): New.
913 Expected to be duplication of nitems, but for the time being...
914 * src/reader.c (packgram): Assert nritems and nitems are equal.
915 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
916 * src/closure.c (print_closure, print_fderives): Likewise.
917 * src/gram.c (ritem_print): Likewise.
918 * src/print.c (print_core, print_grammar): Likewise.
919 * src/print_graph.c: Likewise.
920
b7c49edf
AD
9212001-12-27 Akim Demaille <akim@epita.fr>
922
923 * src/main.c (main): If there are complains after grammar
924 reductions, then output the report anyway if requested, then die.
925 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
926 * src/reader.c (eoftoken): New.
927 (parse_token_decl): If the token being defined has value `0', it
928 is the eoftoken.
929 (packsymbols): No longer hack `tags' to insert `$' by hand.
930 Be sure to preserve the value of the eoftoken.
931 (reader): Make sure eoftoken is defined.
932 Initialize nsyms to 0: now eoftoken is created just like the others.
933 * src/print.c (print_grammar): Don't special case the eof token.
934 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
935 lie anyway, albeit pleasant.
936 * tests/calc.at: Exercise error messages with eoftoken.
937 Change the grammar so that empty input is invalid.
938 Adjust expectations.
939 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
940
ec2da99f
AD
9412001-12-27 Akim Demaille <akim@epita.fr>
942
943 * configure.in: Check the protos of strchr ans strspn.
944 Replace strchr if needed.
945 * src/system.h: Provide the protos of strchr, strspn and memchr if
946 missing.
947 * lib/strchr.c: New.
948 * src/reader.c (symbols_save): Use strchr.
949
8adfa272
AD
9502001-12-27 Akim Demaille <akim@epita.fr>
951
952 * src/print.c, src/print_graph.c (escape): New.
953 Use it to quote the TAGS outputs.
954 * src/print_graph.c (print_state): Now errors are in red, and
955 reductions in green.
956 Prefer high to wide: output the state number on a line of its own.
957
80dac38c
AD
9582001-12-27 Akim Demaille <akim@epita.fr>
959
960 * src/state.h, src/state.c (reductions_new): New.
961 * src/LR0.c (set_state_table): Let all the states have a
962 `reductions', even if reduced to 0.
963 (save_reductions): Adjust.
964 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
965 * src/print.c (print_reductions, print_actions): Adjust.
966 * src/output.c (action_row): Adjust.
967
2cec70b9
AD
9682001-12-27 Akim Demaille <akim@epita.fr>
969
970 * src/state.h, src/state.c (errs_new, errs_dup): New.
971 * src/LR0.c (set_state_table): Let all the states have an errs,
972 even if reduced to 0.
973 * src/print.c (print_errs, print_reductions): Adjust.
974 * src/output.c (output_actions, action_row): Adjust.
975 * src/conflicts.c (resolve_sr_conflict): Adjust.
976
13ca549a
AD
9772001-12-27 Akim Demaille <akim@epita.fr>
978
979 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
980
5092aba5
AD
9812001-12-27 Akim Demaille <akim@epita.fr>
982
983 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
984 * src/print.c: here.
985 (lookaheadset, shiftset): New, used as additional storage by
986 print_reductions.
987 (print_results): Adjust.
988 (print_shifts, print_gotos, print_errs): New, extracted from...
989 (print_actions): here.
990 * src/print_graph.c (print_actions): Remove dead code.
991
11e2beca
AD
9922001-12-27 Akim Demaille <akim@epita.fr>
993
994 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
995 `$n' and `@n'.
996
dac3c910
AD
9972001-12-27 Akim Demaille <akim@epita.fr>
998
999 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1000 (build_relations): Adjust.
1001
d0b0fefa
AD
10022001-12-27 Akim Demaille <akim@epita.fr>
1003
1004 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1005 duplication.
1006
adc8c848
AD
10072001-12-27 Akim Demaille <akim@epita.fr>
1008
1009 * src/reader.c (packgram): Catch nitems overflows.
1010
14d293ac
AD
10112001-12-27 Akim Demaille <akim@epita.fr>
1012
1013 * src/files.c, src/files.h (guard_obstack): Remove.
1014 * src/output.c (output): Adjust.
1015 * src/reader.c (parse_braces): New, factoring...
1016 (copy_action, copy_guard): these two which are renamed as...
1017 (parse_action, parse_guard): these.
1018 As a voluntary consequence, using braces around guards is now
1019 mandatory.
1020
f499b062
AD
10212001-12-27 Akim Demaille <akim@epita.fr>
1022
1023 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1024 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1025 members.
1026 (symbol_list_new): Adjust.
1027 (copy_action): action_line is the first line, not the last.
1028 (copy_guard): Just as for actions, store the `action' only, not
1029 the switch/case/break flesh.
1030 Don't parse the user action that might follow the guard, let...
1031 (readgram): do it, i.e., now, there can be an action after a
1032 guard.
1033 In other words the guard is just explicitly optional.
1034 (packgram): Adjust.
1035 * src/output.c (guards_output): New.
1036 (output_parser): Call it when needed.
1037 (output): Also free the guard and attrs obstacks.
1038 * src/files.c, src/files.h (obstack_save): Remove.
1039 (output_files): Remove.
1040 As a result, if one needs the former `.act' file, using an
1041 appropriate skeleton which requires actions and guards is now
1042 required.
1043 * src/main.c (main): Adjust.
1044 * tests/semantic.at: New.
1045 * tests/regression.at: Use `input.y' as input file name.
1046 Avoid 8+3 problems by requiring input.c when the test needs the
1047 parser.
1048
d945f5cd
AD
10492001-12-27 Akim Demaille <akim@epita.fr>
1050
1051 * src/reader.c (symbol_list_new): Be sure to initialize all the
1052 fields.
1053
d200e455
AD
10542001-12-27 Akim Demaille <akim@epita.fr>
1055
1056 All the hacks using a final pseudo state are now useless.
1057
1058 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1059 * src/lalr.c (nLA): New.
1060 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1061 instead of lookaheadsp from the pseudo state (nstate + 1).
1062
f9507c28
AD
10632001-12-27 Akim Demaille <akim@epita.fr>
1064
1065 * src/output.c (action_row, token_actions): Use a state_t instead
1066 of a integer, and nlookaheads instead of the following state's
1067 lookaheadsp.
1068
065fbd27
AD
10692001-12-27 Akim Demaille <akim@epita.fr>
1070
1071 * src/conflicts.c (log_resolution, flush_shift)
1072 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1073 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1074 (conflicts_print, print_reductions): Use a state_t instead of an
1075 integer when referring to a state.
1076 As much as possible, depend upon nlookaheads, instead of the
1077 `lookaheadsp' member of the following state (since lookaheads of
1078 successive states are successive, the difference between state n + 1
1079 and n served as the number of lookaheads for state n).
1080 * src/lalr.c (add_lookback_edge): Likewise.
1081 * src/print.c (print_core, print_actions, print_state)
1082 (print_results): Likewise.
1083 * src/print_graph.c (print_core, print_actions, print_state)
1084 (print_graph): Likewise.
1085 * src/conflicts.h: Adjust.
1086
1b177bd7
AD
10872001-12-27 Akim Demaille <akim@epita.fr>
1088
1089 * src/bison.hairy: Formatting/comment changes.
1090 ANSIfy.
1091 Remove `register' indications.
1092 Add plenty of `static'.
1093
7742ddeb
AD
10942001-12-27 Akim Demaille <akim@epita.fr>
1095
1096 * src/output.c (prepare): Drop the muscle `ntbase' which
1097 duplicates ntokens.
1098 * src/bison.simple: Formatting/comment changes.
1099 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1100 is an undocumented synonym.
1101
1fa14068
AD
11022001-12-22 Akim Demaille <akim@epita.fr>
1103
1104 * src/output.c (output_table_data): Change the prototype to use
1105 `int' for array ranges: some invocations do pass an int, not a
1106 short.
1107 Reported by Wayne Green.
1108
b9752825
AD
11092001-12-22 Akim Demaille <akim@epita.fr>
1110
1111 Some actions of web2c.y are improperly triggered.
1112 Reported by Mike Castle.
1113
1114 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1115 * tests/regression.at (Web2c): Rename as...
1116 (Web2c Report): this.
1117 (Web2c Actions): New.
1118
776209d6
AD
11192001-12-22 Akim Demaille <akim@epita.fr>
1120
1121 Reductions in web2c.y are improperly reported.
1122 Reported by Mike Castle.
1123
1124 * src/conflicts.c (print_reductions): Fix.
1125 * tests/regression.at (Web2c): New.
1126
275fc3ad
AD
11272001-12-18 Akim Demaille <akim@epita.fr>
1128
1129 Some host fail on `assert (!"foo")', which expands to
1130 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1131 Reported by Nelson Beebee.
1132
1133 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1134 `#define it_succeeded 0' and `assert (it_succeeded)'.
1135
897668ee
MA
11362001-12-17 Marc Autret <autret_m@epita.fr>
1137
1138 * src/bison.simple: Don't hard code the skeleton line and filename.
1139 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1140 New line counter 'skeleton_line' (skeleton-line muscle).
1141
ab3399e0
PE
11422001-12-17 Paul Eggert <eggert@twinsun.com>
1143
1144 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1145 YYDEBUG must be defined to a nonzero value.
1146
1147 * src/bison.simple (yytname): Do not assume that the user defines
1148 YYDEBUG to a properly parenthesized expression.
1149
3877f72b
AD
11502001-12-17 Akim Demaille <akim@epita.fr>
1151
1152 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1153 nlookaheads is a new member.
1154 Adjust all users.
1155 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1156 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1157 state.
776209d6 1158
331dbc1b
AD
11592001-12-17 Akim Demaille <akim@epita.fr>
1160
1161 * src/files.h, src/files.c (open_files, close_files): Remove.
1162 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1163 let...
1164 * src/reader.c (reader): Do it.
776209d6 1165
be750e4c
AD
11662001-12-17 Akim Demaille <akim@epita.fr>
1167
1168 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1169
709ae8c6
AD
11702001-12-17 Akim Demaille <akim@epita.fr>
1171
1172 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1173 (flush_reduce): New.
1174 (resolve_sr_conflict): Adjust.
776209d6 1175
f87685c3
AD
11762001-12-17 Akim Demaille <akim@epita.fr>
1177
1178 * src/output.c (output_obstack): Be static and rename as...
1179 (format_obstack): this, to avoid any confusion with files.c's
1180 output_obstack.
1181 * src/reader.h (muscle_obstack): Move to...
1182 * src/output.h: here, since it's defined in output.c.
1183
837491d8
AD
11842001-12-17 Akim Demaille <akim@epita.fr>
1185
1186 * src/output.c (action_row, save_column, default_goto)
1187 (sort_actions, matching_state, pack_vector): Better variable
1188 locality.
1189
796d61fb
AD
11902001-12-17 Akim Demaille <akim@epita.fr>
1191
1192 * src/output.c: Various formatting changes.
776209d6 1193
64d15509
AD
11942001-12-17 Akim Demaille <akim@epita.fr>
1195
1196 * src/files.c (output_files): Free the output_obstack.
1197 * src/main.c (main): Call print and print_graph conditionally.
1198 * src/print.c (print): Work unconditionally.
1199 * src/print_graph.c (print_graph): Work unconditionally.
1200 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1201
fbc8ecb7
MA
12022001-12-16 Marc Autret <autret_m@epita.fr>
1203
1204 * src/output.c (actions_output): Fix. When we use %no-lines,
1205 there is one less line per action.
1206
f0440388
MA
12072001-12-16 Marc Autret <autret_m@epita.fr>
1208
1209 * src/bison.simple: Remove a useless #line directive.
1210 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1211 * src/output.c (get_lines_number): New.
776209d6 1212 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1213 output muscles.
1214 Fix line numbering.
1215 (actions_output): Computes the number of lines taken by actions.
1216 (output_master_parser): Insert new skeleton which is the name of
1217 the output parser file name.
1218
a79986b8
MA
12192001-12-15 Marc Autret <autret_m@epita.fr>
1220
1221 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1222
4ec8e00f
MA
12232001-12-15 Marc Autret <autret_m@epita.fr>
1224
1225 * src/output.c (output_gram): Keep track of the hairy one.
1226
1a4648ff
AD
12272001-12-15 Akim Demaille <akim@epita.fr>
1228
1229 Make `make distcheck' work.
1230
1231 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1232 system.h which uses libgettext.h.
1233
9c2c67e6
AD
12342001-12-15 Akim Demaille <akim@epita.fr>
1235
1236 * src/nullable.c (set_nullable): Useless rules must be skipped,
1237 otherwise, since we range over their symbols, we might look at a
1238 nonterminal which no longer ``exists'', i.e., it is not counted in
1239 `nvars', hence we overflow our arrays.
1240
93ede233
AD
12412001-12-15 Akim Demaille <akim@epita.fr>
1242
1243 The header can also be produced directly, without any obstack!
1244 Yahoo!
1245
1246 * src/files.c, src/files.h (defines_obstack): Remove.
1247 (compute_header_macro): Global.
1248 (defines_obstack_save): Remove.
1249 * src/reader.c (parse_union_decl): No longer output to
1250 defines_obstack: its content can be found in the `stype' muscle
1251 anyway.
1252 (output_token_translations): Merge into...
1253 (symbols_output): this.
1254 Rename as...
1255 (symbols_save): this.
1256 (reader): Adjust.
1257 * src/output.c (header_output): New.
1258 (output): Call it.
1259
2666f928
AD
12602001-12-15 Akim Demaille <akim@epita.fr>
1261
1262 * src/reader.c (parse_union_decl): Instead of handling two obstack
1263 simultaneously, use one to define the `stype' muscle, and use the
1264 value of the latter to fill defines_obstack.
1265 (copy_comment): Remove.
1266 (copy_comment2): Work for a single obstack.
1267 Rename as...
1268 (copy_comment): this.
1269
428046f8
AD
12702001-12-15 Akim Demaille <akim@epita.fr>
1271
1272 * src/lex.c, src/lex.h (xgetc): No longer static.
1273 * src/reader.c (parse_union_decl): Revamp.
1274
ea52d706
AD
12752001-12-15 Akim Demaille <akim@epita.fr>
1276
1277 Still making progress in separating Bison into (i) input, (ii)
1278 process, (iii) output: now we can directly output the parser file
1279 without using table_obstack at all.
1280
1281 * src/files.c, src/files.h (table_obstack): Bye bye.
1282 (parser_file_name): New.
1283 * src/files.c (compute_output_file_names): Compute it.
1284 * src/output.c (actions_output, output_parser)
1285 (output_master_parser): To a file instead of an obstack.
1286
3f96f4dc
AD
12872001-12-15 Akim Demaille <akim@epita.fr>
1288
1289 Attach actions to rules, instead of pre-outputting them to
1290 actions_obstack.
1291
1292 * src/gram.h (rule_t): action and action_line are new members.
1293 * src/reader.c (symbol_list): Likewise.
1294 (copy_action): Save the actions within the rule.
1295 (packgram): Save them in rule_table.
1296 * src/output.c (actions_output): New.
1297 (output_parser): Use it on `%%actions'.
1298 (output_rule_data): Don't free rule_table.
1299 (output): Do it.
1300 (prepare): Don't save the `action' muscle.
1301 * src/bison.simple: s/%%action/%%actions/.
1302
51576fb3
AD
13032001-12-15 Akim Demaille <akim@epita.fr>
1304
1305 * src/reader.c (copy_action): When --yacc, don't append a `;'
1306 to the user action: let it fail if lacking.
dee049eb 1307 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1308
2648a72d
AD
13092001-12-14 Akim Demaille <akim@epita.fr>
1310
1311 * src/lex.c (literalchar): Simply return the char you decoded, non
1312 longer mess around with obstacks and int pointers.
1313 Adjust all callers.
1314
92790e5b
AD
13152001-12-14 Akim Demaille <akim@epita.fr>
1316
1317 * src/lex.c (literalchar): Don't escape the special characters,
1318 just decode them, and keep them as char (before, eol was output as
1319 the 2 char string `\n' etc.).
1320 * src/output.c (output_rule_data): Use quotearg to output the
1321 token strings.
1322
927c1557
PE
13232001-12-13 Paul Eggert <eggert@twinsun.com>
1324
1325 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1326 Do not infringe on the global user namespace when using C++.
1327 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1328 All uses of `fprintf' and `stderr' changed.
1329
1330 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1331
ed8e1f68
AD
13322001-12-13 Akim Demaille <akim@epita.fr>
1333
1334 The computation of nullable is broken: it doesn't handle empty
1335 RHS's properly.
1336
1337 * tests/torture.at (GNU AWK Grammar): New.
1338 * tests/sets.at (Nullable): New.
1339 * src/nullable.c (set_nullable): Instead of blindly looping over
1340 `ritems', loop over the rules, and then over their rhs's.
1341
1342 Work around Autotest bugs.
1343
1344 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1345 frame, because Autotest understand lines starting with a `+' as
1346 traces from the shell. Then, they are not processed properly.
1347 Admittedly an Autotest bug, but we don't have time to wait for
1348 Autotest to catch up.
1349 * tests/regression.at (Broken Closure): Adjust to the new table
1350 frames.
1351 Move to...
1352 * tests/sets.at: here.
1353
cb581495
AD
13542001-12-13 Akim Demaille <akim@epita.fr>
1355
1356 * src/closure.c (closure): Use nrules instead of playing tricks
1357 with BITS_PER_WORD.
1358
2e729273
AD
13592001-12-13 Akim Demaille <akim@epita.fr>
1360
1361 * src/print.c (print_actions): Output the handling of `$' as the
1362 traces do: shifting the token EOF. Before EOF was treated as a
1363 nonterminal.
1364 * tests/regression.at: Adjust some tests.
1365 * src/print_graph.c (print_core): Complete the set of items via
1366 closure. The next-to-final and final states are still unsatisfying,
1367 but that's to be addressed elsewhere.
1368 No longer output the rule numbers, but do output the state number.
1369 A single loop for the shifts + gotos is enough, but picked a
1370 distinct color for each.
1371 (print_graph): Initialize and finalize closure.
1372
107f7dfb
AD
13732001-12-13 Akim Demaille <akim@epita.fr>
1374
1375 * src/reader.c (readgram): Remove dead code, an strip useless
1376 braces.
1377 (get_type): Remove, unused.
1378
9b53a24f
AD
13792001-12-12 Akim Demaille <akim@epita.fr>
1380
1381 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1382 on that of lib/error.c.
1383
dbfb6dcd
AD
13842001-12-12 Akim Demaille <akim@epita.fr>
1385
1386 Some hosts don't like `/' in includes.
1387
1388 * src/system.h: Include libgettext.h without qualifying the path.
1389 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1390 $(top_srcdir).
1391
c25fb648
MA
13922001-12-11 Marc Autret <autret_m@epita.fr>
1393
1394 * src/output.c (output_parser): Remove useless muscle.
1395
710ddc4f
MA
13962001-12-11 Marc Autret <autret_m@epita.fr>
1397
1398 * src/bison.simple: Remove #line just before %%epilogue. It
1399 is now handled in ...
1400 * src/reader.c (read_additionnal_code): Add the output of a
1401 #line for the epilogue.
1402
e83d80b8
MA
14032001-12-10 Marc Autret <autret_m@epita.fr>
1404
927c1557 1405 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1406 replace precedent remove.
1407 * src/bison.simple: Remove #line before %%prologue because
1408 %%input-line is wrong at this time.
1409
971d5158
MA
14102001-12-10 Marc Autret <autret_m@epita.fr>
1411
1412 * src/reader.c (symbols_output): Clean up.
927c1557 1413 * src/output.c (output_gram, output): Clean up.
971d5158 1414
5edafffd
AD
14152001-12-10 Akim Demaille <akim@epita.fr>
1416
1417 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1418 * src/LR0.c (set_state_table): here.
1419 * src/lalr.c (lalr): Call it.
1420
0279f8e9
AD
14212001-12-10 Akim Demaille <akim@epita.fr>
1422
1423 * src/state.h (shifts): Remove the `number' member: shifts are
1424 attached to state, hence no longer need to be labelled with a
1425 state number.
1426
190c4f5f
AD
14272001-12-10 Akim Demaille <akim@epita.fr>
1428
1429 Now that states have a complete set of members, the linked list of
1430 shifts is useless: just fill directly the state's shifts member.
1431
1432 * src/state.h (shifts): Remove the `next' member.
1433 * src/LR0.c (first_state, last_state): Remove.
1434 Adjust the callers.
1435 (augment_automaton): Don't look for the shifts that must be added
1436 a shift on EOF: it is those of the state we looked for! But now,
1437 since shifts are attached, it is no longer needed to looking
1438 merely by its id: its number.
1439
2a73b93d
AD
14402001-12-10 Akim Demaille <akim@epita.fr>
1441
1442 * src/LR0.c (augment_automaton): Better variable locality.
1443 Remove an impossible branch: if there is a state corresponding to
1444 the start symbol being shifted, then there is shift for the start
1445 symbol from the initial state.
1446
74392f6a
AD
14472001-12-10 Akim Demaille <akim@epita.fr>
1448
1449 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1450 only when appropriate: when insert_start_shifting_state' is not
1451 invoked.
1452 * tests/regression.at (Rule Line Numbers): Adjust.
1453
37c82725
AD
14542001-12-10 Akim Demaille <akim@epita.fr>
1455
1456 * src/LR0.c (augment_automaton): Now that all states have shifts,
1457 merge the two cases addition shifts to the initial state.
1458
6a164e0c
AD
14592001-12-10 Akim Demaille <akim@epita.fr>
1460
1461 * src/lalr.c (set_state_table): Move to...
1462 * src/LR0.c: here.
1463 * src/lalr.c (lalr): Don't call it...
1464 * src/LR0.c (generate_states): do it.
1465 * src/LR0.h (first_state): Remove, only the table is used.
1466
7215de24
AD
14672001-12-10 Akim Demaille <akim@epita.fr>
1468
1469 * src/LR0.h (first_shift, first_reduction): Remove.
1470 * src/lalr.c: Don't use first_shift: find shifts through the
1471 states.
1472
80e25d4d
AD
14732001-12-10 Akim Demaille <akim@epita.fr>
1474
1475 * src/LR0.c: Attach shifts to states as soon as they are
1476 computed.
1477 * src/lalr.c (set_state_table): Instead of assigning shifts to
1478 state, just assert that the mapping was properly done.
1479
0ab3728b
AD
14802001-12-10 Akim Demaille <akim@epita.fr>
1481
1482 * src/LR0.c (insert_start_shift): Rename as...
1483 (insert_start_shifting_state): this.
1484 (insert_eof_shifting_state, insert_accepting_state): New.
1485 (augment_automaton): Adjust.
1486 Better locality of the variables.
1487 When looking if the start_symbol is shifted from the initial
1488 state, using `while (... symbol != start_symbol ...)' sounds
1489 better than `while (... symbol < start_symbol ...)': If fail
1490 to see how the order between symbols could be relevant!
1491
78af9bbc
AD
14922001-12-10 Akim Demaille <akim@epita.fr>
1493
1494 * src/getargs.h: Don't declare `spec_name_prefix' and
1495 `spec_file_prefix', declared by src/files.h.
1496 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1497 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1498 * src/output.c (prepare): Adjust.
1499 * src/reader.c (symbols_output): Likewise.
1500 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1501
bdef2a41
AD
15022001-12-10 Akim Demaille <akim@epita.fr>
1503
1504 * src/muscle_tab.c (muscle_init): NULL is a better default than
1505 `"0"'.
1506
3735969c
AD
15072001-12-10 Akim Demaille <akim@epita.fr>
1508
1509 * src/reader.c (reader): Calling symbols_output once is enough.
1510
49701457
AD
15112001-12-10 Akim Demaille <akim@epita.fr>
1512
1513 Now that states have a complete set of members, the linked list of
1514 reductions is useless: just fill directly the state's reductions
1515 member.
1516
1517 * src/state.h (struct reductions): Remove member `number' and
1518 `next'.
1519 * src/LR0.c (first_reduction, last_reduction): Remove.
1520 (save_reductions): Don't link the new reductions, store them in
1521 this_state.
1522 * src/lalr.c (set_state_table): No need to attach reductions to
1523 states, it's already done.
1524 * src/output.c (output_actions): No longer free the shifts, then
1525 the reductions, then the states: free all the states and their
1526 members.
1527
0edad749
AD
15282001-12-10 Akim Demaille <akim@epita.fr>
1529
1530 * src/options.c (OPTN, DRTV, BOTH): New.
1531 (option_table): Use them.
1532
0edad749
AD
1533 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1534 the job of system.h.
1535 * src/options.c: Don't include stdio.h and xalloc.h for the same
1536 reasons.
1537
5449dd0f
AD
15382001-12-10 Akim Demaille <akim@epita.fr>
1539
1540 * src/output.c (output, prepare): Make sure the values of the
1541 muscles `action' and `prologue' are 0-terminated.
1542
a870c567
AD
15432001-12-10 Akim Demaille <akim@epita.fr>
1544
1545 Clean up GCC warnings.
1546
1547 * src/reader.c (copy_action): `buf' is not used.
1548 (parse_skel_decl): Be static.
1549 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1550 * src/options.h (create_long_option_table): Have a real prototype.
1551 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1552 (hash_delete_at): Return const void *.
1553 Adjust casts to preserve the const.
1554
80df8768
AD
15552001-12-10 Akim Demaille <akim@epita.fr>
1556
1557 * configure.in: Require 2.52g.
1558 M4 is not needed, but AUTOM4TE is.
1559 * m4/m4.m4: Remove.
1560 * tests/Makefile.am: Adjust.
1561
f693ad14
AD
15622001-12-10 Akim Demaille <akim@epita.fr>
1563
1564 One structure for states is enough, even though theoretically
1565 there are LR(0) states and LALR(1) states.
1566
1567 * src/lalr.h (state_t): Remove.
1568 (state_table): Be state_t **, not state_t *.
1569 * src/state.h (core, CORE_ALLOC): Rename as...
1570 (state_t, STATE_ALLOC): this.
1571 Add the LALR(1) members: shifts, reductions, errs.
1572 * src/LR0.c (state_table): Rename as...
1573 (state_hash): this, to avoid name clashes with the global
1574 `state_table'.
1575 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1576 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1577
74ffbcb6
AD
15782001-12-10 Akim Demaille <akim@epita.fr>
1579
1580 Bison dumps core on bash.y.
1581 Reported by Pascal Bart.
1582
1583 * src/warshall.c (bitmatrix_print): New.
1584 (TC): Use it.
1585 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1586 j must be the outer loop.
1587 * tests/regression.at (Broken Closure): New.
1588
07708e19
AD
15892001-12-05 Akim Demaille <akim@epita.fr>
1590
1591 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1592 its argument.
1593