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