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