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