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