]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
[bison.git] / ChangeLog
CommitLineData
f0250de6
AD
12002-03-04 Akim Demaille <akim@epita.fr>
2
3 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
4 * src/reduce.c: Remove the `bitset_zero's following the
5 `bitset_create's, as now it is performed by the latter.
6
7
ef017502
AD
82002-03-04 Akim Demaille <akim@epita.fr>
9
10 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
11 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
13 latest sources from Michael.
14
15
76514394
AD
162002-03-04 Akim Demaille <akim@epita.fr>
17
18 * src/output.c (output): Don't free the grammar.
19 * src/reader.c (grammar_free): New.
20 * src/main.c (main): Call it and don't free symtab here.
21
55024580
AD
222002-03-04 Akim Demaille <akim@epita.fr>
23
24 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
25 before returning.
26 Reported by Benoit Perrot.
27
f9abaa2c
AD
282002-03-04 Akim Demaille <akim@epita.fr>
29
30 Use bitset operations when possible, not loops over bits.
31
32 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
33 bitset_or.
34 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
35 * src/reduce.c (useless_nonterminals): Formatting changes.
36 * src/warshall.c (TC): Use bitset_or.
37
38
0e721e75
AD
392002-03-04 Akim Demaille <akim@epita.fr>
40
41 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
42 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
43 Ditto.
44
45
0fb1ffb1
AD
462002-03-04 Akim Demaille <akim@epita.fr>
47
48 * src/lalr.c (F): Now a bitset*.
49 Adjust all dependencies.
50
51
b86796bf
AD
522002-03-04 Akim Demaille <akim@epita.fr>
53
54 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
55 Adjust all dependencies.
56
57
602bbf31
AD
582002-03-04 Akim Demaille <akim@epita.fr>
59
60 * src/L0.c, src/LR0.h (nstates): Be size_t.
61 Adjust comparisons (signed vs unsigned).
62 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
63 bitset*.
64 Adjust all dependencies.
65
66
d8a0245c
AD
672002-03-04 Akim Demaille <akim@epita.fr>
68
69 * src/closure.c (firsts): Now, also a bitset.
70 Adjust all dependencies.
71 (varsetsize): Remove, now unused.
72 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
73
34ba9743
AD
742002-03-04 Akim Demaille <akim@epita.fr>
75
76 * src/print.c: Convert to use bitset.h, not hand coded iterations
77 over ints.
78
79
ed86e78c
AD
802002-03-04 Akim Demaille <akim@epita.fr>
81
82 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
83
dfdb1797
AD
842002-03-04 Akim Demaille <akim@epita.fr>
85
86 * src/closure.c (ruleset): Be a bitset.
87 (rulesetsize): Remove.
88
89
7086e707
AD
902002-03-04 Akim Demaille <akim@epita.fr>
91
92 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
93 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
94 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
95 * src/closure.c (fderives): Be an array of bitsets.
96
98254360
RA
972002-02-28 Robert Anisko <robert@lrde.epita.fr>
98
99 * data/bison.c++: Merge the two generated headers. Insert a copyright
100 notice in each output file.
101
a75c057f
AD
1022002-02-28 Akim Demaille <akim@epita.fr>
103
104 * data/bison.c++: Copy the prologue of bison.simple to fetch
105 useful M4 definitions, such as b4_header_guard.
106
06b00abc
AD
1072002-02-25 Akim Demaille <akim@epita.fr>
108
109 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
110 translator friendly scheme for the bgr
111 copyright notice.
06b00abc 112
70e7d534
AD
1132002-02-25 Akim Demaille <akim@epita.fr>
114
115 * src/output.c (header_output): Remove, now handled completely via
116 M4.
117
abe017f6
AD
1182002-02-25 Akim Demaille <akim@epita.fr>
119
120 * m4/m4.m4: New, from CVS Autoconf.
121 * configure.in: Invoke it.
122 * src/output.c (output_skeleton): Use its result instead of the
123 hard coded name.
124
381fb12e
AD
1252002-02-25 Akim Demaille <akim@epita.fr>
126
127 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
128 Fileutils 4.1.5.
129 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
130 * src/output.c (output_skeleton): Use mkstemp to create a real
131 temporary file.
132 Move the filling of `skeleton' and its muscle to...
133 (prepare): here.
134 (output): Move the definition of the prologue muscle to...
135 (prepare): here.
136 * src/system.h (DEFAULT_TMPDIR): New.
137
6f38107f
PE
1382002-02-14 Paul Eggert <eggert@twinsun.com>
139
140 Remove the support for C++ namespace cleanliness; it was
141 causing more problems than it was curing, since it didn't work
142 properly on some nonstandard C++ compilers. This can wait
143 for a proper C++ parser.
144
145 * NEWS: Document this.
146 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
147 of C++, as it's treated like C now.
148 * src/bison.simple (YYSTD): Remove.
149 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
150 Treat C++ just like Standard C instead of trying to support
151 namespace cleanliness.
152
80cce3da
AD
1532002-02-14 Akim Demaille <akim@epita.fr>
154
155 * tests/regression.at (else): Adjust to Andreas' change.
156
842e8679
AD
1572002-02-14 Akim Demaille <akim@epita.fr>
158
159 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
160
4bda3f10
AD
1612002-02-13 Andreas Schwab <schwab@suse.de>
162
163 * src/output.c (output_rule_data): Don't output NULL, it might
164 not be defined yet.
165
4162fa07 1662002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 167
4162fa07
RA
168 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
169 (Copyright notice): Update.
b418ecd8 170
bd16a5dc
AD
1712002-02-11 Akim Demaille <akim@epita.fr>
172
173 * tests/regression.at (%nonassoc and eof): Don't include
174 nonportable headers.
175
8d69a1a3
RA
1762002-02-08 Robert Anisko <robert@lrde.epita.fr>
177
178 * data/bison.c++: Correct error recovery. Make the user able to
179 initialize the starting location.
180
9b2d0677
AD
1812002-02-07 Akim Demaille <akim@epita.fr>
182
183 * tests/input.at: New.
184
69e2658b
RA
1852002-02-07 Robert Anisko <robert@lrde.epita.fr>
186
187 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 188 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
189 directives around tables only needed for debugging.
190
4aacc3a7
RA
1912002-02-07 Robert Anisko <robert@lrde.epita.fr>
192
193 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
194 C++ parsers.
195 (yy::b4_name::parse): Use print_.
196
762a801e
RA
1972002-02-07 Robert Anisko <robert@lrde.epita.fr>
198
199 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
200
4bb2bc3f
RA
2012002-02-07 Robert Anisko <robert@lrde.epita.fr>
202
203 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
204 C++ parsers.
205 (yy::b4_name::parse): Build verbose error messages, and use error_.
206
6b45a3ca
RA
2072002-02-06 Robert Anisko <robert@lrde.epita.fr>
208
209 * data/bison.c++: Fix m4 quoting in comments.
210
50997c6e
RA
2112002-02-06 Robert Anisko <robert@lrde.epita.fr>
212
213 * data/bison.c++: Adjust the parser code. Fix some muscles that were
214 not expanded by m4.
215
3f3eed27
AD
2162002-02-05 Akim Demaille <akim@epita.fr>
217
218 * data/bison.c++: Adjust to the M4 back end.
219 More is certainly needed.
220
be2a1a68
AD
2212002-02-05 Akim Demaille <akim@epita.fr>
222
223 Give a try to M4 as a back end.
224
225 * lib/readpipe.c: New, from wdiff.
226 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
227 BISON_HAIRY.
228 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
229 specific values. Now it is m4 that performs the lookup.
230 * src/parse-skel.y: Remove.
231 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
232 * src/output.c (actions_output, guards_output)
233 (token_definitions_output): No longer keeps track of the output
234 line number, hence remove the second argument.
235 (guards_output): Check against the guard member of a rule, not the
236 action member.
237 Adjust callers.
238 (output_skeleton): Don't look for the skeleton location, let m4 do
239 that.
240 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
241 file will be used.
242 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
243 (prepare): Given that for the time being changesyntax is not
244 usable in M4, rename the muscles using `-' to `_'.
245 Define `defines_flag', `output_parser_name' and `output_header_name'.
246 * src/output.h (actions_output, guards_output)
247 (token_definitions_output): Adjust prototypes.
248 * src/scan-skel.l: Instead of scanning the skeletons, it now
249 processes the output of m4: `__oline__' and `#output'.
250 * data/bison.simple: Adjust to be used by M4(sugar).
251 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
252 to date.
253 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
254 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
255 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
256 shamelessly stolen from CVS Autoconf.
257
beda758b
AD
2582002-02-05 Akim Demaille <akim@epita.fr>
259
260 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
261 * configure.in: Check for the declarations of free and malloc.
262 * src/muscle_tab.c: Adjust.
263
5ece6d43
AD
2642002-02-05 Akim Demaille <akim@epita.fr>
265
266 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
267 which have no values.
268
5bb18f9a
AD
2692002-02-05 Akim Demaille <akim@epita.fr>
270
271 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
272 * data/: here.
273
894dd62e
PE
2742002-01-29 Paul Eggert <eggert@twinsun.com>
275
276 * src/bison.simple (YYSIZE_T): Do not define merely because
277 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
278 On some platforms, <alloca.h> does not declare YYSTD (size_t).
279
82841af7
AD
2802002-01-27 Akim Demaille <akim@epita.fr>
281
282 Fix `%nonassoc and eof'.
283
284 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
285 which were not properly copied! Replace
286 memcpy (res->errs, src->errs, src->nerrs);
287 with
288 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
289 !!!
290 * tests/regression.at (%nonassoc and eof): Adjust to newest
291 Autotest: `.' is not in the PATH.
292
318b76e9
AD
2932002-01-27 Akim Demaille <akim@epita.fr>
294
295 * tests/sets.at (AT_EXTRACT_SETS): New.
296 (Nullable): Use it.
297 (Firsts): New.
298
30d2f3d5
AD
2992002-01-26 Akim Demaille <akim@epita.fr>
300
301 * tests/actions.at, tests/calc.at, tests/headers.at,
302 * tests/torture.at: Adjust to the newest Autotest which no longer
303 forces `.' in the PATH.
304
30f8c395
AD
3052002-01-25 Akim Demaille <akim@epita.fr>
306
307 * tests/regression.at (%nonassoc and eof): New.
308 Suggested by Robert Anisko.
309
29ae55f1
AD
3102002-01-24 Akim Demaille <akim@epita.fr>
311
312 Bison dumps core when trying to complain about broken input files.
313 Reported by Cris van Pelt.
314
315 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
316 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
317 into...
318 (Invalid inputs): Strengthen: exercise parse_percent_token.
319
2b548aa6
RA
3202002-01-24 Robert Anisko <robert.anisko@epita.fr>
321
322 * src/Makefile.am: Add bison.c++.
323 * src/bison.c++: New skeleton.
324
bb0146c2
AD
3252002-01-21 Paolo Bonzini <bonzini@gnu.org>
326
327 * po/it.po: New.
328
bec30531
AD
3292002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
330
331 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
332
fc6edc45
MA
3332002-01-20 Marc Autret <marc@gnu.org>
334
335 * src/files.c (compute_output_file_names): Fix
336
5e5d5415
MA
3372002-01-20 Marc Autret <marc@gnu.org>
338
339 * tests/output.at: New test.
340 * src/files.c (compute_base_names): Don't map extensions when
341 the YACC flag is set, use defaults.
342 Reported by Evgeny Stambulchik.
343
44ea3fbd
MA
3442002-01-20 Marc Autret <marc@gnu.org>
345
bb0146c2 346 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
347 compilers as well (i.e. the vendor C compiler).
348 Suggested by Albert Chin-A-Young.
349
338963d1
TVH
3502002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
351
352 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
353 canonical definition.
354 * src/system.h: Use the canonical definition for PARAMS (avoids
355 a conflict with the macro from lib/hash.h).
356
c57b2479
AD
3572002-01-11 Akim Demaille <akim@epita.fr>
358
359 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 360 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 361
b85810ae
AD
3622002-01-09 Akim Demaille <akim@epita.fr>
363
364 * src/files.c, src/files.h (output_infix): New.
365 (tab_extension): Remove.
366 (compute_base_names): Compute the former, drop the latter.
367 * src/output.c (prepare): Insert the muscles `output-infix', and
368 `output-suffix'.
369 * src/parse-skel.y (string, string.1): New.
370 (section.header): Use it.
371 (section.yacc): Remove.
372 (prefix): Remove too.
373 * src/scan-skel.l: Adjust.
374 * src/bison.simple, src/bison.hairy: Adjust.
375
cae60122
AD
3762002-01-09 Akim Demaille <akim@epita.fr>
377
378 * configure.in (WERROR_CFLAGS): Compute it.
379 * src/Makefile.am (CFLAGS): Pass it.
380 * tests/atlocal.in (CFLAGS): Idem.
381 * src/files.c: Fix a few warnings.
382 (get_extension_index): Remove, unused.
383
ae404801
AD
3842002-01-08 Akim Demaille <akim@epita.fr>
385
386 * src/getargs.c (AS_FILE_NAME): New.
387 (getargs): Use it to convert DOSish file names.
388 * src/files.c (base_name): Rename as full_base_name to avoid
389 clashes with `base_name ()'.
390 (filename_split): New.
391 (compute_base_names): N-th rewrite, using filename_split.
392
22312b71
AD
3932002-01-08 Akim Demaille <akim@epita.fr>
394
395 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
396 New, stolen from the Fileutils 4.1.
397 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
398 * configure.in: Check for the presence of memrchr, and of its
399 prototype.
400
a67cef01
TVH
4012002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
402
403 * lib/hash.h (__P): Added definition for this macro.
404 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
405 BUILT_SOURCES, to ensure they are generated first.
406 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
407 %error-verbose to allow bootstrapping with bison 1.30x.
408
2b25d624
AD
4092002-01-06 Akim Demaille <akim@epita.fr>
410
411 * src/reader.c (parse_braces): Don't fetch the next char, the
412 convention is to fetch on entry.
413 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
414 'switch' without a following semicolon.
415 * tests/regression.at (braces parsing): New.
416
3460813b
AD
4172002-01-06 Akim Demaille <akim@epita.fr>
418
419 Bison is dead wrong in its RR conflict reports.
420
421 * tests/torture.at (GNU Cim Grammar): New.
422 * src/conflicts.c (count_rr_conflicts): Fix.
423
73784c64
AD
4242002-01-06 Akim Demaille <akim@epita.fr>
425
426 Creating package.m4 from configure.ac causes too many problems.
427
428 * tests/Makefile.am (package.m4): Create it by hand,
429 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
430
25d81090
AD
4312002-01-06 Akim Demaille <akim@epita.fr>
432
433 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
434 skeleton.h.
435
a9b8959e
PE
4362002-01-04 Paul Eggert <eggert@twinsun.com>
437
438 * doc/bison.texinfo (Debugging):
439 Remove YYSTDERR; it's no longer defined or used.
440 Also, s/cstdio.h/cstdio/.
441
25d81090
AD
4422002-01-03 Akim Demaille <akim@epita.fr>
443
444 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
445
1109455c
AD
4462002-01-03 Akim Demaille <akim@epita.fr>
447
448 * src/parse-skel.y (process_skeleton): Don't bind the parser's
449 tracing code to --trace, wait for a better --trace option, with
450 args.
451
7ea5e977
AD
4522002-01-03 Akim Demaille <akim@epita.fr>
453
454 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
455 The ISO C++ standard is extremely clear about it: stderr is
456 considered a macro, not a regular symbol (see table 94 `Header
457 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
458 Therefore std:: does not apply to it. It still does with fprintf.
459 Also, s/cstdio.h/cstdio/.
460
fab5b110
AD
4612002-01-03 Akim Demaille <akim@epita.fr>
462
463 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
464 for non system headers.
465
aed7fd9b
AD
4662002-01-02 Akim Demaille <akim@epita.fr>
467
468 Equip the skeleton chain with location tracking, runtime trace,
469 pure parser and scanner.
470
471 * src/parse-skel.y: Request a pure parser, locations, and prefix
472 renaming.
473 (%union): Having several members with the same type does not help
474 type mismatches, simplify.
475 (YYPRINT, yyprint): New.
476 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
477 (skel_error): this.
478 Handle locations.
479 * src/scan-skel.l: Adjust to these changes.
480 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
481 (LOCATION_PRINT, skel_control_t): New.
482
24fad99e
AD
4832001-12-30 Akim Demaille <akim@epita.fr>
484
485 * src/parse-skel.y: Get rid of the shift/reduce conflict:
486 replace `gb' with BLANKS.
487 * src/scan-skel.l: Adjust.
488
a4b36db4
AD
4892001-12-30 Akim Demaille <akim@epita.fr>
490
491 * src/system.h: We don't need nor want bcopy.
492 Throw away MS-DOS crap: we don't need getpid.
493 * configure.in: We don't need strndup. It was even causing
494 problems: because Flex includes the headers *before* us,
495 _GNU_SOURCE is not defined by config.h, and therefore strndup was
496 not visible.
497 * lib/xstrndup.c: New.
498 * src/scan-skel.l: Use it.
499 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
500 * src/parse-skel.y: Use %directives instead of #defines.
501
1239777d
AD
5022001-12-30 Akim Demaille <akim@epita.fr>
503
504 * src/skeleton.h: New.
505 * src/output.c (output_parser, output_master_parser): Remove, dead
506 code.
507 * src/output.h (get_lines_number, actions_output, guards_output)
508 (token_definitions_output): Prototype them.
509 * src/parse-skel.y: Add the license notice.
510 Include output.h and skeleton.h.
511 (process_skeleton): Returns void, and takes a single parameter.
512 * src/scan-skel.l: Add the license notice.
513 Include skeleton.h.
514 Don't use %option yylineno: it seems that then Flex imagines
515 REJECT has been used, and therefore it won't reallocate its
516 buffers (which makes no other sense to me than a bug). It results
517 in warnings for `unused: yy_flex_realloc'.
518
9b3add5b
RA
5192001-12-30 Robert Anisko <robert.anisko@epita.fr>
520
521 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
522 (MUSCLE_INSERT_PREFIX): ...to there.
523 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
524 (MUSCLE_INSERT_PREFIX): Move from here...
525
526 * src/bison.hairy: Add a section directive. Put braces around muscle
527 names. This parser skeleton is still broken, but Bison should not
528 choke on a bad muscle 'syntax'.
529 * src/bison.simple: Add a section directive. Put braces around muscle
530 names.
531
532 * src/files.h (strsuffix, stringappend): Add declarations.
533 (tab_extension): Add declaration.
534 (short_base_name): Add declaration.
535
536 * src/files.c (strsuffix, stringappend): No longer static. These
537 functions are used in the skeleton parser.
538 (tab_extension): New.
539 (compute_base_names): Use the computations done in this function
fab5b110 540 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
541 names.
542 (short_base_name): No longer static.
543
544 * src/output.c (output_skeleton): New.
545 (output): Disable call to output_master_parser, and give a try to
546 a new skeleton handling system.
547 (guards_output, actions_output): No longer static.
548 (token_definitions_output, get_lines_number): No longer static.
549
550 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
551
fab5b110 552 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
553 parse-skel.y.
554
555 * src/parse-skel.y: New file.
556 * src/scan-skel.l: New file.
557
b5b61c61
AD
5582001-12-29 Akim Demaille <akim@epita.fr>
559
560 %name-prefix is broken.
561
562 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
563 Adjust all dependencies.
564 * tests/headers.at (export YYLTYPE): Strengthen this test: use
565 %name-prefix.
566
567 Renaming yylval but not yylloc is not consistent. Now we do.
568
569 * src/bison.simple: Prefix yylloc if used.
570 * doc/bison.texinfo (Decl Summary): Document that.
571
8c9a50be
AD
5722001-12-29 Akim Demaille <akim@epita.fr>
573
574 * doc/bison.texinfo: Promote `%long-directive' over
575 `%long_directive'.
576 Remove all references to fixed-output-files, yacc is enough.
577
d99361e6
AD
5782001-12-29 Akim Demaille <akim@epita.fr>
579
580 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
581 user prologue. These are defaults.
582 * tests/actions.at (Mid-rule actions): Make sure the user can
583 define YYDEBUG and YYERROR_VERBOSE.
584
b9cecb91
AD
5852001-12-29 Akim Demaille <akim@epita.fr>
586
587 * src/output.c (header_output): Don't forget to export YYLTYPE and
588 yylloc.
589 * tests/headers.at (export YYLTYPE): New, make sure it does.
590 * tests/regression.at (%union and --defines, Invalid CPP headers):
591 Move to...
592 * tests/headers.at: here.
593
aea13e97
AD
5942001-12-29 Akim Demaille <akim@epita.fr>
595
596 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
597
931394cb
AD
5982001-12-29 Akim Demaille <akim@epita.fr>
599
600 * tests/actions.at (Mid-rule actions): Output on a single line
601 instead of several.
602
704a47c4
AD
6032001-12-29 Akim Demaille <akim@epita.fr>
604
605 * doc/bison.texinfo: Formatting changes.
606
091e20bb
AD
6072001-12-29 Akim Demaille <akim@epita.fr>
608
609 Don't store the token defs in a muscle, just be ready to output it
610 on command. Now possible via `symbols'. Fixes a memory leak.
611
612 * src/output.c (token_definitions_output): New.
613 (output_parser, header_output): Use it.
614 * src/reader.c (symbols_save): Remove.
615
cce71710
AD
6162001-12-29 Akim Demaille <akim@epita.fr>
617
618 * src/bison.simple: Do not provide a default for YYSTYPE and
619 YYLTYPE before the user's prologue. Otherwise it's hardly... a
620 default.
621
82c035a8
AD
6222001-12-29 Akim Demaille <akim@epita.fr>
623
624 Mid-rule actions are simply... ignored!
625
626 * src/reader.c (readgram): Be sure to attach mid-rule actions to
627 the empty-rule associated to the dummy symbol, not to the host
628 rule.
629 * tests/actions.at (Mid-rule actions): New.
630
8419d367
AD
6312001-12-29 Akim Demaille <akim@epita.fr>
632
633 Memory leak.
634
635 * src/reader.c (reader): Free grammar.
636
375d5806
AD
6372001-12-29 Akim Demaille <akim@epita.fr>
638
639 Memory leak.
640
641 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
642 since it allocates it for each state, although only one is needed.
643 (allocate_storage): Do it here.
644
f51cb8ff
AD
6452001-12-29 Akim Demaille <akim@epita.fr>
646
647 * src/options.h, src/options.c (create_long_option_table): Rename
648 as...
649 (long_option_table_new): this, with a clearer prototype.
650 (percent_table): Remove, unused,
651 * src/getargs.c (getargs): Adjust.
652
29e88316
AD
6532001-12-29 Akim Demaille <akim@epita.fr>
654
655 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
656 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
657 as states.
658
b9f71f19
AD
6592001-12-29 Akim Demaille <akim@epita.fr>
660
661 * src/lalr.c (build_relations): Rename `states' as `states1'.
662 Sorry, I don't understand exactly what it is, no better name...
663
1a2b5d37
AD
6642001-12-29 Akim Demaille <akim@epita.fr>
665
666 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
667 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
668 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
669 as rules.
670
1cca533e
AD
6712001-12-29 Akim Demaille <akim@epita.fr>
672
673 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
674 ago.
675
c03ae966
AD
6762001-12-29 Akim Demaille <akim@epita.fr>
677
678 * src/reader.c, src/reader.h (user_toknums): Remove.
679 Adjust all users to use symbols[i]->user_token_number.
680
5a670b1e
AD
6812001-12-29 Akim Demaille <akim@epita.fr>
682
683 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
684 Adjust all users to use symbols[i]->prec or ->assoc.
685
ad949da9
AD
6862001-12-29 Akim Demaille <akim@epita.fr>
687
688 * src/reader.c, src/reader.h (tags): Remove.
689 Adjust all users to use symbols[i]->tag.
690
0e78e603
AD
6912001-12-29 Akim Demaille <akim@epita.fr>
692
693 * src/gram.h, src/gram.c (symbols): New, similar to state_table
694 and rule_table.
695 * src/reader.c (packsymbols): Fill this table.
696 Drop sprec.
697 * src/conflicts.c (resolve_sr_conflict): Adjust.
698 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
699 single table.
700 Use symbols[i]->tag instead of tags[i].
701
213e640e
AD
7022001-12-29 Akim Demaille <akim@epita.fr>
703
704 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
705 In addition, put a comment in there, to replace...
706 * tests/regression.at (%union and C comments): Remove.
707
e7b8bef1
AD
7082001-12-29 Akim Demaille <akim@epita.fr>
709
710 * tests/regression.at (Web2c Actions): Blindly move the actual
711 output as expected output. The contents *seem* right to me, but I
712 can't pretend reading perfectly parser tables... Nonetheless, all
713 the other tests pass correctly, the table look OK, even though the
714 presence of `$axiom' is to be noted: AFAICS it is useless (but
715 harmless).
716
b68e7744
AD
7172001-12-29 Akim Demaille <akim@epita.fr>
718
719 * src/reader.c (readgram): Don't add the rule 0 if there were no
720 rules read. In other words, add it _after_ having performed
721 grammar sanity checks.
722 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
723
78d5bae9
AD
7242001-12-29 Akim Demaille <akim@epita.fr>
725
726 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
727 visible, and some states have now a different number.
728
ff442794
AD
7292001-12-29 Akim Demaille <akim@epita.fr>
730
731 * src/reader.c (readgram): Bind the initial rule's lineno to that
732 of the first rule.
733 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
734 (Solved SR Conflicts): Adjust rule 0's line number.
735
610ab194
AD
7362001-12-29 Akim Demaille <akim@epita.fr>
737
738 Fix the `GAWK Grammar' failure.
739
740 * src/LR0.c (final_state): Initialize to -1 so that we do compute
741 the reductions of the first state which was mistakenly confused
742 with the final state because precisely final_state was initialized
743 to 0.
744 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
745 now noticed by Bison.
746 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
747 have a reduction on $default.
748
29d29c8f
AD
7492001-12-29 Akim Demaille <akim@epita.fr>
750
751 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
752 rule line numbers.
753 * src/closure.c (print_closure): Likewise.
754 * src/derives.c (print_derives): Likewise.
755 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
756 now.
757
7c6b64d0
AD
7582001-12-29 Akim Demaille <akim@epita.fr>
759
760 * src/lalr.c (lookaheads_print): New.
761 (lalr): Call it when --trace-flag.
762 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
763 are dumped.
764
3d4daee3
AD
7652001-12-29 Akim Demaille <akim@epita.fr>
766
767 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
768 when walking through ritem, even via rule->rhs.
769 * src/reduce.c (dump_grammar, useful_production, reduce_output)
770 (useful_production, useless_nonterminals): Likewise.
771 (reduce_grammar_tables): Likewise, plus update nritems.
772 * src/nullable.c (set_nullable): Likewise.
773 * src/lalr.c (build_relations): Likewise.
774 * tests/sets.at (Nullable): Adjust.
775 Fortunately, now, the $axiom is no longer nullable.
776
9e7f6bbd
AD
7772001-12-29 Akim Demaille <akim@epita.fr>
778
779 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
780 the 0-sentinel.
781 * src/gram.c (ritem_longest_rhs): Likewise.
782 * src/reduce.c (nonterminals_reduce): Likewise.
783 * src/print_graph.c (print_graph): Likewise.
784 * src/output.c (output_rule_data): Likewise.
785 * src/nullable.c (set_nullable): Likewise.
786
255ef638
AD
7872001-12-29 Akim Demaille <akim@epita.fr>
788
789 * src/output.c: Comment changes.
790
0d8a7363
AD
7912001-12-27 Paul Eggert <eggert@twinsun.com>
792
793 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
794 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
795 Sparc, as they were causing more porting problems than the
796 (minor) performance improvement was worth.
797
798 Also, catch up with 1.31's YYSTD.
799
3db472b9
AD
8002001-12-27 Akim Demaille <akim@epita.fr>
801
802 * src/output.c (output_gram): Rely on nritems, not the
803 0-sentinel. See below.
804 Use -1 as separator, not 0.
805 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
806 Rely on -1 as separator in yyrhs, instead of 0.
807 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
808 twice `Now at end of input', therefore there are two lines less to
809 expect.
810
b365aa05
AD
8112001-12-27 Akim Demaille <akim@epita.fr>
812
813 * tests/regression.at (Unresolved SR Conflicts):
814 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
815 below.
816
30171f79
AD
8172001-12-27 Akim Demaille <akim@epita.fr>
818
819 * src/LR0.c (new_state): Recognize the final state by the fact it
820 is reached by eoftoken.
821 (insert_start_shifting_state, insert_eof_shifting_state)
822 (insert_accepting_state, augment_automaton): Remove, since now
823 these states are automatically computed from the initial state.
824 (generate_states): Adjust.
825 * src/print.c: When reporting a rule number to the user, substract
826 1, so that the axiom rule is rule 0, and the first user rule is 1.
827 * src/reduce.c: Likewise.
828 * src/print_graph.c (print_core): For the time being, just as for
829 the report, depend upon --trace-flags to dump the full set of
830 items.
831 * src/reader.c (readgram): Once the grammar read, insert the rule
832 0: `$axiom: START-SYMBOL $'.
833 * tests/set.at: Adjust: rule 0 is now displayed, and since the
834 number of the states has changed (the final state is no longer
835 necessarily the last), catch up.
836
75142d45
AD
8372001-12-27 Akim Demaille <akim@epita.fr>
838
839 Try to make the use of the eoftoken valid. Given that its value
840 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
841 is used instead of > 0 where appropriate, (ii), depend upon nritems
842 instead of the 0-sentinel.
843
844 * src/gram.h, src/gram.c (nritems): New.
845 Expected to be duplication of nitems, but for the time being...
846 * src/reader.c (packgram): Assert nritems and nitems are equal.
847 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
848 * src/closure.c (print_closure, print_fderives): Likewise.
849 * src/gram.c (ritem_print): Likewise.
850 * src/print.c (print_core, print_grammar): Likewise.
851 * src/print_graph.c: Likewise.
852
b7c49edf
AD
8532001-12-27 Akim Demaille <akim@epita.fr>
854
855 * src/main.c (main): If there are complains after grammar
856 reductions, then output the report anyway if requested, then die.
857 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
858 * src/reader.c (eoftoken): New.
859 (parse_token_decl): If the token being defined has value `0', it
860 is the eoftoken.
861 (packsymbols): No longer hack `tags' to insert `$' by hand.
862 Be sure to preserve the value of the eoftoken.
863 (reader): Make sure eoftoken is defined.
864 Initialize nsyms to 0: now eoftoken is created just like the others.
865 * src/print.c (print_grammar): Don't special case the eof token.
866 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
867 lie anyway, albeit pleasant.
868 * tests/calc.at: Exercise error messages with eoftoken.
869 Change the grammar so that empty input is invalid.
870 Adjust expectations.
871 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
872
ec2da99f
AD
8732001-12-27 Akim Demaille <akim@epita.fr>
874
875 * configure.in: Check the protos of strchr ans strspn.
876 Replace strchr if needed.
877 * src/system.h: Provide the protos of strchr, strspn and memchr if
878 missing.
879 * lib/strchr.c: New.
880 * src/reader.c (symbols_save): Use strchr.
881
8adfa272
AD
8822001-12-27 Akim Demaille <akim@epita.fr>
883
884 * src/print.c, src/print_graph.c (escape): New.
885 Use it to quote the TAGS outputs.
886 * src/print_graph.c (print_state): Now errors are in red, and
887 reductions in green.
888 Prefer high to wide: output the state number on a line of its own.
889
80dac38c
AD
8902001-12-27 Akim Demaille <akim@epita.fr>
891
892 * src/state.h, src/state.c (reductions_new): New.
893 * src/LR0.c (set_state_table): Let all the states have a
894 `reductions', even if reduced to 0.
895 (save_reductions): Adjust.
896 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
897 * src/print.c (print_reductions, print_actions): Adjust.
898 * src/output.c (action_row): Adjust.
899
2cec70b9
AD
9002001-12-27 Akim Demaille <akim@epita.fr>
901
902 * src/state.h, src/state.c (errs_new, errs_dup): New.
903 * src/LR0.c (set_state_table): Let all the states have an errs,
904 even if reduced to 0.
905 * src/print.c (print_errs, print_reductions): Adjust.
906 * src/output.c (output_actions, action_row): Adjust.
907 * src/conflicts.c (resolve_sr_conflict): Adjust.
908
13ca549a
AD
9092001-12-27 Akim Demaille <akim@epita.fr>
910
911 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
912
5092aba5
AD
9132001-12-27 Akim Demaille <akim@epita.fr>
914
915 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
916 * src/print.c: here.
917 (lookaheadset, shiftset): New, used as additional storage by
918 print_reductions.
919 (print_results): Adjust.
920 (print_shifts, print_gotos, print_errs): New, extracted from...
921 (print_actions): here.
922 * src/print_graph.c (print_actions): Remove dead code.
923
11e2beca
AD
9242001-12-27 Akim Demaille <akim@epita.fr>
925
926 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
927 `$n' and `@n'.
928
dac3c910
AD
9292001-12-27 Akim Demaille <akim@epita.fr>
930
931 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
932 (build_relations): Adjust.
933
d0b0fefa
AD
9342001-12-27 Akim Demaille <akim@epita.fr>
935
936 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
937 duplication.
938
adc8c848
AD
9392001-12-27 Akim Demaille <akim@epita.fr>
940
941 * src/reader.c (packgram): Catch nitems overflows.
942
14d293ac
AD
9432001-12-27 Akim Demaille <akim@epita.fr>
944
945 * src/files.c, src/files.h (guard_obstack): Remove.
946 * src/output.c (output): Adjust.
947 * src/reader.c (parse_braces): New, factoring...
948 (copy_action, copy_guard): these two which are renamed as...
949 (parse_action, parse_guard): these.
950 As a voluntary consequence, using braces around guards is now
951 mandatory.
952
f499b062
AD
9532001-12-27 Akim Demaille <akim@epita.fr>
954
955 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
956 * src/reader.c (symbol_list): `guard' and `guard_line' are new
957 members.
958 (symbol_list_new): Adjust.
959 (copy_action): action_line is the first line, not the last.
960 (copy_guard): Just as for actions, store the `action' only, not
961 the switch/case/break flesh.
962 Don't parse the user action that might follow the guard, let...
963 (readgram): do it, i.e., now, there can be an action after a
964 guard.
965 In other words the guard is just explicitly optional.
966 (packgram): Adjust.
967 * src/output.c (guards_output): New.
968 (output_parser): Call it when needed.
969 (output): Also free the guard and attrs obstacks.
970 * src/files.c, src/files.h (obstack_save): Remove.
971 (output_files): Remove.
972 As a result, if one needs the former `.act' file, using an
973 appropriate skeleton which requires actions and guards is now
974 required.
975 * src/main.c (main): Adjust.
976 * tests/semantic.at: New.
977 * tests/regression.at: Use `input.y' as input file name.
978 Avoid 8+3 problems by requiring input.c when the test needs the
979 parser.
980
d945f5cd
AD
9812001-12-27 Akim Demaille <akim@epita.fr>
982
983 * src/reader.c (symbol_list_new): Be sure to initialize all the
984 fields.
985
d200e455
AD
9862001-12-27 Akim Demaille <akim@epita.fr>
987
988 All the hacks using a final pseudo state are now useless.
989
990 * src/LR0.c (set_state_table): state_table holds exactly nstates.
991 * src/lalr.c (nLA): New.
992 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
993 instead of lookaheadsp from the pseudo state (nstate + 1).
994
f9507c28
AD
9952001-12-27 Akim Demaille <akim@epita.fr>
996
997 * src/output.c (action_row, token_actions): Use a state_t instead
998 of a integer, and nlookaheads instead of the following state's
999 lookaheadsp.
1000
065fbd27
AD
10012001-12-27 Akim Demaille <akim@epita.fr>
1002
1003 * src/conflicts.c (log_resolution, flush_shift)
1004 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1005 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1006 (conflicts_print, print_reductions): Use a state_t instead of an
1007 integer when referring to a state.
1008 As much as possible, depend upon nlookaheads, instead of the
1009 `lookaheadsp' member of the following state (since lookaheads of
1010 successive states are successive, the difference between state n + 1
1011 and n served as the number of lookaheads for state n).
1012 * src/lalr.c (add_lookback_edge): Likewise.
1013 * src/print.c (print_core, print_actions, print_state)
1014 (print_results): Likewise.
1015 * src/print_graph.c (print_core, print_actions, print_state)
1016 (print_graph): Likewise.
1017 * src/conflicts.h: Adjust.
1018
1b177bd7
AD
10192001-12-27 Akim Demaille <akim@epita.fr>
1020
1021 * src/bison.hairy: Formatting/comment changes.
1022 ANSIfy.
1023 Remove `register' indications.
1024 Add plenty of `static'.
1025
7742ddeb
AD
10262001-12-27 Akim Demaille <akim@epita.fr>
1027
1028 * src/output.c (prepare): Drop the muscle `ntbase' which
1029 duplicates ntokens.
1030 * src/bison.simple: Formatting/comment changes.
1031 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1032 is an undocumented synonym.
1033
1fa14068
AD
10342001-12-22 Akim Demaille <akim@epita.fr>
1035
1036 * src/output.c (output_table_data): Change the prototype to use
1037 `int' for array ranges: some invocations do pass an int, not a
1038 short.
1039 Reported by Wayne Green.
1040
b9752825
AD
10412001-12-22 Akim Demaille <akim@epita.fr>
1042
1043 Some actions of web2c.y are improperly triggered.
1044 Reported by Mike Castle.
1045
1046 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1047 * tests/regression.at (Web2c): Rename as...
1048 (Web2c Report): this.
1049 (Web2c Actions): New.
1050
776209d6
AD
10512001-12-22 Akim Demaille <akim@epita.fr>
1052
1053 Reductions in web2c.y are improperly reported.
1054 Reported by Mike Castle.
1055
1056 * src/conflicts.c (print_reductions): Fix.
1057 * tests/regression.at (Web2c): New.
1058
275fc3ad
AD
10592001-12-18 Akim Demaille <akim@epita.fr>
1060
1061 Some host fail on `assert (!"foo")', which expands to
1062 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1063 Reported by Nelson Beebee.
1064
1065 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1066 `#define it_succeeded 0' and `assert (it_succeeded)'.
1067
897668ee
MA
10682001-12-17 Marc Autret <autret_m@epita.fr>
1069
1070 * src/bison.simple: Don't hard code the skeleton line and filename.
1071 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1072 New line counter 'skeleton_line' (skeleton-line muscle).
1073
ab3399e0
PE
10742001-12-17 Paul Eggert <eggert@twinsun.com>
1075
1076 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1077 YYDEBUG must be defined to a nonzero value.
1078
1079 * src/bison.simple (yytname): Do not assume that the user defines
1080 YYDEBUG to a properly parenthesized expression.
1081
3877f72b
AD
10822001-12-17 Akim Demaille <akim@epita.fr>
1083
1084 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1085 nlookaheads is a new member.
1086 Adjust all users.
1087 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1088 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1089 state.
776209d6 1090
331dbc1b
AD
10912001-12-17 Akim Demaille <akim@epita.fr>
1092
1093 * src/files.h, src/files.c (open_files, close_files): Remove.
1094 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1095 let...
1096 * src/reader.c (reader): Do it.
776209d6 1097
be750e4c
AD
10982001-12-17 Akim Demaille <akim@epita.fr>
1099
1100 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1101
709ae8c6
AD
11022001-12-17 Akim Demaille <akim@epita.fr>
1103
1104 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1105 (flush_reduce): New.
1106 (resolve_sr_conflict): Adjust.
776209d6 1107
f87685c3
AD
11082001-12-17 Akim Demaille <akim@epita.fr>
1109
1110 * src/output.c (output_obstack): Be static and rename as...
1111 (format_obstack): this, to avoid any confusion with files.c's
1112 output_obstack.
1113 * src/reader.h (muscle_obstack): Move to...
1114 * src/output.h: here, since it's defined in output.c.
1115
837491d8
AD
11162001-12-17 Akim Demaille <akim@epita.fr>
1117
1118 * src/output.c (action_row, save_column, default_goto)
1119 (sort_actions, matching_state, pack_vector): Better variable
1120 locality.
1121
796d61fb
AD
11222001-12-17 Akim Demaille <akim@epita.fr>
1123
1124 * src/output.c: Various formatting changes.
776209d6 1125
64d15509
AD
11262001-12-17 Akim Demaille <akim@epita.fr>
1127
1128 * src/files.c (output_files): Free the output_obstack.
1129 * src/main.c (main): Call print and print_graph conditionally.
1130 * src/print.c (print): Work unconditionally.
1131 * src/print_graph.c (print_graph): Work unconditionally.
1132 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1133
fbc8ecb7
MA
11342001-12-16 Marc Autret <autret_m@epita.fr>
1135
1136 * src/output.c (actions_output): Fix. When we use %no-lines,
1137 there is one less line per action.
1138
f0440388
MA
11392001-12-16 Marc Autret <autret_m@epita.fr>
1140
1141 * src/bison.simple: Remove a useless #line directive.
1142 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1143 * src/output.c (get_lines_number): New.
776209d6 1144 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1145 output muscles.
1146 Fix line numbering.
1147 (actions_output): Computes the number of lines taken by actions.
1148 (output_master_parser): Insert new skeleton which is the name of
1149 the output parser file name.
1150
a79986b8
MA
11512001-12-15 Marc Autret <autret_m@epita.fr>
1152
1153 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1154
4ec8e00f
MA
11552001-12-15 Marc Autret <autret_m@epita.fr>
1156
1157 * src/output.c (output_gram): Keep track of the hairy one.
1158
1a4648ff
AD
11592001-12-15 Akim Demaille <akim@epita.fr>
1160
1161 Make `make distcheck' work.
1162
1163 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1164 system.h which uses libgettext.h.
1165
9c2c67e6
AD
11662001-12-15 Akim Demaille <akim@epita.fr>
1167
1168 * src/nullable.c (set_nullable): Useless rules must be skipped,
1169 otherwise, since we range over their symbols, we might look at a
1170 nonterminal which no longer ``exists'', i.e., it is not counted in
1171 `nvars', hence we overflow our arrays.
1172
93ede233
AD
11732001-12-15 Akim Demaille <akim@epita.fr>
1174
1175 The header can also be produced directly, without any obstack!
1176 Yahoo!
1177
1178 * src/files.c, src/files.h (defines_obstack): Remove.
1179 (compute_header_macro): Global.
1180 (defines_obstack_save): Remove.
1181 * src/reader.c (parse_union_decl): No longer output to
1182 defines_obstack: its content can be found in the `stype' muscle
1183 anyway.
1184 (output_token_translations): Merge into...
1185 (symbols_output): this.
1186 Rename as...
1187 (symbols_save): this.
1188 (reader): Adjust.
1189 * src/output.c (header_output): New.
1190 (output): Call it.
1191
2666f928
AD
11922001-12-15 Akim Demaille <akim@epita.fr>
1193
1194 * src/reader.c (parse_union_decl): Instead of handling two obstack
1195 simultaneously, use one to define the `stype' muscle, and use the
1196 value of the latter to fill defines_obstack.
1197 (copy_comment): Remove.
1198 (copy_comment2): Work for a single obstack.
1199 Rename as...
1200 (copy_comment): this.
1201
428046f8
AD
12022001-12-15 Akim Demaille <akim@epita.fr>
1203
1204 * src/lex.c, src/lex.h (xgetc): No longer static.
1205 * src/reader.c (parse_union_decl): Revamp.
1206
ea52d706
AD
12072001-12-15 Akim Demaille <akim@epita.fr>
1208
1209 Still making progress in separating Bison into (i) input, (ii)
1210 process, (iii) output: now we can directly output the parser file
1211 without using table_obstack at all.
1212
1213 * src/files.c, src/files.h (table_obstack): Bye bye.
1214 (parser_file_name): New.
1215 * src/files.c (compute_output_file_names): Compute it.
1216 * src/output.c (actions_output, output_parser)
1217 (output_master_parser): To a file instead of an obstack.
1218
3f96f4dc
AD
12192001-12-15 Akim Demaille <akim@epita.fr>
1220
1221 Attach actions to rules, instead of pre-outputting them to
1222 actions_obstack.
1223
1224 * src/gram.h (rule_t): action and action_line are new members.
1225 * src/reader.c (symbol_list): Likewise.
1226 (copy_action): Save the actions within the rule.
1227 (packgram): Save them in rule_table.
1228 * src/output.c (actions_output): New.
1229 (output_parser): Use it on `%%actions'.
1230 (output_rule_data): Don't free rule_table.
1231 (output): Do it.
1232 (prepare): Don't save the `action' muscle.
1233 * src/bison.simple: s/%%action/%%actions/.
1234
51576fb3
AD
12352001-12-15 Akim Demaille <akim@epita.fr>
1236
1237 * src/reader.c (copy_action): When --yacc, don't append a `;'
1238 to the user action: let it fail if lacking.
dee049eb 1239 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1240
2648a72d
AD
12412001-12-14 Akim Demaille <akim@epita.fr>
1242
1243 * src/lex.c (literalchar): Simply return the char you decoded, non
1244 longer mess around with obstacks and int pointers.
1245 Adjust all callers.
1246
92790e5b
AD
12472001-12-14 Akim Demaille <akim@epita.fr>
1248
1249 * src/lex.c (literalchar): Don't escape the special characters,
1250 just decode them, and keep them as char (before, eol was output as
1251 the 2 char string `\n' etc.).
1252 * src/output.c (output_rule_data): Use quotearg to output the
1253 token strings.
1254
927c1557
PE
12552001-12-13 Paul Eggert <eggert@twinsun.com>
1256
1257 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1258 Do not infringe on the global user namespace when using C++.
1259 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1260 All uses of `fprintf' and `stderr' changed.
1261
1262 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1263
ed8e1f68
AD
12642001-12-13 Akim Demaille <akim@epita.fr>
1265
1266 The computation of nullable is broken: it doesn't handle empty
1267 RHS's properly.
1268
1269 * tests/torture.at (GNU AWK Grammar): New.
1270 * tests/sets.at (Nullable): New.
1271 * src/nullable.c (set_nullable): Instead of blindly looping over
1272 `ritems', loop over the rules, and then over their rhs's.
1273
1274 Work around Autotest bugs.
1275
1276 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1277 frame, because Autotest understand lines starting with a `+' as
1278 traces from the shell. Then, they are not processed properly.
1279 Admittedly an Autotest bug, but we don't have time to wait for
1280 Autotest to catch up.
1281 * tests/regression.at (Broken Closure): Adjust to the new table
1282 frames.
1283 Move to...
1284 * tests/sets.at: here.
1285
cb581495
AD
12862001-12-13 Akim Demaille <akim@epita.fr>
1287
1288 * src/closure.c (closure): Use nrules instead of playing tricks
1289 with BITS_PER_WORD.
1290
2e729273
AD
12912001-12-13 Akim Demaille <akim@epita.fr>
1292
1293 * src/print.c (print_actions): Output the handling of `$' as the
1294 traces do: shifting the token EOF. Before EOF was treated as a
1295 nonterminal.
1296 * tests/regression.at: Adjust some tests.
1297 * src/print_graph.c (print_core): Complete the set of items via
1298 closure. The next-to-final and final states are still unsatisfying,
1299 but that's to be addressed elsewhere.
1300 No longer output the rule numbers, but do output the state number.
1301 A single loop for the shifts + gotos is enough, but picked a
1302 distinct color for each.
1303 (print_graph): Initialize and finalize closure.
1304
107f7dfb
AD
13052001-12-13 Akim Demaille <akim@epita.fr>
1306
1307 * src/reader.c (readgram): Remove dead code, an strip useless
1308 braces.
1309 (get_type): Remove, unused.
1310
9b53a24f
AD
13112001-12-12 Akim Demaille <akim@epita.fr>
1312
1313 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1314 on that of lib/error.c.
1315
dbfb6dcd
AD
13162001-12-12 Akim Demaille <akim@epita.fr>
1317
1318 Some hosts don't like `/' in includes.
1319
1320 * src/system.h: Include libgettext.h without qualifying the path.
1321 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1322 $(top_srcdir).
1323
c25fb648
MA
13242001-12-11 Marc Autret <autret_m@epita.fr>
1325
1326 * src/output.c (output_parser): Remove useless muscle.
1327
710ddc4f
MA
13282001-12-11 Marc Autret <autret_m@epita.fr>
1329
1330 * src/bison.simple: Remove #line just before %%epilogue. It
1331 is now handled in ...
1332 * src/reader.c (read_additionnal_code): Add the output of a
1333 #line for the epilogue.
1334
e83d80b8
MA
13352001-12-10 Marc Autret <autret_m@epita.fr>
1336
927c1557 1337 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1338 replace precedent remove.
1339 * src/bison.simple: Remove #line before %%prologue because
1340 %%input-line is wrong at this time.
1341
971d5158
MA
13422001-12-10 Marc Autret <autret_m@epita.fr>
1343
1344 * src/reader.c (symbols_output): Clean up.
927c1557 1345 * src/output.c (output_gram, output): Clean up.
971d5158 1346
5edafffd
AD
13472001-12-10 Akim Demaille <akim@epita.fr>
1348
1349 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1350 * src/LR0.c (set_state_table): here.
1351 * src/lalr.c (lalr): Call it.
1352
0279f8e9
AD
13532001-12-10 Akim Demaille <akim@epita.fr>
1354
1355 * src/state.h (shifts): Remove the `number' member: shifts are
1356 attached to state, hence no longer need to be labelled with a
1357 state number.
1358
190c4f5f
AD
13592001-12-10 Akim Demaille <akim@epita.fr>
1360
1361 Now that states have a complete set of members, the linked list of
1362 shifts is useless: just fill directly the state's shifts member.
1363
1364 * src/state.h (shifts): Remove the `next' member.
1365 * src/LR0.c (first_state, last_state): Remove.
1366 Adjust the callers.
1367 (augment_automaton): Don't look for the shifts that must be added
1368 a shift on EOF: it is those of the state we looked for! But now,
1369 since shifts are attached, it is no longer needed to looking
1370 merely by its id: its number.
1371
2a73b93d
AD
13722001-12-10 Akim Demaille <akim@epita.fr>
1373
1374 * src/LR0.c (augment_automaton): Better variable locality.
1375 Remove an impossible branch: if there is a state corresponding to
1376 the start symbol being shifted, then there is shift for the start
1377 symbol from the initial state.
1378
74392f6a
AD
13792001-12-10 Akim Demaille <akim@epita.fr>
1380
1381 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1382 only when appropriate: when insert_start_shifting_state' is not
1383 invoked.
1384 * tests/regression.at (Rule Line Numbers): Adjust.
1385
37c82725
AD
13862001-12-10 Akim Demaille <akim@epita.fr>
1387
1388 * src/LR0.c (augment_automaton): Now that all states have shifts,
1389 merge the two cases addition shifts to the initial state.
1390
6a164e0c
AD
13912001-12-10 Akim Demaille <akim@epita.fr>
1392
1393 * src/lalr.c (set_state_table): Move to...
1394 * src/LR0.c: here.
1395 * src/lalr.c (lalr): Don't call it...
1396 * src/LR0.c (generate_states): do it.
1397 * src/LR0.h (first_state): Remove, only the table is used.
1398
7215de24
AD
13992001-12-10 Akim Demaille <akim@epita.fr>
1400
1401 * src/LR0.h (first_shift, first_reduction): Remove.
1402 * src/lalr.c: Don't use first_shift: find shifts through the
1403 states.
1404
80e25d4d
AD
14052001-12-10 Akim Demaille <akim@epita.fr>
1406
1407 * src/LR0.c: Attach shifts to states as soon as they are
1408 computed.
1409 * src/lalr.c (set_state_table): Instead of assigning shifts to
1410 state, just assert that the mapping was properly done.
1411
0ab3728b
AD
14122001-12-10 Akim Demaille <akim@epita.fr>
1413
1414 * src/LR0.c (insert_start_shift): Rename as...
1415 (insert_start_shifting_state): this.
1416 (insert_eof_shifting_state, insert_accepting_state): New.
1417 (augment_automaton): Adjust.
1418 Better locality of the variables.
1419 When looking if the start_symbol is shifted from the initial
1420 state, using `while (... symbol != start_symbol ...)' sounds
1421 better than `while (... symbol < start_symbol ...)': If fail
1422 to see how the order between symbols could be relevant!
1423
78af9bbc
AD
14242001-12-10 Akim Demaille <akim@epita.fr>
1425
1426 * src/getargs.h: Don't declare `spec_name_prefix' and
1427 `spec_file_prefix', declared by src/files.h.
1428 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1429 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1430 * src/output.c (prepare): Adjust.
1431 * src/reader.c (symbols_output): Likewise.
1432 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1433
bdef2a41
AD
14342001-12-10 Akim Demaille <akim@epita.fr>
1435
1436 * src/muscle_tab.c (muscle_init): NULL is a better default than
1437 `"0"'.
1438
3735969c
AD
14392001-12-10 Akim Demaille <akim@epita.fr>
1440
1441 * src/reader.c (reader): Calling symbols_output once is enough.
1442
49701457
AD
14432001-12-10 Akim Demaille <akim@epita.fr>
1444
1445 Now that states have a complete set of members, the linked list of
1446 reductions is useless: just fill directly the state's reductions
1447 member.
1448
1449 * src/state.h (struct reductions): Remove member `number' and
1450 `next'.
1451 * src/LR0.c (first_reduction, last_reduction): Remove.
1452 (save_reductions): Don't link the new reductions, store them in
1453 this_state.
1454 * src/lalr.c (set_state_table): No need to attach reductions to
1455 states, it's already done.
1456 * src/output.c (output_actions): No longer free the shifts, then
1457 the reductions, then the states: free all the states and their
1458 members.
1459
0edad749
AD
14602001-12-10 Akim Demaille <akim@epita.fr>
1461
1462 * src/options.c (OPTN, DRTV, BOTH): New.
1463 (option_table): Use them.
1464
0edad749
AD
1465 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1466 the job of system.h.
1467 * src/options.c: Don't include stdio.h and xalloc.h for the same
1468 reasons.
1469
5449dd0f
AD
14702001-12-10 Akim Demaille <akim@epita.fr>
1471
1472 * src/output.c (output, prepare): Make sure the values of the
1473 muscles `action' and `prologue' are 0-terminated.
1474
a870c567
AD
14752001-12-10 Akim Demaille <akim@epita.fr>
1476
1477 Clean up GCC warnings.
1478
1479 * src/reader.c (copy_action): `buf' is not used.
1480 (parse_skel_decl): Be static.
1481 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1482 * src/options.h (create_long_option_table): Have a real prototype.
1483 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1484 (hash_delete_at): Return const void *.
1485 Adjust casts to preserve the const.
1486
80df8768
AD
14872001-12-10 Akim Demaille <akim@epita.fr>
1488
1489 * configure.in: Require 2.52g.
1490 M4 is not needed, but AUTOM4TE is.
1491 * m4/m4.m4: Remove.
1492 * tests/Makefile.am: Adjust.
1493
f693ad14
AD
14942001-12-10 Akim Demaille <akim@epita.fr>
1495
1496 One structure for states is enough, even though theoretically
1497 there are LR(0) states and LALR(1) states.
1498
1499 * src/lalr.h (state_t): Remove.
1500 (state_table): Be state_t **, not state_t *.
1501 * src/state.h (core, CORE_ALLOC): Rename as...
1502 (state_t, STATE_ALLOC): this.
1503 Add the LALR(1) members: shifts, reductions, errs.
1504 * src/LR0.c (state_table): Rename as...
1505 (state_hash): this, to avoid name clashes with the global
1506 `state_table'.
1507 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1508 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1509
74ffbcb6
AD
15102001-12-10 Akim Demaille <akim@epita.fr>
1511
1512 Bison dumps core on bash.y.
1513 Reported by Pascal Bart.
1514
1515 * src/warshall.c (bitmatrix_print): New.
1516 (TC): Use it.
1517 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1518 j must be the outer loop.
1519 * tests/regression.at (Broken Closure): New.
1520
07708e19
AD
15212001-12-05 Akim Demaille <akim@epita.fr>
1522
1523 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1524 its argument.
1525