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