]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Regen.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-04-08 Akim Demaille <akim@epita.fr>
2
3 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
4 Adding #line.
5 Remove the duplicate `typedefs'.
6 (RhsNumberType): Fix the declaration and various other typos.
7 Use __ofile__.
8 * data/bison.simple: Use __ofile__.
9 * src/scan-skel.l: Handle __ofile__.
10
112002-04-08 Akim Demaille <akim@epita.fr>
12
13 * src/gram.h (item_number_t): New, the type of item numbers in
14 RITEM. Note that it must be able to code symbol numbers as
15 positive number, and the negation of rule numbers as negative
16 numbers.
17 Adjust all dependencies (pretty many).
18 * src/reduce.c (rule): Remove this `short *' pointer: use
19 item_number_t.
20 * src/system.h (MINSHORT, MAXSHORT): Remove.
21 Include `limits.h'.
22 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
23 (shortcpy): Remove.
24 (MAXTABLE): Move to...
25 * src/output.c (MAXTABLE): here.
26 (prepare_rules): Use output_int_table to output rhs.
27 * data/bison.simple, data/bison.c++: Adjust.
28 * tests/torture.at (Big triangle): Move the limit from 254 to
29 500.
30 * tests/regression.at (Web2c Actions): Ajust.
31
32 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
33 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
34 passes, but produces negative #line number, once fixed, GCC is
35 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
36 C), it passes.
37 * src/state.h (state_h): Code input lines on ints, not shorts.
38
392002-04-08 Akim Demaille <akim@epita.fr>
40
41 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
42 and then the grammar.
43
442002-04-08 Akim Demaille <akim@epita.fr>
45
46 * src/system.h: No longer using strndup.
47
482002-04-07 Akim Demaille <akim@epita.fr>
49
50 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
51 * src/output.c (output_table_data): Return the longest number.
52 (prepare_tokens): Output `token_number_max').
53 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
54 New.
55 Use them to define yy_token_number_type/TokenNumberType.
56 Use this type for yytranslate.
57 * tests/torture.at (Big triangle): Push the limit from 124 to
58 253.
59 * tests/regression.at (Web2c Actions): Adjust.
60
612002-04-07 Akim Demaille <akim@epita.fr>
62
63 * tests/torture.at (Big triangle): New.
64 (GNU AWK Grammar, GNU Cim Grammar): Move to...
65 * tests/existing.at: here.
66
672002-04-07 Akim Demaille <akim@epita.fr>
68
69 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
70 nritems.
71 Adjust dependencies.
72
732002-04-07 Akim Demaille <akim@epita.fr>
74
75 * src/reader.c: Normalize increments to prefix form.
76
772002-04-07 Akim Demaille <akim@epita.fr>
78
79 * src/reader.c, symtab.c: Remove debugging code.
80
812002-04-07 Akim Demaille <akim@epita.fr>
82
83 Rename all the `bucket's as `symbol_t'.
84
85 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
86 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
87 * src/symtab.c, src/symtab.h (bucket): Rename as...
88 (symbol_t): this.
89 (symbol_list_new, bucket_check_defined, bucket_make_alias)
90 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
91 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
92 (buckets_new, buckets_free, buckets_do): Rename as...
93 (symbol_list_new, symbol_check_defined, symbol_make_alias)
94 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
95 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
96 (symbols_new, symbols_free, symbols_do): these.
97
982002-04-07 Akim Demaille <akim@epita.fr>
99
100 Use lib/hash for the symbol table.
101
102 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
103 EOF.
104 * src/lex.c (lex): Set the `number' member of new terminals.
105 * src/reader.c (bucket_check_defined, bucket_make_alias)
106 (bucket_check_alias_consistence, bucket_translation): New.
107 (reader, grammar_free, readgram, token_translations_init)
108 (packsymbols): Adjust.
109 (reader): Number the predefined tokens.
110 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
111 for predefined tokens.
112 * src/symtab.h (bucket): Remove all the hash table related
113 members.
114 * src/symtab.c (symtab): Replace by...
115 (bucket_table): this.
116 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
117 (buckets_new, buckets_do): New.
118
1192002-04-07 Akim Demaille <akim@epita.fr>
120
121 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
122 (start_symbol, max_user_token_number, semantic_parser)
123 (error_token_number): Initialize.
124 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
125 Initialize.
126 (reader): Don't.
127 (errtoken, eoftoken, undeftoken, axiom): Extern.
128
1292002-04-07 Akim Demaille <akim@epita.fr>
130
131 * src/gram.h (rule_s): prec and precsym are now pointers
132 to the bucket giving the priority/associativity.
133 Member `associativity' removed: useless.
134 * src/reduce.c, src/conflicts.c: Adjust.
135
1362002-04-07 Akim Demaille <akim@epita.fr>
137
138 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
139 Properly escape the symbols' TAG when outputting them.
140
1412002-04-07 Akim Demaille <akim@epita.fr>
142
143 * src/lalr.h (LA): Is a bitsetv, not bitset*.
144
1452002-04-07 Akim Demaille <akim@epita.fr>
146
147 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
148 (LArule): this, which is an array to rule_t*.
149 * src/print.c, src/conflicts.c: Adjust.
150
1512002-04-07 Akim Demaille <akim@epita.fr>
152
153 * src/gram.h (rule_t): Rename `number' as `user_number'.
154 `number' is a new member.
155 Adjust dependencies.
156 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
157
1582002-04-07 Akim Demaille <akim@epita.fr>
159
160 As a result of the previous patch, it is no longer needed
161 to reorder ritem itself.
162
163 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
164
1652002-04-07 Akim Demaille <akim@epita.fr>
166
167 Be sure never to walk through RITEMS, but use only data related to
168 the rules themselves. RITEMS should be banished.
169
170 * src/output.c (output_token_translations): Rename as...
171 (prepare_tokens): this.
172 In addition to `translate', prepare the muscles `tname' and
173 `toknum', which were handled by...
174 (output_rule_data): this.
175 Remove, and move the remainder of its outputs into...
176 (prepare_rules): this new routines, which also merges content from
177 (output_gram): this.
178 (prepare_rules): Be sure never to walk through RITEMS.
179 (output_stos): Rename as...
180 (prepare_stos): this.
181 (output): Always invoke prepare_states, after all, just don't use it
182 in the output if you don't need it.
183
1842002-04-07 Akim Demaille <akim@epita.fr>
185
186 * src/LR0.c (new_state): Display `nstates' as the name of the
187 newly created state.
188 Adjust to initialize first_state and last_state if needed.
189 Be sure to distinguish the initial from the final state.
190 (new_states): Create the itemset of the initial state, and use
191 new_state.
192 * src/closure.c (closure): Now that the initial state has its
193 items properly set, there is no need for a special case when
194 creating `ruleset'.
195
196 As a result, now the rule 0, reducing to $axiom, is visible in the
197 outputs. Adjust the test suite.
198
199 * tests/conflicts.at (Solved SR Conflicts)
200 (Unresolved SR Conflicts): Adjust.
201 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
202 * tests/conflicts.at (S/R in initial): New.
203
2042002-04-07 Akim Demaille <akim@epita.fr>
205
206 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
207 the RHS of the rules.
208 * src/output.c (output_gram): Likewise.
209
2102002-04-07 Akim Demaille <akim@epita.fr>
211
212 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
213 bucket.
214 Adjust all dependencies.
215 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
216 `number' of the buckets too.
217 * src/gram.h: Include `symtab.h'.
218 (associativity): Move to...
219 * src/symtab.h: here.
220 No longer include `gram.h'.
221
2222002-04-07 Akim Demaille <akim@epita.fr>
223
224 * src/gram.h, src/gram.c (rules_rhs_length): New.
225 (ritem_longest_rhs): Use it.
226 * src/gram.h (rule_t): `number' is a new member.
227 * src/reader.c (packgram): Set it.
228 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
229 the end of `rules', and count them out of `nrules'.
230 (reduce_output, dump_grammar): Adjust.
231 * src/print.c (print_grammar): It is no longer needed to check for
232 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
233 * tests/reduce.at (Reduced Automaton): New test.
234
2352002-04-07 Akim Demaille <akim@epita.fr>
236
237 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
238 lacking `+ 1' to nrules, Bison reported as useless a token if it
239 was used solely to set the precedence of the last rule...
240
2412002-04-07 Akim Demaille <akim@epita.fr>
242
243 * data/bison.c++, data/bison.simple: Don't output the current file
244 name in #line, to avoid useless diffs between two identical
245 outputs under different names.
246
2472002-04-07 Akim Demaille <akim@epita.fr>
248
249 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
250 Normalize loops to using `< nrules + 1', not `<= nrules'.
251
2522002-04-07 Akim Demaille <akim@epita.fr>
253
254 * TODO: Update.
255
2562002-04-07 Akim Demaille <akim@epita.fr>
257
258 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
259 bucket.value as bucket.number.
260
2612002-04-07 Akim Demaille <akim@epita.fr>
262
263 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
264 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
265 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
266 RHS, instead of being an index in RITEMS.
267
2682002-04-04 Paul Eggert <eggert@twinsun.com>
269
270 * doc/bison.texinfo: Update copyright date.
271 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
272 (Symbols): Warn about running Bison in one character set,
273 but compiling and/or running in an incompatible one.
274 Warn about character code 256, too.
275
2762002-04-03 Paul Eggert <eggert@twinsun.com>
277
278 * src/bison.data (YYSTACK_ALLOC): Depend on whether
279 YYERROR_VERBOSE is nonzero, not whether it is defined.
280
281 Merge changes from bison-1_29-branch.
282
2832002-03-20 Paul Eggert <eggert@twinsun.com>
284
285 Merge fixes from Debian bison_1.34-1.diff.
286
287 * configure.in (AC_PREREQ): 2.53.
288
2892002-03-20 Akim Demaille <akim@epita.fr>
290
291 * src/conflicts.c (log_resolution): Argument `resolution' is const.
292
2932002-03-19 Paul Eggert <eggert@twinsun.com>
294
295 * src/bison.simple (YYCOPY): New macro.
296 (YYSTACK_RELOCATE): Use it.
297 Remove Type arg; no longer needed. All callers changed.
298 (yymemcpy): Remove; no longer needed.
299
300 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
301 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
302
3032002-03-19 Akim Demaille <akim@epita.fr>
304
305 Test and fix the #line outputs.
306
307 * tests/atlocal.at (GCC): New.
308 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
309 (Prologue synch line, ,%union synch line, Postprologue synch line)
310 (Action synch line, Epilogue synch line): New tests.
311 * src/reader.c (parse_union_decl): Define the muscle stype_line.
312 * data/bison.simple, data/bison.c++: Use it.
313
3142002-03-19 Akim Demaille <akim@epita.fr>
315
316 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
317 (Solved SR Conflicts, %expect not enough, %expect right)
318 (%expect too much): Move to...
319 * tests/conflicts.at: this new file.
320
3212002-03-19 Akim Demaille <akim@epita.fr>
322
323 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
324 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
325 that we can move to enums for instance.
326 * src/output.c (token_definitions_output): Output a list of
327 `token-name, token-number' instead of the #define.
328 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
329
3302002-03-14 Akim Demaille <akim@epita.fr>
331
332 Use Gettext 0.11.1.
333
3342002-03-09 Robert Anisko <robert@lrde.epita.fr>
335
336 * data/bison.c++: Make the user able to add members to the generated
337 parser by subclassing.
338
3392002-03-05 Robert Anisko <robert@lrde.epita.fr>
340
341 * src/reader.c (read_additionnal_code): `c' should be an integer, not
342 a character.
343 Reported by Nicolas Tisserand and Nicolas Burrus.
344
3452002-03-04 Robert Anisko <robert@lrde.epita.fr>
346
347 * src/reader.c: Warn about lacking semi-colons, do not complain.
348
3492002-03-04 Robert Anisko <robert@lrde.epita.fr>
350
351 * data/bison.c++: Remove a debug line.
352
3532002-03-04 Robert Anisko <robert@lrde.epita.fr>
354
355 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
356 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
357 provide a default implementation.
358
3592002-03-04 Akim Demaille <akim@epita.fr>
360
361 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
362 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
363 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
364 * tests/semantic.at (Parsing Guards): Similarly.
365 * src/reader.at (readgram): Complain if the last rule is not ended
366 with a semi-colon.
367
3682002-03-04 Akim Demaille <akim@epita.fr>
369
370 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
371 * src/closure.c: here.
372 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
373 RTC.
374 * src/warshall.h, src/warshall.c: Remove.
375 * tests/sets.at (Broken Closure): Adjust.
376
3772002-03-04 Akim Demaille <akim@epita.fr>
378
379 * src/output.c (output_skeleton): tempdir is const.
380 bytes_read is unused.
381
3822002-03-04 Akim Demaille <akim@epita.fr>
383
384 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
385 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
386 Update.
387 From Michael Hayes.
388
3892002-03-04 Akim Demaille <akim@epita.fr>
390
391 * src/closure.c (closure): `r' is unused.
392
3932002-03-04 Akim Demaille <akim@epita.fr>
394
395 * tests/sets.at (Broken Closure): Add the ending `;'.
396 * src/reader.at (readgram): Complain if a rule is not ended with a
397 semi-colon.
398
3992002-03-04 Akim Demaille <akim@epita.fr>
400
401 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
402 (count_sr_conflicts): Use bitset_count.
403 * src/reduce.c (inaccessable_symbols): Ditto.
404 (bits_size): Remove.
405 * src/warshall.h, src/warshall.c: Convert to bitsetv.
406
4072002-03-04 Akim Demaille <akim@epita.fr>
408
409 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
410 * src/reduce.c: Remove the `bitset_zero's following the
411 `bitset_create's, as now it is performed by the latter.
412
4132002-03-04 Akim Demaille <akim@epita.fr>
414
415 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
416 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
417 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
418 latest sources from Michael.
419
4202002-03-04 Akim Demaille <akim@epita.fr>
421
422 * src/output.c (output): Don't free the grammar.
423 * src/reader.c (grammar_free): New.
424 * src/main.c (main): Call it and don't free symtab here.
425
4262002-03-04 Akim Demaille <akim@epita.fr>
427
428 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
429 before returning.
430 Reported by Benoit Perrot.
431
4322002-03-04 Akim Demaille <akim@epita.fr>
433
434 Use bitset operations when possible, not loops over bits.
435
436 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
437 bitset_or.
438 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
439 * src/reduce.c (useless_nonterminals): Formatting changes.
440 * src/warshall.c (TC): Use bitset_or.
441
4422002-03-04 Akim Demaille <akim@epita.fr>
443
444 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
445 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
446 Ditto.
447
4482002-03-04 Akim Demaille <akim@epita.fr>
449
450 * src/lalr.c (F): Now a bitset*.
451 Adjust all dependencies.
452
4532002-03-04 Akim Demaille <akim@epita.fr>
454
455 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
456 Adjust all dependencies.
457
4582002-03-04 Akim Demaille <akim@epita.fr>
459
460 * src/L0.c, src/LR0.h (nstates): Be size_t.
461 Adjust comparisons (signed vs unsigned).
462 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
463 bitset*.
464 Adjust all dependencies.
465
4662002-03-04 Akim Demaille <akim@epita.fr>
467
468 * src/closure.c (firsts): Now, also a bitset.
469 Adjust all dependencies.
470 (varsetsize): Remove, now unused.
471 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
472
4732002-03-04 Akim Demaille <akim@epita.fr>
474
475 * src/print.c: Convert to use bitset.h, not hand coded iterations
476 over ints.
477
4782002-03-04 Akim Demaille <akim@epita.fr>
479
480 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
481
4822002-03-04 Akim Demaille <akim@epita.fr>
483
484 * src/closure.c (ruleset): Be a bitset.
485 (rulesetsize): Remove.
486
4872002-03-04 Akim Demaille <akim@epita.fr>
488
489 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
490 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
491 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
492 * src/closure.c (fderives): Be an array of bitsets.
493
4942002-02-28 Robert Anisko <robert@lrde.epita.fr>
495
496 * data/bison.c++: Merge the two generated headers. Insert a copyright
497 notice in each output file.
498
4992002-02-28 Akim Demaille <akim@epita.fr>
500
501 * data/bison.c++: Copy the prologue of bison.simple to fetch
502 useful M4 definitions, such as b4_header_guard.
503
5042002-02-25 Akim Demaille <akim@epita.fr>
505
506 * src/getargs.c (version): Give the name of the authors, and use a
507 translator friendly scheme for the bgr
508 copyright notice.
509
5102002-02-25 Akim Demaille <akim@epita.fr>
511
512 * src/output.c (header_output): Remove, now handled completely via
513 M4.
514
5152002-02-25 Akim Demaille <akim@epita.fr>
516
517 * m4/m4.m4: New, from CVS Autoconf.
518 * configure.in: Invoke it.
519 * src/output.c (output_skeleton): Use its result instead of the
520 hard coded name.
521
5222002-02-25 Akim Demaille <akim@epita.fr>
523
524 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
525 Fileutils 4.1.5.
526 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
527 * src/output.c (output_skeleton): Use mkstemp to create a real
528 temporary file.
529 Move the filling of `skeleton' and its muscle to...
530 (prepare): here.
531 (output): Move the definition of the prologue muscle to...
532 (prepare): here.
533 * src/system.h (DEFAULT_TMPDIR): New.
534
5352002-02-14 Paul Eggert <eggert@twinsun.com>
536
537 Remove the support for C++ namespace cleanliness; it was
538 causing more problems than it was curing, since it didn't work
539 properly on some nonstandard C++ compilers. This can wait
540 for a proper C++ parser.
541
542 * NEWS: Document this.
543 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
544 of C++, as it's treated like C now.
545 * src/bison.simple (YYSTD): Remove.
546 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
547 Treat C++ just like Standard C instead of trying to support
548 namespace cleanliness.
549
5502002-02-14 Akim Demaille <akim@epita.fr>
551
552 * tests/regression.at (else): Adjust to Andreas' change.
553
5542002-02-14 Akim Demaille <akim@epita.fr>
555
556 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
557
5582002-02-13 Andreas Schwab <schwab@suse.de>
559
560 * src/output.c (output_rule_data): Don't output NULL, it might
561 not be defined yet.
562
5632002-02-11 Robert Anisko <robert@lrde.epita.fr>
564
565 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
566 (Copyright notice): Update.
567
5682002-02-11 Akim Demaille <akim@epita.fr>
569
570 * tests/regression.at (%nonassoc and eof): Don't include
571 nonportable headers.
572
5732002-02-08 Robert Anisko <robert@lrde.epita.fr>
574
575 * data/bison.c++: Correct error recovery. Make the user able to
576 initialize the starting location.
577
5782002-02-07 Akim Demaille <akim@epita.fr>
579
580 * tests/input.at: New.
581
5822002-02-07 Robert Anisko <robert@lrde.epita.fr>
583
584 * data/bison.c++: Replace some direct m4 expansions by constants. Be
585 more consistent when naming methods and variables. Put preprocessor
586 directives around tables only needed for debugging.
587
5882002-02-07 Robert Anisko <robert@lrde.epita.fr>
589
590 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
591 C++ parsers.
592 (yy::b4_name::parse): Use print_.
593
5942002-02-07 Robert Anisko <robert@lrde.epita.fr>
595
596 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
597
5982002-02-07 Robert Anisko <robert@lrde.epita.fr>
599
600 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
601 C++ parsers.
602 (yy::b4_name::parse): Build verbose error messages, and use error_.
603
6042002-02-06 Robert Anisko <robert@lrde.epita.fr>
605
606 * data/bison.c++: Fix m4 quoting in comments.
607
6082002-02-06 Robert Anisko <robert@lrde.epita.fr>
609
610 * data/bison.c++: Adjust the parser code. Fix some muscles that were
611 not expanded by m4.
612
6132002-02-05 Akim Demaille <akim@epita.fr>
614
615 * data/bison.c++: Adjust to the M4 back end.
616 More is certainly needed.
617
6182002-02-05 Akim Demaille <akim@epita.fr>
619
620 Give a try to M4 as a back end.
621
622 * lib/readpipe.c: New, from wdiff.
623 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
624 BISON_HAIRY.
625 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
626 specific values. Now it is m4 that performs the lookup.
627 * src/parse-skel.y: Remove.
628 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
629 * src/output.c (actions_output, guards_output)
630 (token_definitions_output): No longer keeps track of the output
631 line number, hence remove the second argument.
632 (guards_output): Check against the guard member of a rule, not the
633 action member.
634 Adjust callers.
635 (output_skeleton): Don't look for the skeleton location, let m4 do
636 that.
637 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
638 file will be used.
639 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
640 (prepare): Given that for the time being changesyntax is not
641 usable in M4, rename the muscles using `-' to `_'.
642 Define `defines_flag', `output_parser_name' and `output_header_name'.
643 * src/output.h (actions_output, guards_output)
644 (token_definitions_output): Adjust prototypes.
645 * src/scan-skel.l: Instead of scanning the skeletons, it now
646 processes the output of m4: `__oline__' and `#output'.
647 * data/bison.simple: Adjust to be used by M4(sugar).
648 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
649 to date.
650 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
651 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
652 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
653 shamelessly stolen from CVS Autoconf.
654
6552002-02-05 Akim Demaille <akim@epita.fr>
656
657 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
658 * configure.in: Check for the declarations of free and malloc.
659 * src/muscle_tab.c: Adjust.
660
6612002-02-05 Akim Demaille <akim@epita.fr>
662
663 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
664 which have no values.
665
6662002-02-05 Akim Demaille <akim@epita.fr>
667
668 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
669 * data/: here.
670
6712002-01-29 Paul Eggert <eggert@twinsun.com>
672
673 * src/bison.simple (YYSIZE_T): Do not define merely because
674 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
675 On some platforms, <alloca.h> does not declare YYSTD (size_t).
676
6772002-01-27 Akim Demaille <akim@epita.fr>
678
679 Fix `%nonassoc and eof'.
680
681 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
682 which were not properly copied! Replace
683 memcpy (res->errs, src->errs, src->nerrs);
684 with
685 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
686 !!!
687 * tests/regression.at (%nonassoc and eof): Adjust to newest
688 Autotest: `.' is not in the PATH.
689
6902002-01-27 Akim Demaille <akim@epita.fr>
691
692 * tests/sets.at (AT_EXTRACT_SETS): New.
693 (Nullable): Use it.
694 (Firsts): New.
695
6962002-01-26 Akim Demaille <akim@epita.fr>
697
698 * tests/actions.at, tests/calc.at, tests/headers.at,
699 * tests/torture.at: Adjust to the newest Autotest which no longer
700 forces `.' in the PATH.
701
7022002-01-25 Akim Demaille <akim@epita.fr>
703
704 * tests/regression.at (%nonassoc and eof): New.
705 Suggested by Robert Anisko.
706
7072002-01-24 Akim Demaille <akim@epita.fr>
708
709 Bison dumps core when trying to complain about broken input files.
710 Reported by Cris van Pelt.
711
712 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
713 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
714 into...
715 (Invalid inputs): Strengthen: exercise parse_percent_token.
716
7172002-01-24 Robert Anisko <robert.anisko@epita.fr>
718
719 * src/Makefile.am: Add bison.c++.
720 * src/bison.c++: New skeleton.
721
7222002-01-21 Paolo Bonzini <bonzini@gnu.org>
723
724 * po/it.po: New.
725
7262002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
727
728 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
729
7302002-01-20 Marc Autret <marc@gnu.org>
731
732 * src/files.c (compute_output_file_names): Fix
733
7342002-01-20 Marc Autret <marc@gnu.org>
735
736 * tests/output.at: New test.
737 * src/files.c (compute_base_names): Don't map extensions when
738 the YACC flag is set, use defaults.
739 Reported by Evgeny Stambulchik.
740
7412002-01-20 Marc Autret <marc@gnu.org>
742
743 * src/system.h: Need to define __attribute__ away for non-GCC
744 compilers as well (i.e. the vendor C compiler).
745 Suggested by Albert Chin-A-Young.
746
7472002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
748
749 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
750 canonical definition.
751 * src/system.h: Use the canonical definition for PARAMS (avoids
752 a conflict with the macro from lib/hash.h).
753
7542002-01-11 Akim Demaille <akim@epita.fr>
755
756 * configure.in: Use AC_FUNC_STRNLEN.
757 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
758
7592002-01-09 Akim Demaille <akim@epita.fr>
760
761 * src/files.c, src/files.h (output_infix): New.
762 (tab_extension): Remove.
763 (compute_base_names): Compute the former, drop the latter.
764 * src/output.c (prepare): Insert the muscles `output-infix', and
765 `output-suffix'.
766 * src/parse-skel.y (string, string.1): New.
767 (section.header): Use it.
768 (section.yacc): Remove.
769 (prefix): Remove too.
770 * src/scan-skel.l: Adjust.
771 * src/bison.simple, src/bison.hairy: Adjust.
772
7732002-01-09 Akim Demaille <akim@epita.fr>
774
775 * configure.in (WERROR_CFLAGS): Compute it.
776 * src/Makefile.am (CFLAGS): Pass it.
777 * tests/atlocal.in (CFLAGS): Idem.
778 * src/files.c: Fix a few warnings.
779 (get_extension_index): Remove, unused.
780
7812002-01-08 Akim Demaille <akim@epita.fr>
782
783 * src/getargs.c (AS_FILE_NAME): New.
784 (getargs): Use it to convert DOSish file names.
785 * src/files.c (base_name): Rename as full_base_name to avoid
786 clashes with `base_name ()'.
787 (filename_split): New.
788 (compute_base_names): N-th rewrite, using filename_split.
789
7902002-01-08 Akim Demaille <akim@epita.fr>
791
792 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
793 New, stolen from the Fileutils 4.1.
794 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
795 * configure.in: Check for the presence of memrchr, and of its
796 prototype.
797
7982002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
799
800 * lib/hash.h (__P): Added definition for this macro.
801 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
802 BUILT_SOURCES, to ensure they are generated first.
803 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
804 %error-verbose to allow bootstrapping with bison 1.30x.
805
8062002-01-06 Akim Demaille <akim@epita.fr>
807
808 * src/reader.c (parse_braces): Don't fetch the next char, the
809 convention is to fetch on entry.
810 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
811 'switch' without a following semicolon.
812 * tests/regression.at (braces parsing): New.
813
8142002-01-06 Akim Demaille <akim@epita.fr>
815
816 Bison is dead wrong in its RR conflict reports.
817
818 * tests/torture.at (GNU Cim Grammar): New.
819 * src/conflicts.c (count_rr_conflicts): Fix.
820
8212002-01-06 Akim Demaille <akim@epita.fr>
822
823 Creating package.m4 from configure.ac causes too many problems.
824
825 * tests/Makefile.am (package.m4): Create it by hand,
826 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
827
8282002-01-06 Akim Demaille <akim@epita.fr>
829
830 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
831 skeleton.h.
832
8332002-01-04 Paul Eggert <eggert@twinsun.com>
834
835 * doc/bison.texinfo (Debugging):
836 Remove YYSTDERR; it's no longer defined or used.
837 Also, s/cstdio.h/cstdio/.
838
8392002-01-03 Akim Demaille <akim@epita.fr>
840
841 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
842
8432002-01-03 Akim Demaille <akim@epita.fr>
844
845 * src/parse-skel.y (process_skeleton): Don't bind the parser's
846 tracing code to --trace, wait for a better --trace option, with
847 args.
848
8492002-01-03 Akim Demaille <akim@epita.fr>
850
851 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
852 The ISO C++ standard is extremely clear about it: stderr is
853 considered a macro, not a regular symbol (see table 94 `Header
854 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
855 Therefore std:: does not apply to it. It still does with fprintf.
856 Also, s/cstdio.h/cstdio/.
857
8582002-01-03 Akim Demaille <akim@epita.fr>
859
860 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
861 for non system headers.
862
8632002-01-02 Akim Demaille <akim@epita.fr>
864
865 Equip the skeleton chain with location tracking, runtime trace,
866 pure parser and scanner.
867
868 * src/parse-skel.y: Request a pure parser, locations, and prefix
869 renaming.
870 (%union): Having several members with the same type does not help
871 type mismatches, simplify.
872 (YYPRINT, yyprint): New.
873 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
874 (skel_error): this.
875 Handle locations.
876 * src/scan-skel.l: Adjust to these changes.
877 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
878 (LOCATION_PRINT, skel_control_t): New.
879
8802001-12-30 Akim Demaille <akim@epita.fr>
881
882 * src/parse-skel.y: Get rid of the shift/reduce conflict:
883 replace `gb' with BLANKS.
884 * src/scan-skel.l: Adjust.
885
8862001-12-30 Akim Demaille <akim@epita.fr>
887
888 * src/system.h: We don't need nor want bcopy.
889 Throw away MS-DOS crap: we don't need getpid.
890 * configure.in: We don't need strndup. It was even causing
891 problems: because Flex includes the headers *before* us,
892 _GNU_SOURCE is not defined by config.h, and therefore strndup was
893 not visible.
894 * lib/xstrndup.c: New.
895 * src/scan-skel.l: Use it.
896 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
897 * src/parse-skel.y: Use %directives instead of #defines.
898
8992001-12-30 Akim Demaille <akim@epita.fr>
900
901 * src/skeleton.h: New.
902 * src/output.c (output_parser, output_master_parser): Remove, dead
903 code.
904 * src/output.h (get_lines_number, actions_output, guards_output)
905 (token_definitions_output): Prototype them.
906 * src/parse-skel.y: Add the license notice.
907 Include output.h and skeleton.h.
908 (process_skeleton): Returns void, and takes a single parameter.
909 * src/scan-skel.l: Add the license notice.
910 Include skeleton.h.
911 Don't use %option yylineno: it seems that then Flex imagines
912 REJECT has been used, and therefore it won't reallocate its
913 buffers (which makes no other sense to me than a bug). It results
914 in warnings for `unused: yy_flex_realloc'.
915
9162001-12-30 Robert Anisko <robert.anisko@epita.fr>
917
918 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
919 (MUSCLE_INSERT_PREFIX): ...to there.
920 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
921 (MUSCLE_INSERT_PREFIX): Move from here...
922
923 * src/bison.hairy: Add a section directive. Put braces around muscle
924 names. This parser skeleton is still broken, but Bison should not
925 choke on a bad muscle 'syntax'.
926 * src/bison.simple: Add a section directive. Put braces around muscle
927 names.
928
929 * src/files.h (strsuffix, stringappend): Add declarations.
930 (tab_extension): Add declaration.
931 (short_base_name): Add declaration.
932
933 * src/files.c (strsuffix, stringappend): No longer static. These
934 functions are used in the skeleton parser.
935 (tab_extension): New.
936 (compute_base_names): Use the computations done in this function
937 to guess if the generated parsers should have '.tab' in their
938 names.
939 (short_base_name): No longer static.
940
941 * src/output.c (output_skeleton): New.
942 (output): Disable call to output_master_parser, and give a try to
943 a new skeleton handling system.
944 (guards_output, actions_output): No longer static.
945 (token_definitions_output, get_lines_number): No longer static.
946
947 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
948
949 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
950 parse-skel.y.
951
952 * src/parse-skel.y: New file.
953 * src/scan-skel.l: New file.
954
9552001-12-29 Akim Demaille <akim@epita.fr>
956
957 %name-prefix is broken.
958
959 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
960 Adjust all dependencies.
961 * tests/headers.at (export YYLTYPE): Strengthen this test: use
962 %name-prefix.
963
964 Renaming yylval but not yylloc is not consistent. Now we do.
965
966 * src/bison.simple: Prefix yylloc if used.
967 * doc/bison.texinfo (Decl Summary): Document that.
968
9692001-12-29 Akim Demaille <akim@epita.fr>
970
971 * doc/bison.texinfo: Promote `%long-directive' over
972 `%long_directive'.
973 Remove all references to fixed-output-files, yacc is enough.
974
9752001-12-29 Akim Demaille <akim@epita.fr>
976
977 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
978 user prologue. These are defaults.
979 * tests/actions.at (Mid-rule actions): Make sure the user can
980 define YYDEBUG and YYERROR_VERBOSE.
981
9822001-12-29 Akim Demaille <akim@epita.fr>
983
984 * src/output.c (header_output): Don't forget to export YYLTYPE and
985 yylloc.
986 * tests/headers.at (export YYLTYPE): New, make sure it does.
987 * tests/regression.at (%union and --defines, Invalid CPP headers):
988 Move to...
989 * tests/headers.at: here.
990
9912001-12-29 Akim Demaille <akim@epita.fr>
992
993 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
994
9952001-12-29 Akim Demaille <akim@epita.fr>
996
997 * tests/actions.at (Mid-rule actions): Output on a single line
998 instead of several.
999
10002001-12-29 Akim Demaille <akim@epita.fr>
1001
1002 * doc/bison.texinfo: Formatting changes.
1003
10042001-12-29 Akim Demaille <akim@epita.fr>
1005
1006 Don't store the token defs in a muscle, just be ready to output it
1007 on command. Now possible via `symbols'. Fixes a memory leak.
1008
1009 * src/output.c (token_definitions_output): New.
1010 (output_parser, header_output): Use it.
1011 * src/reader.c (symbols_save): Remove.
1012
10132001-12-29 Akim Demaille <akim@epita.fr>
1014
1015 * src/bison.simple: Do not provide a default for YYSTYPE and
1016 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1017 default.
1018
10192001-12-29 Akim Demaille <akim@epita.fr>
1020
1021 Mid-rule actions are simply... ignored!
1022
1023 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1024 the empty-rule associated to the dummy symbol, not to the host
1025 rule.
1026 * tests/actions.at (Mid-rule actions): New.
1027
10282001-12-29 Akim Demaille <akim@epita.fr>
1029
1030 Memory leak.
1031
1032 * src/reader.c (reader): Free grammar.
1033
10342001-12-29 Akim Demaille <akim@epita.fr>
1035
1036 Memory leak.
1037
1038 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1039 since it allocates it for each state, although only one is needed.
1040 (allocate_storage): Do it here.
1041
10422001-12-29 Akim Demaille <akim@epita.fr>
1043
1044 * src/options.h, src/options.c (create_long_option_table): Rename
1045 as...
1046 (long_option_table_new): this, with a clearer prototype.
1047 (percent_table): Remove, unused,
1048 * src/getargs.c (getargs): Adjust.
1049
10502001-12-29 Akim Demaille <akim@epita.fr>
1051
1052 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1053 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1054 as states.
1055
10562001-12-29 Akim Demaille <akim@epita.fr>
1057
1058 * src/lalr.c (build_relations): Rename `states' as `states1'.
1059 Sorry, I don't understand exactly what it is, no better name...
1060
10612001-12-29 Akim Demaille <akim@epita.fr>
1062
1063 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1064 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1065 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1066 as rules.
1067
10682001-12-29 Akim Demaille <akim@epita.fr>
1069
1070 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1071 ago.
1072
10732001-12-29 Akim Demaille <akim@epita.fr>
1074
1075 * src/reader.c, src/reader.h (user_toknums): Remove.
1076 Adjust all users to use symbols[i]->user_token_number.
1077
10782001-12-29 Akim Demaille <akim@epita.fr>
1079
1080 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1081 Adjust all users to use symbols[i]->prec or ->assoc.
1082
10832001-12-29 Akim Demaille <akim@epita.fr>
1084
1085 * src/reader.c, src/reader.h (tags): Remove.
1086 Adjust all users to use symbols[i]->tag.
1087
10882001-12-29 Akim Demaille <akim@epita.fr>
1089
1090 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1091 and rule_table.
1092 * src/reader.c (packsymbols): Fill this table.
1093 Drop sprec.
1094 * src/conflicts.c (resolve_sr_conflict): Adjust.
1095 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1096 single table.
1097 Use symbols[i]->tag instead of tags[i].
1098
10992001-12-29 Akim Demaille <akim@epita.fr>
1100
1101 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1102 In addition, put a comment in there, to replace...
1103 * tests/regression.at (%union and C comments): Remove.
1104
11052001-12-29 Akim Demaille <akim@epita.fr>
1106
1107 * tests/regression.at (Web2c Actions): Blindly move the actual
1108 output as expected output. The contents *seem* right to me, but I
1109 can't pretend reading perfectly parser tables... Nonetheless, all
1110 the other tests pass correctly, the table look OK, even though the
1111 presence of `$axiom' is to be noted: AFAICS it is useless (but
1112 harmless).
1113
11142001-12-29 Akim Demaille <akim@epita.fr>
1115
1116 * src/reader.c (readgram): Don't add the rule 0 if there were no
1117 rules read. In other words, add it _after_ having performed
1118 grammar sanity checks.
1119 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1120
11212001-12-29 Akim Demaille <akim@epita.fr>
1122
1123 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1124 visible, and some states have now a different number.
1125
11262001-12-29 Akim Demaille <akim@epita.fr>
1127
1128 * src/reader.c (readgram): Bind the initial rule's lineno to that
1129 of the first rule.
1130 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1131 (Solved SR Conflicts): Adjust rule 0's line number.
1132
11332001-12-29 Akim Demaille <akim@epita.fr>
1134
1135 Fix the `GAWK Grammar' failure.
1136
1137 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1138 the reductions of the first state which was mistakenly confused
1139 with the final state because precisely final_state was initialized
1140 to 0.
1141 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1142 now noticed by Bison.
1143 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1144 have a reduction on $default.
1145
11462001-12-29 Akim Demaille <akim@epita.fr>
1147
1148 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1149 rule line numbers.
1150 * src/closure.c (print_closure): Likewise.
1151 * src/derives.c (print_derives): Likewise.
1152 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1153 now.
1154
11552001-12-29 Akim Demaille <akim@epita.fr>
1156
1157 * src/lalr.c (lookaheads_print): New.
1158 (lalr): Call it when --trace-flag.
1159 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1160 are dumped.
1161
11622001-12-29 Akim Demaille <akim@epita.fr>
1163
1164 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1165 when walking through ritem, even via rule->rhs.
1166 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1167 (useful_production, useless_nonterminals): Likewise.
1168 (reduce_grammar_tables): Likewise, plus update nritems.
1169 * src/nullable.c (set_nullable): Likewise.
1170 * src/lalr.c (build_relations): Likewise.
1171 * tests/sets.at (Nullable): Adjust.
1172 Fortunately, now, the $axiom is no longer nullable.
1173
11742001-12-29 Akim Demaille <akim@epita.fr>
1175
1176 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1177 the 0-sentinel.
1178 * src/gram.c (ritem_longest_rhs): Likewise.
1179 * src/reduce.c (nonterminals_reduce): Likewise.
1180 * src/print_graph.c (print_graph): Likewise.
1181 * src/output.c (output_rule_data): Likewise.
1182 * src/nullable.c (set_nullable): Likewise.
1183
11842001-12-29 Akim Demaille <akim@epita.fr>
1185
1186 * src/output.c: Comment changes.
1187
11882001-12-27 Paul Eggert <eggert@twinsun.com>
1189
1190 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1191 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1192 Sparc, as they were causing more porting problems than the
1193 (minor) performance improvement was worth.
1194
1195 Also, catch up with 1.31's YYSTD.
1196
11972001-12-27 Akim Demaille <akim@epita.fr>
1198
1199 * src/output.c (output_gram): Rely on nritems, not the
1200 0-sentinel. See below.
1201 Use -1 as separator, not 0.
1202 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1203 Rely on -1 as separator in yyrhs, instead of 0.
1204 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1205 twice `Now at end of input', therefore there are two lines less to
1206 expect.
1207
12082001-12-27 Akim Demaille <akim@epita.fr>
1209
1210 * tests/regression.at (Unresolved SR Conflicts):
1211 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1212 below.
1213
12142001-12-27 Akim Demaille <akim@epita.fr>
1215
1216 * src/LR0.c (new_state): Recognize the final state by the fact it
1217 is reached by eoftoken.
1218 (insert_start_shifting_state, insert_eof_shifting_state)
1219 (insert_accepting_state, augment_automaton): Remove, since now
1220 these states are automatically computed from the initial state.
1221 (generate_states): Adjust.
1222 * src/print.c: When reporting a rule number to the user, substract
1223 1, so that the axiom rule is rule 0, and the first user rule is 1.
1224 * src/reduce.c: Likewise.
1225 * src/print_graph.c (print_core): For the time being, just as for
1226 the report, depend upon --trace-flags to dump the full set of
1227 items.
1228 * src/reader.c (readgram): Once the grammar read, insert the rule
1229 0: `$axiom: START-SYMBOL $'.
1230 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1231 number of the states has changed (the final state is no longer
1232 necessarily the last), catch up.
1233
12342001-12-27 Akim Demaille <akim@epita.fr>
1235
1236 Try to make the use of the eoftoken valid. Given that its value
1237 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1238 is used instead of > 0 where appropriate, (ii), depend upon nritems
1239 instead of the 0-sentinel.
1240
1241 * src/gram.h, src/gram.c (nritems): New.
1242 Expected to be duplication of nitems, but for the time being...
1243 * src/reader.c (packgram): Assert nritems and nitems are equal.
1244 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1245 * src/closure.c (print_closure, print_fderives): Likewise.
1246 * src/gram.c (ritem_print): Likewise.
1247 * src/print.c (print_core, print_grammar): Likewise.
1248 * src/print_graph.c: Likewise.
1249
12502001-12-27 Akim Demaille <akim@epita.fr>
1251
1252 * src/main.c (main): If there are complains after grammar
1253 reductions, then output the report anyway if requested, then die.
1254 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1255 * src/reader.c (eoftoken): New.
1256 (parse_token_decl): If the token being defined has value `0', it
1257 is the eoftoken.
1258 (packsymbols): No longer hack `tags' to insert `$' by hand.
1259 Be sure to preserve the value of the eoftoken.
1260 (reader): Make sure eoftoken is defined.
1261 Initialize nsyms to 0: now eoftoken is created just like the others.
1262 * src/print.c (print_grammar): Don't special case the eof token.
1263 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1264 lie anyway, albeit pleasant.
1265 * tests/calc.at: Exercise error messages with eoftoken.
1266 Change the grammar so that empty input is invalid.
1267 Adjust expectations.
1268 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1269
12702001-12-27 Akim Demaille <akim@epita.fr>
1271
1272 * configure.in: Check the protos of strchr ans strspn.
1273 Replace strchr if needed.
1274 * src/system.h: Provide the protos of strchr, strspn and memchr if
1275 missing.
1276 * lib/strchr.c: New.
1277 * src/reader.c (symbols_save): Use strchr.
1278
12792001-12-27 Akim Demaille <akim@epita.fr>
1280
1281 * src/print.c, src/print_graph.c (escape): New.
1282 Use it to quote the TAGS outputs.
1283 * src/print_graph.c (print_state): Now errors are in red, and
1284 reductions in green.
1285 Prefer high to wide: output the state number on a line of its own.
1286
12872001-12-27 Akim Demaille <akim@epita.fr>
1288
1289 * src/state.h, src/state.c (reductions_new): New.
1290 * src/LR0.c (set_state_table): Let all the states have a
1291 `reductions', even if reduced to 0.
1292 (save_reductions): Adjust.
1293 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1294 * src/print.c (print_reductions, print_actions): Adjust.
1295 * src/output.c (action_row): Adjust.
1296
12972001-12-27 Akim Demaille <akim@epita.fr>
1298
1299 * src/state.h, src/state.c (errs_new, errs_dup): New.
1300 * src/LR0.c (set_state_table): Let all the states have an errs,
1301 even if reduced to 0.
1302 * src/print.c (print_errs, print_reductions): Adjust.
1303 * src/output.c (output_actions, action_row): Adjust.
1304 * src/conflicts.c (resolve_sr_conflict): Adjust.
1305
13062001-12-27 Akim Demaille <akim@epita.fr>
1307
1308 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1309
13102001-12-27 Akim Demaille <akim@epita.fr>
1311
1312 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1313 * src/print.c: here.
1314 (lookaheadset, shiftset): New, used as additional storage by
1315 print_reductions.
1316 (print_results): Adjust.
1317 (print_shifts, print_gotos, print_errs): New, extracted from...
1318 (print_actions): here.
1319 * src/print_graph.c (print_actions): Remove dead code.
1320
13212001-12-27 Akim Demaille <akim@epita.fr>
1322
1323 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1324 `$n' and `@n'.
1325
13262001-12-27 Akim Demaille <akim@epita.fr>
1327
1328 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1329 (build_relations): Adjust.
1330
13312001-12-27 Akim Demaille <akim@epita.fr>
1332
1333 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1334 duplication.
1335
13362001-12-27 Akim Demaille <akim@epita.fr>
1337
1338 * src/reader.c (packgram): Catch nitems overflows.
1339
13402001-12-27 Akim Demaille <akim@epita.fr>
1341
1342 * src/files.c, src/files.h (guard_obstack): Remove.
1343 * src/output.c (output): Adjust.
1344 * src/reader.c (parse_braces): New, factoring...
1345 (copy_action, copy_guard): these two which are renamed as...
1346 (parse_action, parse_guard): these.
1347 As a voluntary consequence, using braces around guards is now
1348 mandatory.
1349
13502001-12-27 Akim Demaille <akim@epita.fr>
1351
1352 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1353 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1354 members.
1355 (symbol_list_new): Adjust.
1356 (copy_action): action_line is the first line, not the last.
1357 (copy_guard): Just as for actions, store the `action' only, not
1358 the switch/case/break flesh.
1359 Don't parse the user action that might follow the guard, let...
1360 (readgram): do it, i.e., now, there can be an action after a
1361 guard.
1362 In other words the guard is just explicitly optional.
1363 (packgram): Adjust.
1364 * src/output.c (guards_output): New.
1365 (output_parser): Call it when needed.
1366 (output): Also free the guard and attrs obstacks.
1367 * src/files.c, src/files.h (obstack_save): Remove.
1368 (output_files): Remove.
1369 As a result, if one needs the former `.act' file, using an
1370 appropriate skeleton which requires actions and guards is now
1371 required.
1372 * src/main.c (main): Adjust.
1373 * tests/semantic.at: New.
1374 * tests/regression.at: Use `input.y' as input file name.
1375 Avoid 8+3 problems by requiring input.c when the test needs the
1376 parser.
1377
13782001-12-27 Akim Demaille <akim@epita.fr>
1379
1380 * src/reader.c (symbol_list_new): Be sure to initialize all the
1381 fields.
1382
13832001-12-27 Akim Demaille <akim@epita.fr>
1384
1385 All the hacks using a final pseudo state are now useless.
1386
1387 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1388 * src/lalr.c (nLA): New.
1389 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1390 instead of lookaheadsp from the pseudo state (nstate + 1).
1391
13922001-12-27 Akim Demaille <akim@epita.fr>
1393
1394 * src/output.c (action_row, token_actions): Use a state_t instead
1395 of a integer, and nlookaheads instead of the following state's
1396 lookaheadsp.
1397
13982001-12-27 Akim Demaille <akim@epita.fr>
1399
1400 * src/conflicts.c (log_resolution, flush_shift)
1401 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1402 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1403 (conflicts_print, print_reductions): Use a state_t instead of an
1404 integer when referring to a state.
1405 As much as possible, depend upon nlookaheads, instead of the
1406 `lookaheadsp' member of the following state (since lookaheads of
1407 successive states are successive, the difference between state n + 1
1408 and n served as the number of lookaheads for state n).
1409 * src/lalr.c (add_lookback_edge): Likewise.
1410 * src/print.c (print_core, print_actions, print_state)
1411 (print_results): Likewise.
1412 * src/print_graph.c (print_core, print_actions, print_state)
1413 (print_graph): Likewise.
1414 * src/conflicts.h: Adjust.
1415
14162001-12-27 Akim Demaille <akim@epita.fr>
1417
1418 * src/bison.hairy: Formatting/comment changes.
1419 ANSIfy.
1420 Remove `register' indications.
1421 Add plenty of `static'.
1422
14232001-12-27 Akim Demaille <akim@epita.fr>
1424
1425 * src/output.c (prepare): Drop the muscle `ntbase' which
1426 duplicates ntokens.
1427 * src/bison.simple: Formatting/comment changes.
1428 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1429 is an undocumented synonym.
1430
14312001-12-22 Akim Demaille <akim@epita.fr>
1432
1433 * src/output.c (output_table_data): Change the prototype to use
1434 `int' for array ranges: some invocations do pass an int, not a
1435 short.
1436 Reported by Wayne Green.
1437
14382001-12-22 Akim Demaille <akim@epita.fr>
1439
1440 Some actions of web2c.y are improperly triggered.
1441 Reported by Mike Castle.
1442
1443 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1444 * tests/regression.at (Web2c): Rename as...
1445 (Web2c Report): this.
1446 (Web2c Actions): New.
1447
14482001-12-22 Akim Demaille <akim@epita.fr>
1449
1450 Reductions in web2c.y are improperly reported.
1451 Reported by Mike Castle.
1452
1453 * src/conflicts.c (print_reductions): Fix.
1454 * tests/regression.at (Web2c): New.
1455
14562001-12-18 Akim Demaille <akim@epita.fr>
1457
1458 Some host fail on `assert (!"foo")', which expands to
1459 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1460 Reported by Nelson Beebee.
1461
1462 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1463 `#define it_succeeded 0' and `assert (it_succeeded)'.
1464
14652001-12-17 Marc Autret <autret_m@epita.fr>
1466
1467 * src/bison.simple: Don't hard code the skeleton line and filename.
1468 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1469 New line counter 'skeleton_line' (skeleton-line muscle).
1470
14712001-12-17 Paul Eggert <eggert@twinsun.com>
1472
1473 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1474 YYDEBUG must be defined to a nonzero value.
1475
1476 * src/bison.simple (yytname): Do not assume that the user defines
1477 YYDEBUG to a properly parenthesized expression.
1478
14792001-12-17 Akim Demaille <akim@epita.fr>
1480
1481 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1482 nlookaheads is a new member.
1483 Adjust all users.
1484 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1485 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1486 state.
1487
14882001-12-17 Akim Demaille <akim@epita.fr>
1489
1490 * src/files.h, src/files.c (open_files, close_files): Remove.
1491 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1492 let...
1493 * src/reader.c (reader): Do it.
1494
14952001-12-17 Akim Demaille <akim@epita.fr>
1496
1497 * src/conflicts.c (print_reductions): Formatting changes.
1498
14992001-12-17 Akim Demaille <akim@epita.fr>
1500
1501 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1502 (flush_reduce): New.
1503 (resolve_sr_conflict): Adjust.
1504
15052001-12-17 Akim Demaille <akim@epita.fr>
1506
1507 * src/output.c (output_obstack): Be static and rename as...
1508 (format_obstack): this, to avoid any confusion with files.c's
1509 output_obstack.
1510 * src/reader.h (muscle_obstack): Move to...
1511 * src/output.h: here, since it's defined in output.c.
1512
15132001-12-17 Akim Demaille <akim@epita.fr>
1514
1515 * src/output.c (action_row, save_column, default_goto)
1516 (sort_actions, matching_state, pack_vector): Better variable
1517 locality.
1518
15192001-12-17 Akim Demaille <akim@epita.fr>
1520
1521 * src/output.c: Various formatting changes.
1522
15232001-12-17 Akim Demaille <akim@epita.fr>
1524
1525 * src/files.c (output_files): Free the output_obstack.
1526 * src/main.c (main): Call print and print_graph conditionally.
1527 * src/print.c (print): Work unconditionally.
1528 * src/print_graph.c (print_graph): Work unconditionally.
1529 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1530
15312001-12-16 Marc Autret <autret_m@epita.fr>
1532
1533 * src/output.c (actions_output): Fix. When we use %no-lines,
1534 there is one less line per action.
1535
15362001-12-16 Marc Autret <autret_m@epita.fr>
1537
1538 * src/bison.simple: Remove a useless #line directive.
1539 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1540 * src/output.c (get_lines_number): New.
1541 (output_parser): Adjust, now takes care about the lines of a
1542 output muscles.
1543 Fix line numbering.
1544 (actions_output): Computes the number of lines taken by actions.
1545 (output_master_parser): Insert new skeleton which is the name of
1546 the output parser file name.
1547
15482001-12-15 Marc Autret <autret_m@epita.fr>
1549
1550 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1551
15522001-12-15 Marc Autret <autret_m@epita.fr>
1553
1554 * src/output.c (output_gram): Keep track of the hairy one.
1555
15562001-12-15 Akim Demaille <akim@epita.fr>
1557
1558 Make `make distcheck' work.
1559
1560 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1561 system.h which uses libgettext.h.
1562
15632001-12-15 Akim Demaille <akim@epita.fr>
1564
1565 * src/nullable.c (set_nullable): Useless rules must be skipped,
1566 otherwise, since we range over their symbols, we might look at a
1567 nonterminal which no longer ``exists'', i.e., it is not counted in
1568 `nvars', hence we overflow our arrays.
1569
15702001-12-15 Akim Demaille <akim@epita.fr>
1571
1572 The header can also be produced directly, without any obstack!
1573 Yahoo!
1574
1575 * src/files.c, src/files.h (defines_obstack): Remove.
1576 (compute_header_macro): Global.
1577 (defines_obstack_save): Remove.
1578 * src/reader.c (parse_union_decl): No longer output to
1579 defines_obstack: its content can be found in the `stype' muscle
1580 anyway.
1581 (output_token_translations): Merge into...
1582 (symbols_output): this.
1583 Rename as...
1584 (symbols_save): this.
1585 (reader): Adjust.
1586 * src/output.c (header_output): New.
1587 (output): Call it.
1588
15892001-12-15 Akim Demaille <akim@epita.fr>
1590
1591 * src/reader.c (parse_union_decl): Instead of handling two obstack
1592 simultaneously, use one to define the `stype' muscle, and use the
1593 value of the latter to fill defines_obstack.
1594 (copy_comment): Remove.
1595 (copy_comment2): Work for a single obstack.
1596 Rename as...
1597 (copy_comment): this.
1598
15992001-12-15 Akim Demaille <akim@epita.fr>
1600
1601 * src/lex.c, src/lex.h (xgetc): No longer static.
1602 * src/reader.c (parse_union_decl): Revamp.
1603
16042001-12-15 Akim Demaille <akim@epita.fr>
1605
1606 Still making progress in separating Bison into (i) input, (ii)
1607 process, (iii) output: now we can directly output the parser file
1608 without using table_obstack at all.
1609
1610 * src/files.c, src/files.h (table_obstack): Bye bye.
1611 (parser_file_name): New.
1612 * src/files.c (compute_output_file_names): Compute it.
1613 * src/output.c (actions_output, output_parser)
1614 (output_master_parser): To a file instead of an obstack.
1615
16162001-12-15 Akim Demaille <akim@epita.fr>
1617
1618 Attach actions to rules, instead of pre-outputting them to
1619 actions_obstack.
1620
1621 * src/gram.h (rule_t): action and action_line are new members.
1622 * src/reader.c (symbol_list): Likewise.
1623 (copy_action): Save the actions within the rule.
1624 (packgram): Save them in rule_table.
1625 * src/output.c (actions_output): New.
1626 (output_parser): Use it on `%%actions'.
1627 (output_rule_data): Don't free rule_table.
1628 (output): Do it.
1629 (prepare): Don't save the `action' muscle.
1630 * src/bison.simple: s/%%action/%%actions/.
1631
16322001-12-15 Akim Demaille <akim@epita.fr>
1633
1634 * src/reader.c (copy_action): When --yacc, don't append a `;'
1635 to the user action: let it fail if lacking.
1636 Suggested by Arnold Robbins and Tom Tromey.
1637
16382001-12-14 Akim Demaille <akim@epita.fr>
1639
1640 * src/lex.c (literalchar): Simply return the char you decoded, non
1641 longer mess around with obstacks and int pointers.
1642 Adjust all callers.
1643
16442001-12-14 Akim Demaille <akim@epita.fr>
1645
1646 * src/lex.c (literalchar): Don't escape the special characters,
1647 just decode them, and keep them as char (before, eol was output as
1648 the 2 char string `\n' etc.).
1649 * src/output.c (output_rule_data): Use quotearg to output the
1650 token strings.
1651
16522001-12-13 Paul Eggert <eggert@twinsun.com>
1653
1654 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1655 Do not infringe on the global user namespace when using C++.
1656 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1657 All uses of `fprintf' and `stderr' changed.
1658
1659 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1660
16612001-12-13 Akim Demaille <akim@epita.fr>
1662
1663 The computation of nullable is broken: it doesn't handle empty
1664 RHS's properly.
1665
1666 * tests/torture.at (GNU AWK Grammar): New.
1667 * tests/sets.at (Nullable): New.
1668 * src/nullable.c (set_nullable): Instead of blindly looping over
1669 `ritems', loop over the rules, and then over their rhs's.
1670
1671 Work around Autotest bugs.
1672
1673 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1674 frame, because Autotest understand lines starting with a `+' as
1675 traces from the shell. Then, they are not processed properly.
1676 Admittedly an Autotest bug, but we don't have time to wait for
1677 Autotest to catch up.
1678 * tests/regression.at (Broken Closure): Adjust to the new table
1679 frames.
1680 Move to...
1681 * tests/sets.at: here.
1682
16832001-12-13 Akim Demaille <akim@epita.fr>
1684
1685 * src/closure.c (closure): Use nrules instead of playing tricks
1686 with BITS_PER_WORD.
1687
16882001-12-13 Akim Demaille <akim@epita.fr>
1689
1690 * src/print.c (print_actions): Output the handling of `$' as the
1691 traces do: shifting the token EOF. Before EOF was treated as a
1692 nonterminal.
1693 * tests/regression.at: Adjust some tests.
1694 * src/print_graph.c (print_core): Complete the set of items via
1695 closure. The next-to-final and final states are still unsatisfying,
1696 but that's to be addressed elsewhere.
1697 No longer output the rule numbers, but do output the state number.
1698 A single loop for the shifts + gotos is enough, but picked a
1699 distinct color for each.
1700 (print_graph): Initialize and finalize closure.
1701
17022001-12-13 Akim Demaille <akim@epita.fr>
1703
1704 * src/reader.c (readgram): Remove dead code, an strip useless
1705 braces.
1706 (get_type): Remove, unused.
1707
17082001-12-12 Akim Demaille <akim@epita.fr>
1709
1710 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1711 on that of lib/error.c.
1712
17132001-12-12 Akim Demaille <akim@epita.fr>
1714
1715 Some hosts don't like `/' in includes.
1716
1717 * src/system.h: Include libgettext.h without qualifying the path.
1718 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1719 $(top_srcdir).
1720
17212001-12-11 Marc Autret <autret_m@epita.fr>
1722
1723 * src/output.c (output_parser): Remove useless muscle.
1724
17252001-12-11 Marc Autret <autret_m@epita.fr>
1726
1727 * src/bison.simple: Remove #line just before %%epilogue. It
1728 is now handled in ...
1729 * src/reader.c (read_additionnal_code): Add the output of a
1730 #line for the epilogue.
1731
17322001-12-10 Marc Autret <autret_m@epita.fr>
1733
1734 * src/reader.c (copy_definition): Re-use CPP-outed code which
1735 replace precedent remove.
1736 * src/bison.simple: Remove #line before %%prologue because
1737 %%input-line is wrong at this time.
1738
17392001-12-10 Marc Autret <autret_m@epita.fr>
1740
1741 * src/reader.c (symbols_output): Clean up.
1742 * src/output.c (output_gram, output): Clean up.
1743
17442001-12-10 Akim Demaille <akim@epita.fr>
1745
1746 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1747 * src/LR0.c (set_state_table): here.
1748 * src/lalr.c (lalr): Call it.
1749
17502001-12-10 Akim Demaille <akim@epita.fr>
1751
1752 * src/state.h (shifts): Remove the `number' member: shifts are
1753 attached to state, hence no longer need to be labelled with a
1754 state number.
1755
17562001-12-10 Akim Demaille <akim@epita.fr>
1757
1758 Now that states have a complete set of members, the linked list of
1759 shifts is useless: just fill directly the state's shifts member.
1760
1761 * src/state.h (shifts): Remove the `next' member.
1762 * src/LR0.c (first_state, last_state): Remove.
1763 Adjust the callers.
1764 (augment_automaton): Don't look for the shifts that must be added
1765 a shift on EOF: it is those of the state we looked for! But now,
1766 since shifts are attached, it is no longer needed to looking
1767 merely by its id: its number.
1768
17692001-12-10 Akim Demaille <akim@epita.fr>
1770
1771 * src/LR0.c (augment_automaton): Better variable locality.
1772 Remove an impossible branch: if there is a state corresponding to
1773 the start symbol being shifted, then there is shift for the start
1774 symbol from the initial state.
1775
17762001-12-10 Akim Demaille <akim@epita.fr>
1777
1778 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1779 only when appropriate: when insert_start_shifting_state' is not
1780 invoked.
1781 * tests/regression.at (Rule Line Numbers): Adjust.
1782
17832001-12-10 Akim Demaille <akim@epita.fr>
1784
1785 * src/LR0.c (augment_automaton): Now that all states have shifts,
1786 merge the two cases addition shifts to the initial state.
1787
17882001-12-10 Akim Demaille <akim@epita.fr>
1789
1790 * src/lalr.c (set_state_table): Move to...
1791 * src/LR0.c: here.
1792 * src/lalr.c (lalr): Don't call it...
1793 * src/LR0.c (generate_states): do it.
1794 * src/LR0.h (first_state): Remove, only the table is used.
1795
17962001-12-10 Akim Demaille <akim@epita.fr>
1797
1798 * src/LR0.h (first_shift, first_reduction): Remove.
1799 * src/lalr.c: Don't use first_shift: find shifts through the
1800 states.
1801
18022001-12-10 Akim Demaille <akim@epita.fr>
1803
1804 * src/LR0.c: Attach shifts to states as soon as they are
1805 computed.
1806 * src/lalr.c (set_state_table): Instead of assigning shifts to
1807 state, just assert that the mapping was properly done.
1808
18092001-12-10 Akim Demaille <akim@epita.fr>
1810
1811 * src/LR0.c (insert_start_shift): Rename as...
1812 (insert_start_shifting_state): this.
1813 (insert_eof_shifting_state, insert_accepting_state): New.
1814 (augment_automaton): Adjust.
1815 Better locality of the variables.
1816 When looking if the start_symbol is shifted from the initial
1817 state, using `while (... symbol != start_symbol ...)' sounds
1818 better than `while (... symbol < start_symbol ...)': If fail
1819 to see how the order between symbols could be relevant!
1820
18212001-12-10 Akim Demaille <akim@epita.fr>
1822
1823 * src/getargs.h: Don't declare `spec_name_prefix' and
1824 `spec_file_prefix', declared by src/files.h.
1825 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1826 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1827 * src/output.c (prepare): Adjust.
1828 * src/reader.c (symbols_output): Likewise.
1829 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1830
18312001-12-10 Akim Demaille <akim@epita.fr>
1832
1833 * src/muscle_tab.c (muscle_init): NULL is a better default than
1834 `"0"'.
1835
18362001-12-10 Akim Demaille <akim@epita.fr>
1837
1838 * src/reader.c (reader): Calling symbols_output once is enough.
1839
18402001-12-10 Akim Demaille <akim@epita.fr>
1841
1842 Now that states have a complete set of members, the linked list of
1843 reductions is useless: just fill directly the state's reductions
1844 member.
1845
1846 * src/state.h (struct reductions): Remove member `number' and
1847 `next'.
1848 * src/LR0.c (first_reduction, last_reduction): Remove.
1849 (save_reductions): Don't link the new reductions, store them in
1850 this_state.
1851 * src/lalr.c (set_state_table): No need to attach reductions to
1852 states, it's already done.
1853 * src/output.c (output_actions): No longer free the shifts, then
1854 the reductions, then the states: free all the states and their
1855 members.
1856
18572001-12-10 Akim Demaille <akim@epita.fr>
1858
1859 * src/options.c (OPTN, DRTV, BOTH): New.
1860 (option_table): Use them.
1861
1862 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1863 the job of system.h.
1864 * src/options.c: Don't include stdio.h and xalloc.h for the same
1865 reasons.
1866
18672001-12-10 Akim Demaille <akim@epita.fr>
1868
1869 * src/output.c (output, prepare): Make sure the values of the
1870 muscles `action' and `prologue' are 0-terminated.
1871
18722001-12-10 Akim Demaille <akim@epita.fr>
1873
1874 Clean up GCC warnings.
1875
1876 * src/reader.c (copy_action): `buf' is not used.
1877 (parse_skel_decl): Be static.
1878 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1879 * src/options.h (create_long_option_table): Have a real prototype.
1880 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1881 (hash_delete_at): Return const void *.
1882 Adjust casts to preserve the const.
1883
18842001-12-10 Akim Demaille <akim@epita.fr>
1885
1886 * configure.in: Require 2.52g.
1887 M4 is not needed, but AUTOM4TE is.
1888 * m4/m4.m4: Remove.
1889 * tests/Makefile.am: Adjust.
1890
18912001-12-10 Akim Demaille <akim@epita.fr>
1892
1893 One structure for states is enough, even though theoretically
1894 there are LR(0) states and LALR(1) states.
1895
1896 * src/lalr.h (state_t): Remove.
1897 (state_table): Be state_t **, not state_t *.
1898 * src/state.h (core, CORE_ALLOC): Rename as...
1899 (state_t, STATE_ALLOC): this.
1900 Add the LALR(1) members: shifts, reductions, errs.
1901 * src/LR0.c (state_table): Rename as...
1902 (state_hash): this, to avoid name clashes with the global
1903 `state_table'.
1904 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1905 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1906
19072001-12-10 Akim Demaille <akim@epita.fr>
1908
1909 Bison dumps core on bash.y.
1910 Reported by Pascal Bart.
1911
1912 * src/warshall.c (bitmatrix_print): New.
1913 (TC): Use it.
1914 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1915 j must be the outer loop.
1916 * tests/regression.at (Broken Closure): New.
1917
19182001-12-05 Akim Demaille <akim@epita.fr>
1919
1920 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1921 its argument.
1922