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