]> git.saurik.com Git - bison.git/blame - ChangeLog
* data/bison.c++: Correct error recovery. Make the user able to
[bison.git] / ChangeLog
CommitLineData
8d69a1a3
RA
12002-02-08 Robert Anisko <robert@lrde.epita.fr>
2
3 * data/bison.c++: Correct error recovery. Make the user able to
4 initialize the starting location.
5
9b2d0677
AD
62002-02-07 Akim Demaille <akim@epita.fr>
7
8 * tests/input.at: New.
9
69e2658b
RA
102002-02-07 Robert Anisko <robert@lrde.epita.fr>
11
12 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 13 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
14 directives around tables only needed for debugging.
15
4aacc3a7
RA
162002-02-07 Robert Anisko <robert@lrde.epita.fr>
17
18 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19 C++ parsers.
20 (yy::b4_name::parse): Use print_.
21
762a801e
RA
222002-02-07 Robert Anisko <robert@lrde.epita.fr>
23
24 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
25
4bb2bc3f
RA
262002-02-07 Robert Anisko <robert@lrde.epita.fr>
27
28 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
29 C++ parsers.
30 (yy::b4_name::parse): Build verbose error messages, and use error_.
31
6b45a3ca
RA
322002-02-06 Robert Anisko <robert@lrde.epita.fr>
33
34 * data/bison.c++: Fix m4 quoting in comments.
35
50997c6e
RA
362002-02-06 Robert Anisko <robert@lrde.epita.fr>
37
38 * data/bison.c++: Adjust the parser code. Fix some muscles that were
39 not expanded by m4.
40
3f3eed27
AD
412002-02-05 Akim Demaille <akim@epita.fr>
42
43 * data/bison.c++: Adjust to the M4 back end.
44 More is certainly needed.
45
be2a1a68
AD
462002-02-05 Akim Demaille <akim@epita.fr>
47
48 Give a try to M4 as a back end.
49
50 * lib/readpipe.c: New, from wdiff.
51 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
52 BISON_HAIRY.
53 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
54 specific values. Now it is m4 that performs the lookup.
55 * src/parse-skel.y: Remove.
56 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
57 * src/output.c (actions_output, guards_output)
58 (token_definitions_output): No longer keeps track of the output
59 line number, hence remove the second argument.
60 (guards_output): Check against the guard member of a rule, not the
61 action member.
62 Adjust callers.
63 (output_skeleton): Don't look for the skeleton location, let m4 do
64 that.
65 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
66 file will be used.
67 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
68 (prepare): Given that for the time being changesyntax is not
69 usable in M4, rename the muscles using `-' to `_'.
70 Define `defines_flag', `output_parser_name' and `output_header_name'.
71 * src/output.h (actions_output, guards_output)
72 (token_definitions_output): Adjust prototypes.
73 * src/scan-skel.l: Instead of scanning the skeletons, it now
74 processes the output of m4: `__oline__' and `#output'.
75 * data/bison.simple: Adjust to be used by M4(sugar).
76 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
77 to date.
78 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
79 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
80 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
81 shamelessly stolen from CVS Autoconf.
82
beda758b
AD
832002-02-05 Akim Demaille <akim@epita.fr>
84
85 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
86 * configure.in: Check for the declarations of free and malloc.
87 * src/muscle_tab.c: Adjust.
88
5ece6d43
AD
892002-02-05 Akim Demaille <akim@epita.fr>
90
91 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
92 which have no values.
93
5bb18f9a
AD
942002-02-05 Akim Demaille <akim@epita.fr>
95
96 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
97 * data/: here.
98
894dd62e
PE
992002-01-29 Paul Eggert <eggert@twinsun.com>
100
101 * src/bison.simple (YYSIZE_T): Do not define merely because
102 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
103 On some platforms, <alloca.h> does not declare YYSTD (size_t).
104
82841af7
AD
1052002-01-27 Akim Demaille <akim@epita.fr>
106
107 Fix `%nonassoc and eof'.
108
109 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
110 which were not properly copied! Replace
111 memcpy (res->errs, src->errs, src->nerrs);
112 with
113 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
114 !!!
115 * tests/regression.at (%nonassoc and eof): Adjust to newest
116 Autotest: `.' is not in the PATH.
117
318b76e9
AD
1182002-01-27 Akim Demaille <akim@epita.fr>
119
120 * tests/sets.at (AT_EXTRACT_SETS): New.
121 (Nullable): Use it.
122 (Firsts): New.
123
30d2f3d5
AD
1242002-01-26 Akim Demaille <akim@epita.fr>
125
126 * tests/actions.at, tests/calc.at, tests/headers.at,
127 * tests/torture.at: Adjust to the newest Autotest which no longer
128 forces `.' in the PATH.
129
30f8c395
AD
1302002-01-25 Akim Demaille <akim@epita.fr>
131
132 * tests/regression.at (%nonassoc and eof): New.
133 Suggested by Robert Anisko.
134
29ae55f1
AD
1352002-01-24 Akim Demaille <akim@epita.fr>
136
137 Bison dumps core when trying to complain about broken input files.
138 Reported by Cris van Pelt.
139
140 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
141 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
142 into...
143 (Invalid inputs): Strengthen: exercise parse_percent_token.
144
2b548aa6
RA
1452002-01-24 Robert Anisko <robert.anisko@epita.fr>
146
147 * src/Makefile.am: Add bison.c++.
148 * src/bison.c++: New skeleton.
149
bb0146c2
AD
1502002-01-21 Paolo Bonzini <bonzini@gnu.org>
151
152 * po/it.po: New.
153
bec30531
AD
1542002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
155
156 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
157
fc6edc45
MA
1582002-01-20 Marc Autret <marc@gnu.org>
159
160 * src/files.c (compute_output_file_names): Fix
161
5e5d5415
MA
1622002-01-20 Marc Autret <marc@gnu.org>
163
164 * tests/output.at: New test.
165 * src/files.c (compute_base_names): Don't map extensions when
166 the YACC flag is set, use defaults.
167 Reported by Evgeny Stambulchik.
168
44ea3fbd
MA
1692002-01-20 Marc Autret <marc@gnu.org>
170
bb0146c2 171 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
172 compilers as well (i.e. the vendor C compiler).
173 Suggested by Albert Chin-A-Young.
174
338963d1
TVH
1752002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
176
177 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
178 canonical definition.
179 * src/system.h: Use the canonical definition for PARAMS (avoids
180 a conflict with the macro from lib/hash.h).
181
c57b2479
AD
1822002-01-11 Akim Demaille <akim@epita.fr>
183
184 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 185 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 186
b85810ae
AD
1872002-01-09 Akim Demaille <akim@epita.fr>
188
189 * src/files.c, src/files.h (output_infix): New.
190 (tab_extension): Remove.
191 (compute_base_names): Compute the former, drop the latter.
192 * src/output.c (prepare): Insert the muscles `output-infix', and
193 `output-suffix'.
194 * src/parse-skel.y (string, string.1): New.
195 (section.header): Use it.
196 (section.yacc): Remove.
197 (prefix): Remove too.
198 * src/scan-skel.l: Adjust.
199 * src/bison.simple, src/bison.hairy: Adjust.
200
cae60122
AD
2012002-01-09 Akim Demaille <akim@epita.fr>
202
203 * configure.in (WERROR_CFLAGS): Compute it.
204 * src/Makefile.am (CFLAGS): Pass it.
205 * tests/atlocal.in (CFLAGS): Idem.
206 * src/files.c: Fix a few warnings.
207 (get_extension_index): Remove, unused.
208
ae404801
AD
2092002-01-08 Akim Demaille <akim@epita.fr>
210
211 * src/getargs.c (AS_FILE_NAME): New.
212 (getargs): Use it to convert DOSish file names.
213 * src/files.c (base_name): Rename as full_base_name to avoid
214 clashes with `base_name ()'.
215 (filename_split): New.
216 (compute_base_names): N-th rewrite, using filename_split.
217
22312b71
AD
2182002-01-08 Akim Demaille <akim@epita.fr>
219
220 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
221 New, stolen from the Fileutils 4.1.
222 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
223 * configure.in: Check for the presence of memrchr, and of its
224 prototype.
225
a67cef01
TVH
2262002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
227
228 * lib/hash.h (__P): Added definition for this macro.
229 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
230 BUILT_SOURCES, to ensure they are generated first.
231 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
232 %error-verbose to allow bootstrapping with bison 1.30x.
233
2b25d624
AD
2342002-01-06 Akim Demaille <akim@epita.fr>
235
236 * src/reader.c (parse_braces): Don't fetch the next char, the
237 convention is to fetch on entry.
238 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
239 'switch' without a following semicolon.
240 * tests/regression.at (braces parsing): New.
241
3460813b
AD
2422002-01-06 Akim Demaille <akim@epita.fr>
243
244 Bison is dead wrong in its RR conflict reports.
245
246 * tests/torture.at (GNU Cim Grammar): New.
247 * src/conflicts.c (count_rr_conflicts): Fix.
248
73784c64
AD
2492002-01-06 Akim Demaille <akim@epita.fr>
250
251 Creating package.m4 from configure.ac causes too many problems.
252
253 * tests/Makefile.am (package.m4): Create it by hand,
254 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
255
25d81090
AD
2562002-01-06 Akim Demaille <akim@epita.fr>
257
258 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
259 skeleton.h.
260
a9b8959e
PE
2612002-01-04 Paul Eggert <eggert@twinsun.com>
262
263 * doc/bison.texinfo (Debugging):
264 Remove YYSTDERR; it's no longer defined or used.
265 Also, s/cstdio.h/cstdio/.
266
25d81090
AD
2672002-01-03 Akim Demaille <akim@epita.fr>
268
269 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
270
1109455c
AD
2712002-01-03 Akim Demaille <akim@epita.fr>
272
273 * src/parse-skel.y (process_skeleton): Don't bind the parser's
274 tracing code to --trace, wait for a better --trace option, with
275 args.
276
7ea5e977
AD
2772002-01-03 Akim Demaille <akim@epita.fr>
278
279 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
280 The ISO C++ standard is extremely clear about it: stderr is
281 considered a macro, not a regular symbol (see table 94 `Header
282 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
283 Therefore std:: does not apply to it. It still does with fprintf.
284 Also, s/cstdio.h/cstdio/.
285
fab5b110
AD
2862002-01-03 Akim Demaille <akim@epita.fr>
287
288 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
289 for non system headers.
290
aed7fd9b
AD
2912002-01-02 Akim Demaille <akim@epita.fr>
292
293 Equip the skeleton chain with location tracking, runtime trace,
294 pure parser and scanner.
295
296 * src/parse-skel.y: Request a pure parser, locations, and prefix
297 renaming.
298 (%union): Having several members with the same type does not help
299 type mismatches, simplify.
300 (YYPRINT, yyprint): New.
301 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
302 (skel_error): this.
303 Handle locations.
304 * src/scan-skel.l: Adjust to these changes.
305 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
306 (LOCATION_PRINT, skel_control_t): New.
307
24fad99e
AD
3082001-12-30 Akim Demaille <akim@epita.fr>
309
310 * src/parse-skel.y: Get rid of the shift/reduce conflict:
311 replace `gb' with BLANKS.
312 * src/scan-skel.l: Adjust.
313
a4b36db4
AD
3142001-12-30 Akim Demaille <akim@epita.fr>
315
316 * src/system.h: We don't need nor want bcopy.
317 Throw away MS-DOS crap: we don't need getpid.
318 * configure.in: We don't need strndup. It was even causing
319 problems: because Flex includes the headers *before* us,
320 _GNU_SOURCE is not defined by config.h, and therefore strndup was
321 not visible.
322 * lib/xstrndup.c: New.
323 * src/scan-skel.l: Use it.
324 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
325 * src/parse-skel.y: Use %directives instead of #defines.
326
1239777d
AD
3272001-12-30 Akim Demaille <akim@epita.fr>
328
329 * src/skeleton.h: New.
330 * src/output.c (output_parser, output_master_parser): Remove, dead
331 code.
332 * src/output.h (get_lines_number, actions_output, guards_output)
333 (token_definitions_output): Prototype them.
334 * src/parse-skel.y: Add the license notice.
335 Include output.h and skeleton.h.
336 (process_skeleton): Returns void, and takes a single parameter.
337 * src/scan-skel.l: Add the license notice.
338 Include skeleton.h.
339 Don't use %option yylineno: it seems that then Flex imagines
340 REJECT has been used, and therefore it won't reallocate its
341 buffers (which makes no other sense to me than a bug). It results
342 in warnings for `unused: yy_flex_realloc'.
343
9b3add5b
RA
3442001-12-30 Robert Anisko <robert.anisko@epita.fr>
345
346 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
347 (MUSCLE_INSERT_PREFIX): ...to there.
348 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
349 (MUSCLE_INSERT_PREFIX): Move from here...
350
351 * src/bison.hairy: Add a section directive. Put braces around muscle
352 names. This parser skeleton is still broken, but Bison should not
353 choke on a bad muscle 'syntax'.
354 * src/bison.simple: Add a section directive. Put braces around muscle
355 names.
356
357 * src/files.h (strsuffix, stringappend): Add declarations.
358 (tab_extension): Add declaration.
359 (short_base_name): Add declaration.
360
361 * src/files.c (strsuffix, stringappend): No longer static. These
362 functions are used in the skeleton parser.
363 (tab_extension): New.
364 (compute_base_names): Use the computations done in this function
fab5b110 365 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
366 names.
367 (short_base_name): No longer static.
368
369 * src/output.c (output_skeleton): New.
370 (output): Disable call to output_master_parser, and give a try to
371 a new skeleton handling system.
372 (guards_output, actions_output): No longer static.
373 (token_definitions_output, get_lines_number): No longer static.
374
375 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
376
fab5b110 377 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
378 parse-skel.y.
379
380 * src/parse-skel.y: New file.
381 * src/scan-skel.l: New file.
382
b5b61c61
AD
3832001-12-29 Akim Demaille <akim@epita.fr>
384
385 %name-prefix is broken.
386
387 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
388 Adjust all dependencies.
389 * tests/headers.at (export YYLTYPE): Strengthen this test: use
390 %name-prefix.
391
392 Renaming yylval but not yylloc is not consistent. Now we do.
393
394 * src/bison.simple: Prefix yylloc if used.
395 * doc/bison.texinfo (Decl Summary): Document that.
396
8c9a50be
AD
3972001-12-29 Akim Demaille <akim@epita.fr>
398
399 * doc/bison.texinfo: Promote `%long-directive' over
400 `%long_directive'.
401 Remove all references to fixed-output-files, yacc is enough.
402
d99361e6
AD
4032001-12-29 Akim Demaille <akim@epita.fr>
404
405 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
406 user prologue. These are defaults.
407 * tests/actions.at (Mid-rule actions): Make sure the user can
408 define YYDEBUG and YYERROR_VERBOSE.
409
b9cecb91
AD
4102001-12-29 Akim Demaille <akim@epita.fr>
411
412 * src/output.c (header_output): Don't forget to export YYLTYPE and
413 yylloc.
414 * tests/headers.at (export YYLTYPE): New, make sure it does.
415 * tests/regression.at (%union and --defines, Invalid CPP headers):
416 Move to...
417 * tests/headers.at: here.
418
aea13e97
AD
4192001-12-29 Akim Demaille <akim@epita.fr>
420
421 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
422
931394cb
AD
4232001-12-29 Akim Demaille <akim@epita.fr>
424
425 * tests/actions.at (Mid-rule actions): Output on a single line
426 instead of several.
427
704a47c4
AD
4282001-12-29 Akim Demaille <akim@epita.fr>
429
430 * doc/bison.texinfo: Formatting changes.
431
091e20bb
AD
4322001-12-29 Akim Demaille <akim@epita.fr>
433
434 Don't store the token defs in a muscle, just be ready to output it
435 on command. Now possible via `symbols'. Fixes a memory leak.
436
437 * src/output.c (token_definitions_output): New.
438 (output_parser, header_output): Use it.
439 * src/reader.c (symbols_save): Remove.
440
cce71710
AD
4412001-12-29 Akim Demaille <akim@epita.fr>
442
443 * src/bison.simple: Do not provide a default for YYSTYPE and
444 YYLTYPE before the user's prologue. Otherwise it's hardly... a
445 default.
446
82c035a8
AD
4472001-12-29 Akim Demaille <akim@epita.fr>
448
449 Mid-rule actions are simply... ignored!
450
451 * src/reader.c (readgram): Be sure to attach mid-rule actions to
452 the empty-rule associated to the dummy symbol, not to the host
453 rule.
454 * tests/actions.at (Mid-rule actions): New.
455
8419d367
AD
4562001-12-29 Akim Demaille <akim@epita.fr>
457
458 Memory leak.
459
460 * src/reader.c (reader): Free grammar.
461
375d5806
AD
4622001-12-29 Akim Demaille <akim@epita.fr>
463
464 Memory leak.
465
466 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
467 since it allocates it for each state, although only one is needed.
468 (allocate_storage): Do it here.
469
f51cb8ff
AD
4702001-12-29 Akim Demaille <akim@epita.fr>
471
472 * src/options.h, src/options.c (create_long_option_table): Rename
473 as...
474 (long_option_table_new): this, with a clearer prototype.
475 (percent_table): Remove, unused,
476 * src/getargs.c (getargs): Adjust.
477
29e88316
AD
4782001-12-29 Akim Demaille <akim@epita.fr>
479
480 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
481 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
482 as states.
483
b9f71f19
AD
4842001-12-29 Akim Demaille <akim@epita.fr>
485
486 * src/lalr.c (build_relations): Rename `states' as `states1'.
487 Sorry, I don't understand exactly what it is, no better name...
488
1a2b5d37
AD
4892001-12-29 Akim Demaille <akim@epita.fr>
490
491 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
492 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
493 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
494 as rules.
495
1cca533e
AD
4962001-12-29 Akim Demaille <akim@epita.fr>
497
498 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
499 ago.
500
c03ae966
AD
5012001-12-29 Akim Demaille <akim@epita.fr>
502
503 * src/reader.c, src/reader.h (user_toknums): Remove.
504 Adjust all users to use symbols[i]->user_token_number.
505
5a670b1e
AD
5062001-12-29 Akim Demaille <akim@epita.fr>
507
508 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
509 Adjust all users to use symbols[i]->prec or ->assoc.
510
ad949da9
AD
5112001-12-29 Akim Demaille <akim@epita.fr>
512
513 * src/reader.c, src/reader.h (tags): Remove.
514 Adjust all users to use symbols[i]->tag.
515
0e78e603
AD
5162001-12-29 Akim Demaille <akim@epita.fr>
517
518 * src/gram.h, src/gram.c (symbols): New, similar to state_table
519 and rule_table.
520 * src/reader.c (packsymbols): Fill this table.
521 Drop sprec.
522 * src/conflicts.c (resolve_sr_conflict): Adjust.
523 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
524 single table.
525 Use symbols[i]->tag instead of tags[i].
526
213e640e
AD
5272001-12-29 Akim Demaille <akim@epita.fr>
528
529 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
530 In addition, put a comment in there, to replace...
531 * tests/regression.at (%union and C comments): Remove.
532
e7b8bef1
AD
5332001-12-29 Akim Demaille <akim@epita.fr>
534
535 * tests/regression.at (Web2c Actions): Blindly move the actual
536 output as expected output. The contents *seem* right to me, but I
537 can't pretend reading perfectly parser tables... Nonetheless, all
538 the other tests pass correctly, the table look OK, even though the
539 presence of `$axiom' is to be noted: AFAICS it is useless (but
540 harmless).
541
b68e7744
AD
5422001-12-29 Akim Demaille <akim@epita.fr>
543
544 * src/reader.c (readgram): Don't add the rule 0 if there were no
545 rules read. In other words, add it _after_ having performed
546 grammar sanity checks.
547 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
548
78d5bae9
AD
5492001-12-29 Akim Demaille <akim@epita.fr>
550
551 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
552 visible, and some states have now a different number.
553
ff442794
AD
5542001-12-29 Akim Demaille <akim@epita.fr>
555
556 * src/reader.c (readgram): Bind the initial rule's lineno to that
557 of the first rule.
558 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
559 (Solved SR Conflicts): Adjust rule 0's line number.
560
610ab194
AD
5612001-12-29 Akim Demaille <akim@epita.fr>
562
563 Fix the `GAWK Grammar' failure.
564
565 * src/LR0.c (final_state): Initialize to -1 so that we do compute
566 the reductions of the first state which was mistakenly confused
567 with the final state because precisely final_state was initialized
568 to 0.
569 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
570 now noticed by Bison.
571 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
572 have a reduction on $default.
573
29d29c8f
AD
5742001-12-29 Akim Demaille <akim@epita.fr>
575
576 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
577 rule line numbers.
578 * src/closure.c (print_closure): Likewise.
579 * src/derives.c (print_derives): Likewise.
580 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
581 now.
582
7c6b64d0
AD
5832001-12-29 Akim Demaille <akim@epita.fr>
584
585 * src/lalr.c (lookaheads_print): New.
586 (lalr): Call it when --trace-flag.
587 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
588 are dumped.
589
3d4daee3
AD
5902001-12-29 Akim Demaille <akim@epita.fr>
591
592 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
593 when walking through ritem, even via rule->rhs.
594 * src/reduce.c (dump_grammar, useful_production, reduce_output)
595 (useful_production, useless_nonterminals): Likewise.
596 (reduce_grammar_tables): Likewise, plus update nritems.
597 * src/nullable.c (set_nullable): Likewise.
598 * src/lalr.c (build_relations): Likewise.
599 * tests/sets.at (Nullable): Adjust.
600 Fortunately, now, the $axiom is no longer nullable.
601
9e7f6bbd
AD
6022001-12-29 Akim Demaille <akim@epita.fr>
603
604 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
605 the 0-sentinel.
606 * src/gram.c (ritem_longest_rhs): Likewise.
607 * src/reduce.c (nonterminals_reduce): Likewise.
608 * src/print_graph.c (print_graph): Likewise.
609 * src/output.c (output_rule_data): Likewise.
610 * src/nullable.c (set_nullable): Likewise.
611
255ef638
AD
6122001-12-29 Akim Demaille <akim@epita.fr>
613
614 * src/output.c: Comment changes.
615
0d8a7363
AD
6162001-12-27 Paul Eggert <eggert@twinsun.com>
617
618 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
619 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
620 Sparc, as they were causing more porting problems than the
621 (minor) performance improvement was worth.
622
623 Also, catch up with 1.31's YYSTD.
624
3db472b9
AD
6252001-12-27 Akim Demaille <akim@epita.fr>
626
627 * src/output.c (output_gram): Rely on nritems, not the
628 0-sentinel. See below.
629 Use -1 as separator, not 0.
630 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
631 Rely on -1 as separator in yyrhs, instead of 0.
632 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
633 twice `Now at end of input', therefore there are two lines less to
634 expect.
635
b365aa05
AD
6362001-12-27 Akim Demaille <akim@epita.fr>
637
638 * tests/regression.at (Unresolved SR Conflicts):
639 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
640 below.
641
30171f79
AD
6422001-12-27 Akim Demaille <akim@epita.fr>
643
644 * src/LR0.c (new_state): Recognize the final state by the fact it
645 is reached by eoftoken.
646 (insert_start_shifting_state, insert_eof_shifting_state)
647 (insert_accepting_state, augment_automaton): Remove, since now
648 these states are automatically computed from the initial state.
649 (generate_states): Adjust.
650 * src/print.c: When reporting a rule number to the user, substract
651 1, so that the axiom rule is rule 0, and the first user rule is 1.
652 * src/reduce.c: Likewise.
653 * src/print_graph.c (print_core): For the time being, just as for
654 the report, depend upon --trace-flags to dump the full set of
655 items.
656 * src/reader.c (readgram): Once the grammar read, insert the rule
657 0: `$axiom: START-SYMBOL $'.
658 * tests/set.at: Adjust: rule 0 is now displayed, and since the
659 number of the states has changed (the final state is no longer
660 necessarily the last), catch up.
661
75142d45
AD
6622001-12-27 Akim Demaille <akim@epita.fr>
663
664 Try to make the use of the eoftoken valid. Given that its value
665 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
666 is used instead of > 0 where appropriate, (ii), depend upon nritems
667 instead of the 0-sentinel.
668
669 * src/gram.h, src/gram.c (nritems): New.
670 Expected to be duplication of nitems, but for the time being...
671 * src/reader.c (packgram): Assert nritems and nitems are equal.
672 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
673 * src/closure.c (print_closure, print_fderives): Likewise.
674 * src/gram.c (ritem_print): Likewise.
675 * src/print.c (print_core, print_grammar): Likewise.
676 * src/print_graph.c: Likewise.
677
b7c49edf
AD
6782001-12-27 Akim Demaille <akim@epita.fr>
679
680 * src/main.c (main): If there are complains after grammar
681 reductions, then output the report anyway if requested, then die.
682 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
683 * src/reader.c (eoftoken): New.
684 (parse_token_decl): If the token being defined has value `0', it
685 is the eoftoken.
686 (packsymbols): No longer hack `tags' to insert `$' by hand.
687 Be sure to preserve the value of the eoftoken.
688 (reader): Make sure eoftoken is defined.
689 Initialize nsyms to 0: now eoftoken is created just like the others.
690 * src/print.c (print_grammar): Don't special case the eof token.
691 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
692 lie anyway, albeit pleasant.
693 * tests/calc.at: Exercise error messages with eoftoken.
694 Change the grammar so that empty input is invalid.
695 Adjust expectations.
696 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
697
ec2da99f
AD
6982001-12-27 Akim Demaille <akim@epita.fr>
699
700 * configure.in: Check the protos of strchr ans strspn.
701 Replace strchr if needed.
702 * src/system.h: Provide the protos of strchr, strspn and memchr if
703 missing.
704 * lib/strchr.c: New.
705 * src/reader.c (symbols_save): Use strchr.
706
8adfa272
AD
7072001-12-27 Akim Demaille <akim@epita.fr>
708
709 * src/print.c, src/print_graph.c (escape): New.
710 Use it to quote the TAGS outputs.
711 * src/print_graph.c (print_state): Now errors are in red, and
712 reductions in green.
713 Prefer high to wide: output the state number on a line of its own.
714
80dac38c
AD
7152001-12-27 Akim Demaille <akim@epita.fr>
716
717 * src/state.h, src/state.c (reductions_new): New.
718 * src/LR0.c (set_state_table): Let all the states have a
719 `reductions', even if reduced to 0.
720 (save_reductions): Adjust.
721 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
722 * src/print.c (print_reductions, print_actions): Adjust.
723 * src/output.c (action_row): Adjust.
724
2cec70b9
AD
7252001-12-27 Akim Demaille <akim@epita.fr>
726
727 * src/state.h, src/state.c (errs_new, errs_dup): New.
728 * src/LR0.c (set_state_table): Let all the states have an errs,
729 even if reduced to 0.
730 * src/print.c (print_errs, print_reductions): Adjust.
731 * src/output.c (output_actions, action_row): Adjust.
732 * src/conflicts.c (resolve_sr_conflict): Adjust.
733
13ca549a
AD
7342001-12-27 Akim Demaille <akim@epita.fr>
735
736 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
737
5092aba5
AD
7382001-12-27 Akim Demaille <akim@epita.fr>
739
740 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
741 * src/print.c: here.
742 (lookaheadset, shiftset): New, used as additional storage by
743 print_reductions.
744 (print_results): Adjust.
745 (print_shifts, print_gotos, print_errs): New, extracted from...
746 (print_actions): here.
747 * src/print_graph.c (print_actions): Remove dead code.
748
11e2beca
AD
7492001-12-27 Akim Demaille <akim@epita.fr>
750
751 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
752 `$n' and `@n'.
753
dac3c910
AD
7542001-12-27 Akim Demaille <akim@epita.fr>
755
756 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
757 (build_relations): Adjust.
758
d0b0fefa
AD
7592001-12-27 Akim Demaille <akim@epita.fr>
760
761 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
762 duplication.
763
adc8c848
AD
7642001-12-27 Akim Demaille <akim@epita.fr>
765
766 * src/reader.c (packgram): Catch nitems overflows.
767
14d293ac
AD
7682001-12-27 Akim Demaille <akim@epita.fr>
769
770 * src/files.c, src/files.h (guard_obstack): Remove.
771 * src/output.c (output): Adjust.
772 * src/reader.c (parse_braces): New, factoring...
773 (copy_action, copy_guard): these two which are renamed as...
774 (parse_action, parse_guard): these.
775 As a voluntary consequence, using braces around guards is now
776 mandatory.
777
f499b062
AD
7782001-12-27 Akim Demaille <akim@epita.fr>
779
780 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
781 * src/reader.c (symbol_list): `guard' and `guard_line' are new
782 members.
783 (symbol_list_new): Adjust.
784 (copy_action): action_line is the first line, not the last.
785 (copy_guard): Just as for actions, store the `action' only, not
786 the switch/case/break flesh.
787 Don't parse the user action that might follow the guard, let...
788 (readgram): do it, i.e., now, there can be an action after a
789 guard.
790 In other words the guard is just explicitly optional.
791 (packgram): Adjust.
792 * src/output.c (guards_output): New.
793 (output_parser): Call it when needed.
794 (output): Also free the guard and attrs obstacks.
795 * src/files.c, src/files.h (obstack_save): Remove.
796 (output_files): Remove.
797 As a result, if one needs the former `.act' file, using an
798 appropriate skeleton which requires actions and guards is now
799 required.
800 * src/main.c (main): Adjust.
801 * tests/semantic.at: New.
802 * tests/regression.at: Use `input.y' as input file name.
803 Avoid 8+3 problems by requiring input.c when the test needs the
804 parser.
805
d945f5cd
AD
8062001-12-27 Akim Demaille <akim@epita.fr>
807
808 * src/reader.c (symbol_list_new): Be sure to initialize all the
809 fields.
810
d200e455
AD
8112001-12-27 Akim Demaille <akim@epita.fr>
812
813 All the hacks using a final pseudo state are now useless.
814
815 * src/LR0.c (set_state_table): state_table holds exactly nstates.
816 * src/lalr.c (nLA): New.
817 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
818 instead of lookaheadsp from the pseudo state (nstate + 1).
819
f9507c28
AD
8202001-12-27 Akim Demaille <akim@epita.fr>
821
822 * src/output.c (action_row, token_actions): Use a state_t instead
823 of a integer, and nlookaheads instead of the following state's
824 lookaheadsp.
825
065fbd27
AD
8262001-12-27 Akim Demaille <akim@epita.fr>
827
828 * src/conflicts.c (log_resolution, flush_shift)
829 (resolve_sr_conflict, set_conflicts, solve_conflicts)
830 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
831 (conflicts_print, print_reductions): Use a state_t instead of an
832 integer when referring to a state.
833 As much as possible, depend upon nlookaheads, instead of the
834 `lookaheadsp' member of the following state (since lookaheads of
835 successive states are successive, the difference between state n + 1
836 and n served as the number of lookaheads for state n).
837 * src/lalr.c (add_lookback_edge): Likewise.
838 * src/print.c (print_core, print_actions, print_state)
839 (print_results): Likewise.
840 * src/print_graph.c (print_core, print_actions, print_state)
841 (print_graph): Likewise.
842 * src/conflicts.h: Adjust.
843
1b177bd7
AD
8442001-12-27 Akim Demaille <akim@epita.fr>
845
846 * src/bison.hairy: Formatting/comment changes.
847 ANSIfy.
848 Remove `register' indications.
849 Add plenty of `static'.
850
7742ddeb
AD
8512001-12-27 Akim Demaille <akim@epita.fr>
852
853 * src/output.c (prepare): Drop the muscle `ntbase' which
854 duplicates ntokens.
855 * src/bison.simple: Formatting/comment changes.
856 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
857 is an undocumented synonym.
858
1fa14068
AD
8592001-12-22 Akim Demaille <akim@epita.fr>
860
861 * src/output.c (output_table_data): Change the prototype to use
862 `int' for array ranges: some invocations do pass an int, not a
863 short.
864 Reported by Wayne Green.
865
b9752825
AD
8662001-12-22 Akim Demaille <akim@epita.fr>
867
868 Some actions of web2c.y are improperly triggered.
869 Reported by Mike Castle.
870
871 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
872 * tests/regression.at (Web2c): Rename as...
873 (Web2c Report): this.
874 (Web2c Actions): New.
875
776209d6
AD
8762001-12-22 Akim Demaille <akim@epita.fr>
877
878 Reductions in web2c.y are improperly reported.
879 Reported by Mike Castle.
880
881 * src/conflicts.c (print_reductions): Fix.
882 * tests/regression.at (Web2c): New.
883
275fc3ad
AD
8842001-12-18 Akim Demaille <akim@epita.fr>
885
886 Some host fail on `assert (!"foo")', which expands to
887 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
888 Reported by Nelson Beebee.
889
890 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
891 `#define it_succeeded 0' and `assert (it_succeeded)'.
892
897668ee
MA
8932001-12-17 Marc Autret <autret_m@epita.fr>
894
895 * src/bison.simple: Don't hard code the skeleton line and filename.
896 * src/output.c (output_parser): Rename 'line' as 'output_line'.
897 New line counter 'skeleton_line' (skeleton-line muscle).
898
ab3399e0
PE
8992001-12-17 Paul Eggert <eggert@twinsun.com>
900
901 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
902 YYDEBUG must be defined to a nonzero value.
903
904 * src/bison.simple (yytname): Do not assume that the user defines
905 YYDEBUG to a properly parenthesized expression.
906
3877f72b
AD
9072001-12-17 Akim Demaille <akim@epita.fr>
908
909 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
910 nlookaheads is a new member.
911 Adjust all users.
912 * src/lalr.h (nlookaheads): Remove this orphan declaration.
913 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
914 state.
776209d6 915
331dbc1b
AD
9162001-12-17 Akim Demaille <akim@epita.fr>
917
918 * src/files.h, src/files.c (open_files, close_files): Remove.
919 * src/main.c (main): Don't open/close files, nor invoke lex_free,
920 let...
921 * src/reader.c (reader): Do it.
776209d6 922
be750e4c
AD
9232001-12-17 Akim Demaille <akim@epita.fr>
924
925 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 926
709ae8c6
AD
9272001-12-17 Akim Demaille <akim@epita.fr>
928
929 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
930 (flush_reduce): New.
931 (resolve_sr_conflict): Adjust.
776209d6 932
f87685c3
AD
9332001-12-17 Akim Demaille <akim@epita.fr>
934
935 * src/output.c (output_obstack): Be static and rename as...
936 (format_obstack): this, to avoid any confusion with files.c's
937 output_obstack.
938 * src/reader.h (muscle_obstack): Move to...
939 * src/output.h: here, since it's defined in output.c.
940
837491d8
AD
9412001-12-17 Akim Demaille <akim@epita.fr>
942
943 * src/output.c (action_row, save_column, default_goto)
944 (sort_actions, matching_state, pack_vector): Better variable
945 locality.
946
796d61fb
AD
9472001-12-17 Akim Demaille <akim@epita.fr>
948
949 * src/output.c: Various formatting changes.
776209d6 950
64d15509
AD
9512001-12-17 Akim Demaille <akim@epita.fr>
952
953 * src/files.c (output_files): Free the output_obstack.
954 * src/main.c (main): Call print and print_graph conditionally.
955 * src/print.c (print): Work unconditionally.
956 * src/print_graph.c (print_graph): Work unconditionally.
957 * src/conflicts.c (log_resolution): Output only if verbose_flag.
958
fbc8ecb7
MA
9592001-12-16 Marc Autret <autret_m@epita.fr>
960
961 * src/output.c (actions_output): Fix. When we use %no-lines,
962 there is one less line per action.
963
f0440388
MA
9642001-12-16 Marc Autret <autret_m@epita.fr>
965
966 * src/bison.simple: Remove a useless #line directive.
967 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
968 * src/output.c (get_lines_number): New.
776209d6 969 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
970 output muscles.
971 Fix line numbering.
972 (actions_output): Computes the number of lines taken by actions.
973 (output_master_parser): Insert new skeleton which is the name of
974 the output parser file name.
975
a79986b8
MA
9762001-12-15 Marc Autret <autret_m@epita.fr>
977
978 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
979
4ec8e00f
MA
9802001-12-15 Marc Autret <autret_m@epita.fr>
981
982 * src/output.c (output_gram): Keep track of the hairy one.
983
1a4648ff
AD
9842001-12-15 Akim Demaille <akim@epita.fr>
985
986 Make `make distcheck' work.
987
988 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
989 system.h which uses libgettext.h.
990
9c2c67e6
AD
9912001-12-15 Akim Demaille <akim@epita.fr>
992
993 * src/nullable.c (set_nullable): Useless rules must be skipped,
994 otherwise, since we range over their symbols, we might look at a
995 nonterminal which no longer ``exists'', i.e., it is not counted in
996 `nvars', hence we overflow our arrays.
997
93ede233
AD
9982001-12-15 Akim Demaille <akim@epita.fr>
999
1000 The header can also be produced directly, without any obstack!
1001 Yahoo!
1002
1003 * src/files.c, src/files.h (defines_obstack): Remove.
1004 (compute_header_macro): Global.
1005 (defines_obstack_save): Remove.
1006 * src/reader.c (parse_union_decl): No longer output to
1007 defines_obstack: its content can be found in the `stype' muscle
1008 anyway.
1009 (output_token_translations): Merge into...
1010 (symbols_output): this.
1011 Rename as...
1012 (symbols_save): this.
1013 (reader): Adjust.
1014 * src/output.c (header_output): New.
1015 (output): Call it.
1016
2666f928
AD
10172001-12-15 Akim Demaille <akim@epita.fr>
1018
1019 * src/reader.c (parse_union_decl): Instead of handling two obstack
1020 simultaneously, use one to define the `stype' muscle, and use the
1021 value of the latter to fill defines_obstack.
1022 (copy_comment): Remove.
1023 (copy_comment2): Work for a single obstack.
1024 Rename as...
1025 (copy_comment): this.
1026
428046f8
AD
10272001-12-15 Akim Demaille <akim@epita.fr>
1028
1029 * src/lex.c, src/lex.h (xgetc): No longer static.
1030 * src/reader.c (parse_union_decl): Revamp.
1031
ea52d706
AD
10322001-12-15 Akim Demaille <akim@epita.fr>
1033
1034 Still making progress in separating Bison into (i) input, (ii)
1035 process, (iii) output: now we can directly output the parser file
1036 without using table_obstack at all.
1037
1038 * src/files.c, src/files.h (table_obstack): Bye bye.
1039 (parser_file_name): New.
1040 * src/files.c (compute_output_file_names): Compute it.
1041 * src/output.c (actions_output, output_parser)
1042 (output_master_parser): To a file instead of an obstack.
1043
3f96f4dc
AD
10442001-12-15 Akim Demaille <akim@epita.fr>
1045
1046 Attach actions to rules, instead of pre-outputting them to
1047 actions_obstack.
1048
1049 * src/gram.h (rule_t): action and action_line are new members.
1050 * src/reader.c (symbol_list): Likewise.
1051 (copy_action): Save the actions within the rule.
1052 (packgram): Save them in rule_table.
1053 * src/output.c (actions_output): New.
1054 (output_parser): Use it on `%%actions'.
1055 (output_rule_data): Don't free rule_table.
1056 (output): Do it.
1057 (prepare): Don't save the `action' muscle.
1058 * src/bison.simple: s/%%action/%%actions/.
1059
51576fb3
AD
10602001-12-15 Akim Demaille <akim@epita.fr>
1061
1062 * src/reader.c (copy_action): When --yacc, don't append a `;'
1063 to the user action: let it fail if lacking.
dee049eb 1064 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1065
2648a72d
AD
10662001-12-14 Akim Demaille <akim@epita.fr>
1067
1068 * src/lex.c (literalchar): Simply return the char you decoded, non
1069 longer mess around with obstacks and int pointers.
1070 Adjust all callers.
1071
92790e5b
AD
10722001-12-14 Akim Demaille <akim@epita.fr>
1073
1074 * src/lex.c (literalchar): Don't escape the special characters,
1075 just decode them, and keep them as char (before, eol was output as
1076 the 2 char string `\n' etc.).
1077 * src/output.c (output_rule_data): Use quotearg to output the
1078 token strings.
1079
927c1557
PE
10802001-12-13 Paul Eggert <eggert@twinsun.com>
1081
1082 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1083 Do not infringe on the global user namespace when using C++.
1084 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1085 All uses of `fprintf' and `stderr' changed.
1086
1087 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1088
ed8e1f68
AD
10892001-12-13 Akim Demaille <akim@epita.fr>
1090
1091 The computation of nullable is broken: it doesn't handle empty
1092 RHS's properly.
1093
1094 * tests/torture.at (GNU AWK Grammar): New.
1095 * tests/sets.at (Nullable): New.
1096 * src/nullable.c (set_nullable): Instead of blindly looping over
1097 `ritems', loop over the rules, and then over their rhs's.
1098
1099 Work around Autotest bugs.
1100
1101 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1102 frame, because Autotest understand lines starting with a `+' as
1103 traces from the shell. Then, they are not processed properly.
1104 Admittedly an Autotest bug, but we don't have time to wait for
1105 Autotest to catch up.
1106 * tests/regression.at (Broken Closure): Adjust to the new table
1107 frames.
1108 Move to...
1109 * tests/sets.at: here.
1110
cb581495
AD
11112001-12-13 Akim Demaille <akim@epita.fr>
1112
1113 * src/closure.c (closure): Use nrules instead of playing tricks
1114 with BITS_PER_WORD.
1115
2e729273
AD
11162001-12-13 Akim Demaille <akim@epita.fr>
1117
1118 * src/print.c (print_actions): Output the handling of `$' as the
1119 traces do: shifting the token EOF. Before EOF was treated as a
1120 nonterminal.
1121 * tests/regression.at: Adjust some tests.
1122 * src/print_graph.c (print_core): Complete the set of items via
1123 closure. The next-to-final and final states are still unsatisfying,
1124 but that's to be addressed elsewhere.
1125 No longer output the rule numbers, but do output the state number.
1126 A single loop for the shifts + gotos is enough, but picked a
1127 distinct color for each.
1128 (print_graph): Initialize and finalize closure.
1129
107f7dfb
AD
11302001-12-13 Akim Demaille <akim@epita.fr>
1131
1132 * src/reader.c (readgram): Remove dead code, an strip useless
1133 braces.
1134 (get_type): Remove, unused.
1135
9b53a24f
AD
11362001-12-12 Akim Demaille <akim@epita.fr>
1137
1138 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1139 on that of lib/error.c.
1140
dbfb6dcd
AD
11412001-12-12 Akim Demaille <akim@epita.fr>
1142
1143 Some hosts don't like `/' in includes.
1144
1145 * src/system.h: Include libgettext.h without qualifying the path.
1146 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1147 $(top_srcdir).
1148
c25fb648
MA
11492001-12-11 Marc Autret <autret_m@epita.fr>
1150
1151 * src/output.c (output_parser): Remove useless muscle.
1152
710ddc4f
MA
11532001-12-11 Marc Autret <autret_m@epita.fr>
1154
1155 * src/bison.simple: Remove #line just before %%epilogue. It
1156 is now handled in ...
1157 * src/reader.c (read_additionnal_code): Add the output of a
1158 #line for the epilogue.
1159
e83d80b8
MA
11602001-12-10 Marc Autret <autret_m@epita.fr>
1161
927c1557 1162 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1163 replace precedent remove.
1164 * src/bison.simple: Remove #line before %%prologue because
1165 %%input-line is wrong at this time.
1166
971d5158
MA
11672001-12-10 Marc Autret <autret_m@epita.fr>
1168
1169 * src/reader.c (symbols_output): Clean up.
927c1557 1170 * src/output.c (output_gram, output): Clean up.
971d5158 1171
5edafffd
AD
11722001-12-10 Akim Demaille <akim@epita.fr>
1173
1174 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1175 * src/LR0.c (set_state_table): here.
1176 * src/lalr.c (lalr): Call it.
1177
0279f8e9
AD
11782001-12-10 Akim Demaille <akim@epita.fr>
1179
1180 * src/state.h (shifts): Remove the `number' member: shifts are
1181 attached to state, hence no longer need to be labelled with a
1182 state number.
1183
190c4f5f
AD
11842001-12-10 Akim Demaille <akim@epita.fr>
1185
1186 Now that states have a complete set of members, the linked list of
1187 shifts is useless: just fill directly the state's shifts member.
1188
1189 * src/state.h (shifts): Remove the `next' member.
1190 * src/LR0.c (first_state, last_state): Remove.
1191 Adjust the callers.
1192 (augment_automaton): Don't look for the shifts that must be added
1193 a shift on EOF: it is those of the state we looked for! But now,
1194 since shifts are attached, it is no longer needed to looking
1195 merely by its id: its number.
1196
2a73b93d
AD
11972001-12-10 Akim Demaille <akim@epita.fr>
1198
1199 * src/LR0.c (augment_automaton): Better variable locality.
1200 Remove an impossible branch: if there is a state corresponding to
1201 the start symbol being shifted, then there is shift for the start
1202 symbol from the initial state.
1203
74392f6a
AD
12042001-12-10 Akim Demaille <akim@epita.fr>
1205
1206 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1207 only when appropriate: when insert_start_shifting_state' is not
1208 invoked.
1209 * tests/regression.at (Rule Line Numbers): Adjust.
1210
37c82725
AD
12112001-12-10 Akim Demaille <akim@epita.fr>
1212
1213 * src/LR0.c (augment_automaton): Now that all states have shifts,
1214 merge the two cases addition shifts to the initial state.
1215
6a164e0c
AD
12162001-12-10 Akim Demaille <akim@epita.fr>
1217
1218 * src/lalr.c (set_state_table): Move to...
1219 * src/LR0.c: here.
1220 * src/lalr.c (lalr): Don't call it...
1221 * src/LR0.c (generate_states): do it.
1222 * src/LR0.h (first_state): Remove, only the table is used.
1223
7215de24
AD
12242001-12-10 Akim Demaille <akim@epita.fr>
1225
1226 * src/LR0.h (first_shift, first_reduction): Remove.
1227 * src/lalr.c: Don't use first_shift: find shifts through the
1228 states.
1229
80e25d4d
AD
12302001-12-10 Akim Demaille <akim@epita.fr>
1231
1232 * src/LR0.c: Attach shifts to states as soon as they are
1233 computed.
1234 * src/lalr.c (set_state_table): Instead of assigning shifts to
1235 state, just assert that the mapping was properly done.
1236
0ab3728b
AD
12372001-12-10 Akim Demaille <akim@epita.fr>
1238
1239 * src/LR0.c (insert_start_shift): Rename as...
1240 (insert_start_shifting_state): this.
1241 (insert_eof_shifting_state, insert_accepting_state): New.
1242 (augment_automaton): Adjust.
1243 Better locality of the variables.
1244 When looking if the start_symbol is shifted from the initial
1245 state, using `while (... symbol != start_symbol ...)' sounds
1246 better than `while (... symbol < start_symbol ...)': If fail
1247 to see how the order between symbols could be relevant!
1248
78af9bbc
AD
12492001-12-10 Akim Demaille <akim@epita.fr>
1250
1251 * src/getargs.h: Don't declare `spec_name_prefix' and
1252 `spec_file_prefix', declared by src/files.h.
1253 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1254 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1255 * src/output.c (prepare): Adjust.
1256 * src/reader.c (symbols_output): Likewise.
1257 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1258
bdef2a41
AD
12592001-12-10 Akim Demaille <akim@epita.fr>
1260
1261 * src/muscle_tab.c (muscle_init): NULL is a better default than
1262 `"0"'.
1263
3735969c
AD
12642001-12-10 Akim Demaille <akim@epita.fr>
1265
1266 * src/reader.c (reader): Calling symbols_output once is enough.
1267
49701457
AD
12682001-12-10 Akim Demaille <akim@epita.fr>
1269
1270 Now that states have a complete set of members, the linked list of
1271 reductions is useless: just fill directly the state's reductions
1272 member.
1273
1274 * src/state.h (struct reductions): Remove member `number' and
1275 `next'.
1276 * src/LR0.c (first_reduction, last_reduction): Remove.
1277 (save_reductions): Don't link the new reductions, store them in
1278 this_state.
1279 * src/lalr.c (set_state_table): No need to attach reductions to
1280 states, it's already done.
1281 * src/output.c (output_actions): No longer free the shifts, then
1282 the reductions, then the states: free all the states and their
1283 members.
1284
0edad749
AD
12852001-12-10 Akim Demaille <akim@epita.fr>
1286
1287 * src/options.c (OPTN, DRTV, BOTH): New.
1288 (option_table): Use them.
1289
0edad749
AD
1290 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1291 the job of system.h.
1292 * src/options.c: Don't include stdio.h and xalloc.h for the same
1293 reasons.
1294
5449dd0f
AD
12952001-12-10 Akim Demaille <akim@epita.fr>
1296
1297 * src/output.c (output, prepare): Make sure the values of the
1298 muscles `action' and `prologue' are 0-terminated.
1299
a870c567
AD
13002001-12-10 Akim Demaille <akim@epita.fr>
1301
1302 Clean up GCC warnings.
1303
1304 * src/reader.c (copy_action): `buf' is not used.
1305 (parse_skel_decl): Be static.
1306 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1307 * src/options.h (create_long_option_table): Have a real prototype.
1308 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1309 (hash_delete_at): Return const void *.
1310 Adjust casts to preserve the const.
1311
80df8768
AD
13122001-12-10 Akim Demaille <akim@epita.fr>
1313
1314 * configure.in: Require 2.52g.
1315 M4 is not needed, but AUTOM4TE is.
1316 * m4/m4.m4: Remove.
1317 * tests/Makefile.am: Adjust.
1318
f693ad14
AD
13192001-12-10 Akim Demaille <akim@epita.fr>
1320
1321 One structure for states is enough, even though theoretically
1322 there are LR(0) states and LALR(1) states.
1323
1324 * src/lalr.h (state_t): Remove.
1325 (state_table): Be state_t **, not state_t *.
1326 * src/state.h (core, CORE_ALLOC): Rename as...
1327 (state_t, STATE_ALLOC): this.
1328 Add the LALR(1) members: shifts, reductions, errs.
1329 * src/LR0.c (state_table): Rename as...
1330 (state_hash): this, to avoid name clashes with the global
1331 `state_table'.
1332 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1333 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1334
74ffbcb6
AD
13352001-12-10 Akim Demaille <akim@epita.fr>
1336
1337 Bison dumps core on bash.y.
1338 Reported by Pascal Bart.
1339
1340 * src/warshall.c (bitmatrix_print): New.
1341 (TC): Use it.
1342 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1343 j must be the outer loop.
1344 * tests/regression.at (Broken Closure): New.
1345
07708e19
AD
13462001-12-05 Akim Demaille <akim@epita.fr>
1347
1348 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1349 its argument.
1350