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