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