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