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