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