]> git.saurik.com Git - bison.git/blame - ChangeLog
* tests/torture.at (Big triangle): New.
[bison.git] / ChangeLog
CommitLineData
817e9f41
AD
12002-04-07 Akim Demaille <akim@epita.fr>
2
3 * tests/torture.at (Big triangle): New.
4 (GNU AWK Grammar, GNU Cim Grammar): Move to...
5 * tests/existing.at: here.
6
5123689b
AD
72002-04-07 Akim Demaille <akim@epita.fr>
8
9 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
10 nritems.
11 Adjust dependencies.
12
13
f3849179
AD
142002-04-07 Akim Demaille <akim@epita.fr>
15
16 * src/reader.c: Normalize increments to prefix form.
17
bd02036a
AD
182002-04-07 Akim Demaille <akim@epita.fr>
19
20 * src/reader.c, symtab.c: Remove debugging code.
21
db8837cb
AD
222002-04-07 Akim Demaille <akim@epita.fr>
23
24 Rename all the `bucket's as `symbol_t'.
25
26 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
27 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
28 * src/symtab.c, src/symtab.h (bucket): Rename as...
29 (symbol_t): this.
30 (symbol_list_new, bucket_check_defined, bucket_make_alias)
31 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
32 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
33 (buckets_new, buckets_free, buckets_do): Rename as...
34 (symbol_list_new, symbol_check_defined, symbol_make_alias)
35 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
36 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
37 (symbols_new, symbols_free, symbols_do): these.
38
39
72a23c97
AD
402002-04-07 Akim Demaille <akim@epita.fr>
41
42 Use lib/hash for the symbol table.
43
44 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
45 EOF.
46 * src/lex.c (lex): Set the `number' member of new terminals.
47 * src/reader.c (bucket_check_defined, bucket_make_alias)
48 (bucket_check_alias_consistence, bucket_translation): New.
49 (reader, grammar_free, readgram, token_translations_init)
50 (packsymbols): Adjust.
51 (reader): Number the predefined tokens.
52 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
53 for predefined tokens.
54 * src/symtab.h (bucket): Remove all the hash table related
55 members.
56 * src/symtab.c (symtab): Replace by...
57 (bucket_table): this.
58 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
59 (buckets_new, buckets_do): New.
60
280a38c3
AD
612002-04-07 Akim Demaille <akim@epita.fr>
62
63 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
64 (start_symbol, max_user_token_number, semantic_parser)
65 (error_token_number): Initialize.
66 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
67 Initialize.
68 (reader): Don't.
69 (errtoken, eoftoken, undeftoken, axiom): Extern.
70
03b31c0c
AD
712002-04-07 Akim Demaille <akim@epita.fr>
72
73 * src/gram.h (rule_s): prec and precsym are now pointers
74 to the bucket giving the priority/associativity.
75 Member `associativity' removed: useless.
76 * src/reduce.c, src/conflicts.c: Adjust.
77
8b3df748
AD
782002-04-07 Akim Demaille <akim@epita.fr>
79
80 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
81 Properly escape the symbols' TAG when outputting them.
82
e601aa1d
AD
832002-04-07 Akim Demaille <akim@epita.fr>
84
85 * src/lalr.h (LA): Is a bitsetv, not bitset*.
86
87
b0299a2e
AD
882002-04-07 Akim Demaille <akim@epita.fr>
89
90 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
91 (LArule): this, which is an array to rule_t*.
92 * src/print.c, src/conflicts.c: Adjust.
93
94
d7e1f00c
AD
952002-04-07 Akim Demaille <akim@epita.fr>
96
97 * src/gram.h (rule_t): Rename `number' as `user_number'.
98 `number' is a new member.
99 Adjust dependencies.
100 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
101
cc9305dd
AD
1022002-04-07 Akim Demaille <akim@epita.fr>
103
104 As a result of the previous patch, it is no longer needed
105 to reorder ritem itself.
106
107 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
108
b0940840
AD
1092002-04-07 Akim Demaille <akim@epita.fr>
110
111 Be sure never to walk through RITEMS, but use only data related to
112 the rules themselves. RITEMS should be banished.
113
114 * src/output.c (output_token_translations): Rename as...
115 (prepare_tokens): this.
116 In addition to `translate', prepare the muscles `tname' and
117 `toknum', which were handled by...
118 (output_rule_data): this.
119 Remove, and move the remainder of its outputs into...
120 (prepare_rules): this new routines, which also merges content from
121 (output_gram): this.
122 (prepare_rules): Be sure never to walk through RITEMS.
123 (output_stos): Rename as...
124 (prepare_stos): this.
125 (output): Always invoke prepare_states, after all, just don't use it
126 in the output if you don't need it.
127
643a5994
AD
1282002-04-07 Akim Demaille <akim@epita.fr>
129
130 * src/LR0.c (new_state): Display `nstates' as the name of the
131 newly created state.
132 Adjust to initialize first_state and last_state if needed.
133 Be sure to distinguish the initial from the final state.
134 (new_states): Create the itemset of the initial state, and use
135 new_state.
136 * src/closure.c (closure): Now that the initial state has its
137 items properly set, there is no need for a special case when
138 creating `ruleset'.
139
140 As a result, now the rule 0, reducing to $axiom, is visible in the
141 outputs. Adjust the test suite.
142
143 * tests/conflicts.at (Solved SR Conflicts)
144 (Unresolved SR Conflicts): Adjust.
145 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
146 * tests/conflicts.at (S/R in initial): New.
147
b4c4ccc2
AD
1482002-04-07 Akim Demaille <akim@epita.fr>
149
150 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
151 the RHS of the rules.
152 * src/output.c (output_gram): Likewise.
153
bba97eb2
AD
1542002-04-07 Akim Demaille <akim@epita.fr>
155
156 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
157 bucket.
158 Adjust all dependencies.
159 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
160 `number' of the buckets too.
161 * src/gram.h: Include `symtab.h'.
162 (associativity): Move to...
163 * src/symtab.h: here.
164 No longer include `gram.h'.
165
166
c3b407f4
AD
1672002-04-07 Akim Demaille <akim@epita.fr>
168
169 * src/gram.h, src/gram.c (rules_rhs_length): New.
170 (ritem_longest_rhs): Use it.
171 * src/gram.h (rule_t): `number' is a new member.
172 * src/reader.c (packgram): Set it.
173 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
174 the end of `rules', and count them out of `nrules'.
175 (reduce_output, dump_grammar): Adjust.
176 * src/print.c (print_grammar): It is no longer needed to check for
177 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
178 * tests/reduce.at (Reduced Automaton): New test.
179
11652ab3
AD
1802002-04-07 Akim Demaille <akim@epita.fr>
181
182 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
183 lacking `+ 1' to nrules, Bison reported as useless a token if it
184 was used solely to set the precedence of the last rule...
185
26b23c1a
AD
1862002-04-07 Akim Demaille <akim@epita.fr>
187
188 * data/bison.c++, data/bison.simple: Don't output the current file
189 name in #line, to avoid useless diffs between two identical
190 outputs under different names.
191
18bcecb0
AD
1922002-04-07 Akim Demaille <akim@epita.fr>
193
194 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
195 Normalize loops to using `< nrules + 1', not `<= nrules'.
196
fa770c86
AD
1972002-04-07 Akim Demaille <akim@epita.fr>
198
199 * TODO: Update.
200
d9b739c3
AD
2012002-04-07 Akim Demaille <akim@epita.fr>
202
203 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
204 bucket.value as bucket.number.
205
99013900
AD
2062002-04-07 Akim Demaille <akim@epita.fr>
207
208 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
209 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
210 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
211 RHS, instead of being an index in RITEMS.
212
e966383b
PE
2132002-04-04 Paul Eggert <eggert@twinsun.com>
214
215 * doc/bison.texinfo: Update copyright date.
216 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
217 (Symbols): Warn about running Bison in one character set,
218 but compiling and/or running in an incompatible one.
219 Warn about character code 256, too.
220
2212002-04-03 Paul Eggert <eggert@twinsun.com>
222
223 * src/bison.data (YYSTACK_ALLOC): Depend on whether
224 YYERROR_VERBOSE is nonzero, not whether it is defined.
225
226 Merge changes from bison-1_29-branch.
c307773e 227
8d6c48b9
PE
2282002-03-20 Paul Eggert <eggert@twinsun.com>
229
230 Merge fixes from Debian bison_1.34-1.diff.
231
232 * configure.in (AC_PREREQ): 2.53.
233
e53c6322
AD
2342002-03-20 Akim Demaille <akim@epita.fr>
235
236 * src/conflicts.c (log_resolution): Argument `resolution' is const.
237
9ffbeca7
PE
2382002-03-19 Paul Eggert <eggert@twinsun.com>
239
21db0b2a
PE
240 * src/bison.simple (YYCOPY): New macro.
241 (YYSTACK_RELOCATE): Use it.
242 Remove Type arg; no longer needed. All callers changed.
243 (yymemcpy): Remove; no longer needed.
244
9ffbeca7
PE
245 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
246 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
247
642cb8f8
AD
2482002-03-19 Akim Demaille <akim@epita.fr>
249
250 Test and fix the #line outputs.
251
252 * tests/atlocal.at (GCC): New.
253 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
254 (Prologue synch line, ,%union synch line, Postprologue synch line)
255 (Action synch line, Epilogue synch line): New tests.
256 * src/reader.c (parse_union_decl): Define the muscle stype_line.
257 * data/bison.simple, data/bison.c++: Use it.
258
3c31a486
AD
2592002-03-19 Akim Demaille <akim@epita.fr>
260
261 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
262 (Solved SR Conflicts, %expect not enough, %expect right)
263 (%expect too much): Move to...
264 * tests/conflicts.at: this new file.
265
0d8bed56
AD
2662002-03-19 Akim Demaille <akim@epita.fr>
267
268 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
269 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
270 that we can move to enums for instance.
271 * src/output.c (token_definitions_output): Output a list of
272 `token-name, token-number' instead of the #define.
273 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
274
9208d17f
AD
2752002-03-14 Akim Demaille <akim@epita.fr>
276
277 Use Gettext 0.11.1.
278
af27eacb
RA
2792002-03-09 Robert Anisko <robert@lrde.epita.fr>
280
281 * data/bison.c++: Make the user able to add members to the generated
282 parser by subclassing.
283
9101a310
RA
2842002-03-05 Robert Anisko <robert@lrde.epita.fr>
285
286 * src/reader.c (read_additionnal_code): `c' should be an integer, not
287 a character.
288 Reported by Nicolas Tisserand and Nicolas Burrus.
289
fff9bf0b
RA
2902002-03-04 Robert Anisko <robert@lrde.epita.fr>
291
292 * src/reader.c: Warn about lacking semi-colons, do not complain.
293
64dba31e
RA
2942002-03-04 Robert Anisko <robert@lrde.epita.fr>
295
296 * data/bison.c++: Remove a debug line.
297
374f5a14
RA
2982002-03-04 Robert Anisko <robert@lrde.epita.fr>
299
300 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
301 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
302 provide a default implementation.
303
bfcf1f3a
AD
3042002-03-04 Akim Demaille <akim@epita.fr>
305
306 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
307 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
308 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
309 * tests/semantic.at (Parsing Guards): Similarly.
310 * src/reader.at (readgram): Complain if the last rule is not ended
311 with a semi-colon.
312
65ccf9fc
AD
3132002-03-04 Akim Demaille <akim@epita.fr>
314
315 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
316 * src/closure.c: here.
317 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
318 RTC.
319 * src/warshall.h, src/warshall.c: Remove.
320 * tests/sets.at (Broken Closure): Adjust.
321
d0039cbc
AD
3222002-03-04 Akim Demaille <akim@epita.fr>
323
324 * src/output.c (output_skeleton): tempdir is const.
325 bytes_read is unused.
326
345cea78
AD
3272002-03-04 Akim Demaille <akim@epita.fr>
328
329 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
330 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
331 Update.
332 From Michael Hayes.
333
564801f7
AD
3342002-03-04 Akim Demaille <akim@epita.fr>
335
336 * src/closure.c (closure): `r' is unused.
337
e5352bc7
AD
3382002-03-04 Akim Demaille <akim@epita.fr>
339
340 * tests/sets.at (Broken Closure): Add the ending `;'.
341 * src/reader.at (readgram): Complain if a rule is not ended with a
342 semi-colon.
343
914feea9
AD
3442002-03-04 Akim Demaille <akim@epita.fr>
345
346 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
347 (count_sr_conflicts): Use bitset_count.
348 * src/reduce.c (inaccessable_symbols): Ditto.
349 (bits_size): Remove.
350 * src/warshall.h, src/warshall.c: Convert to bitsetv.
351
f0250de6
AD
3522002-03-04 Akim Demaille <akim@epita.fr>
353
354 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
355 * src/reduce.c: Remove the `bitset_zero's following the
356 `bitset_create's, as now it is performed by the latter.
357
ef017502
AD
3582002-03-04 Akim Demaille <akim@epita.fr>
359
360 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
361 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
362 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
363 latest sources from Michael.
364
76514394
AD
3652002-03-04 Akim Demaille <akim@epita.fr>
366
367 * src/output.c (output): Don't free the grammar.
368 * src/reader.c (grammar_free): New.
369 * src/main.c (main): Call it and don't free symtab here.
370
55024580
AD
3712002-03-04 Akim Demaille <akim@epita.fr>
372
373 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
374 before returning.
375 Reported by Benoit Perrot.
376
f9abaa2c
AD
3772002-03-04 Akim Demaille <akim@epita.fr>
378
379 Use bitset operations when possible, not loops over bits.
380
381 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
382 bitset_or.
383 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
384 * src/reduce.c (useless_nonterminals): Formatting changes.
385 * src/warshall.c (TC): Use bitset_or.
386
0e721e75
AD
3872002-03-04 Akim Demaille <akim@epita.fr>
388
389 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
390 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
391 Ditto.
392
0fb1ffb1
AD
3932002-03-04 Akim Demaille <akim@epita.fr>
394
395 * src/lalr.c (F): Now a bitset*.
396 Adjust all dependencies.
397
b86796bf
AD
3982002-03-04 Akim Demaille <akim@epita.fr>
399
400 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
401 Adjust all dependencies.
402
602bbf31
AD
4032002-03-04 Akim Demaille <akim@epita.fr>
404
405 * src/L0.c, src/LR0.h (nstates): Be size_t.
406 Adjust comparisons (signed vs unsigned).
407 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
408 bitset*.
409 Adjust all dependencies.
410
d8a0245c
AD
4112002-03-04 Akim Demaille <akim@epita.fr>
412
413 * src/closure.c (firsts): Now, also a bitset.
414 Adjust all dependencies.
415 (varsetsize): Remove, now unused.
416 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
417
34ba9743
AD
4182002-03-04 Akim Demaille <akim@epita.fr>
419
420 * src/print.c: Convert to use bitset.h, not hand coded iterations
421 over ints.
422
ed86e78c
AD
4232002-03-04 Akim Demaille <akim@epita.fr>
424
425 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
426
dfdb1797
AD
4272002-03-04 Akim Demaille <akim@epita.fr>
428
429 * src/closure.c (ruleset): Be a bitset.
430 (rulesetsize): Remove.
431
7086e707
AD
4322002-03-04 Akim Demaille <akim@epita.fr>
433
434 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
435 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
436 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
437 * src/closure.c (fderives): Be an array of bitsets.
438
98254360
RA
4392002-02-28 Robert Anisko <robert@lrde.epita.fr>
440
441 * data/bison.c++: Merge the two generated headers. Insert a copyright
442 notice in each output file.
443
a75c057f
AD
4442002-02-28 Akim Demaille <akim@epita.fr>
445
446 * data/bison.c++: Copy the prologue of bison.simple to fetch
447 useful M4 definitions, such as b4_header_guard.
448
06b00abc
AD
4492002-02-25 Akim Demaille <akim@epita.fr>
450
451 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
452 translator friendly scheme for the bgr
453 copyright notice.
06b00abc 454
70e7d534
AD
4552002-02-25 Akim Demaille <akim@epita.fr>
456
457 * src/output.c (header_output): Remove, now handled completely via
458 M4.
459
abe017f6
AD
4602002-02-25 Akim Demaille <akim@epita.fr>
461
462 * m4/m4.m4: New, from CVS Autoconf.
463 * configure.in: Invoke it.
464 * src/output.c (output_skeleton): Use its result instead of the
465 hard coded name.
466
381fb12e
AD
4672002-02-25 Akim Demaille <akim@epita.fr>
468
469 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
470 Fileutils 4.1.5.
471 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
472 * src/output.c (output_skeleton): Use mkstemp to create a real
473 temporary file.
474 Move the filling of `skeleton' and its muscle to...
475 (prepare): here.
476 (output): Move the definition of the prologue muscle to...
477 (prepare): here.
478 * src/system.h (DEFAULT_TMPDIR): New.
479
6f38107f
PE
4802002-02-14 Paul Eggert <eggert@twinsun.com>
481
482 Remove the support for C++ namespace cleanliness; it was
483 causing more problems than it was curing, since it didn't work
484 properly on some nonstandard C++ compilers. This can wait
485 for a proper C++ parser.
486
487 * NEWS: Document this.
488 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
489 of C++, as it's treated like C now.
490 * src/bison.simple (YYSTD): Remove.
491 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
492 Treat C++ just like Standard C instead of trying to support
493 namespace cleanliness.
494
80cce3da
AD
4952002-02-14 Akim Demaille <akim@epita.fr>
496
497 * tests/regression.at (else): Adjust to Andreas' change.
498
842e8679
AD
4992002-02-14 Akim Demaille <akim@epita.fr>
500
501 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
502
4bda3f10
AD
5032002-02-13 Andreas Schwab <schwab@suse.de>
504
505 * src/output.c (output_rule_data): Don't output NULL, it might
506 not be defined yet.
507
4162fa07 5082002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 509
4162fa07
RA
510 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
511 (Copyright notice): Update.
b418ecd8 512
bd16a5dc
AD
5132002-02-11 Akim Demaille <akim@epita.fr>
514
515 * tests/regression.at (%nonassoc and eof): Don't include
516 nonportable headers.
517
8d69a1a3
RA
5182002-02-08 Robert Anisko <robert@lrde.epita.fr>
519
520 * data/bison.c++: Correct error recovery. Make the user able to
521 initialize the starting location.
522
9b2d0677
AD
5232002-02-07 Akim Demaille <akim@epita.fr>
524
525 * tests/input.at: New.
526
69e2658b
RA
5272002-02-07 Robert Anisko <robert@lrde.epita.fr>
528
529 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 530 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
531 directives around tables only needed for debugging.
532
4aacc3a7
RA
5332002-02-07 Robert Anisko <robert@lrde.epita.fr>
534
535 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
536 C++ parsers.
537 (yy::b4_name::parse): Use print_.
538
762a801e
RA
5392002-02-07 Robert Anisko <robert@lrde.epita.fr>
540
541 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
542
4bb2bc3f
RA
5432002-02-07 Robert Anisko <robert@lrde.epita.fr>
544
545 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
546 C++ parsers.
547 (yy::b4_name::parse): Build verbose error messages, and use error_.
548
6b45a3ca
RA
5492002-02-06 Robert Anisko <robert@lrde.epita.fr>
550
551 * data/bison.c++: Fix m4 quoting in comments.
552
50997c6e
RA
5532002-02-06 Robert Anisko <robert@lrde.epita.fr>
554
555 * data/bison.c++: Adjust the parser code. Fix some muscles that were
556 not expanded by m4.
557
3f3eed27
AD
5582002-02-05 Akim Demaille <akim@epita.fr>
559
560 * data/bison.c++: Adjust to the M4 back end.
561 More is certainly needed.
562
be2a1a68
AD
5632002-02-05 Akim Demaille <akim@epita.fr>
564
565 Give a try to M4 as a back end.
566
567 * lib/readpipe.c: New, from wdiff.
568 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
569 BISON_HAIRY.
570 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
571 specific values. Now it is m4 that performs the lookup.
572 * src/parse-skel.y: Remove.
573 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
574 * src/output.c (actions_output, guards_output)
575 (token_definitions_output): No longer keeps track of the output
576 line number, hence remove the second argument.
577 (guards_output): Check against the guard member of a rule, not the
578 action member.
579 Adjust callers.
580 (output_skeleton): Don't look for the skeleton location, let m4 do
581 that.
582 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
583 file will be used.
584 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
585 (prepare): Given that for the time being changesyntax is not
586 usable in M4, rename the muscles using `-' to `_'.
587 Define `defines_flag', `output_parser_name' and `output_header_name'.
588 * src/output.h (actions_output, guards_output)
589 (token_definitions_output): Adjust prototypes.
590 * src/scan-skel.l: Instead of scanning the skeletons, it now
591 processes the output of m4: `__oline__' and `#output'.
592 * data/bison.simple: Adjust to be used by M4(sugar).
593 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
594 to date.
595 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
596 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
597 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
598 shamelessly stolen from CVS Autoconf.
599
beda758b
AD
6002002-02-05 Akim Demaille <akim@epita.fr>
601
602 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
603 * configure.in: Check for the declarations of free and malloc.
604 * src/muscle_tab.c: Adjust.
605
5ece6d43
AD
6062002-02-05 Akim Demaille <akim@epita.fr>
607
608 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
609 which have no values.
610
5bb18f9a
AD
6112002-02-05 Akim Demaille <akim@epita.fr>
612
613 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
614 * data/: here.
615
894dd62e
PE
6162002-01-29 Paul Eggert <eggert@twinsun.com>
617
618 * src/bison.simple (YYSIZE_T): Do not define merely because
619 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
620 On some platforms, <alloca.h> does not declare YYSTD (size_t).
621
82841af7
AD
6222002-01-27 Akim Demaille <akim@epita.fr>
623
624 Fix `%nonassoc and eof'.
625
626 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
627 which were not properly copied! Replace
628 memcpy (res->errs, src->errs, src->nerrs);
629 with
630 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
631 !!!
632 * tests/regression.at (%nonassoc and eof): Adjust to newest
633 Autotest: `.' is not in the PATH.
634
318b76e9
AD
6352002-01-27 Akim Demaille <akim@epita.fr>
636
637 * tests/sets.at (AT_EXTRACT_SETS): New.
638 (Nullable): Use it.
639 (Firsts): New.
640
30d2f3d5
AD
6412002-01-26 Akim Demaille <akim@epita.fr>
642
643 * tests/actions.at, tests/calc.at, tests/headers.at,
644 * tests/torture.at: Adjust to the newest Autotest which no longer
645 forces `.' in the PATH.
646
30f8c395
AD
6472002-01-25 Akim Demaille <akim@epita.fr>
648
649 * tests/regression.at (%nonassoc and eof): New.
650 Suggested by Robert Anisko.
651
29ae55f1
AD
6522002-01-24 Akim Demaille <akim@epita.fr>
653
654 Bison dumps core when trying to complain about broken input files.
655 Reported by Cris van Pelt.
656
657 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
658 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
659 into...
660 (Invalid inputs): Strengthen: exercise parse_percent_token.
661
2b548aa6
RA
6622002-01-24 Robert Anisko <robert.anisko@epita.fr>
663
664 * src/Makefile.am: Add bison.c++.
665 * src/bison.c++: New skeleton.
666
bb0146c2
AD
6672002-01-21 Paolo Bonzini <bonzini@gnu.org>
668
669 * po/it.po: New.
670
bec30531
AD
6712002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
672
673 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
674
fc6edc45
MA
6752002-01-20 Marc Autret <marc@gnu.org>
676
677 * src/files.c (compute_output_file_names): Fix
678
5e5d5415
MA
6792002-01-20 Marc Autret <marc@gnu.org>
680
681 * tests/output.at: New test.
682 * src/files.c (compute_base_names): Don't map extensions when
683 the YACC flag is set, use defaults.
684 Reported by Evgeny Stambulchik.
685
44ea3fbd
MA
6862002-01-20 Marc Autret <marc@gnu.org>
687
bb0146c2 688 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
689 compilers as well (i.e. the vendor C compiler).
690 Suggested by Albert Chin-A-Young.
691
338963d1
TVH
6922002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
693
694 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
695 canonical definition.
696 * src/system.h: Use the canonical definition for PARAMS (avoids
697 a conflict with the macro from lib/hash.h).
698
c57b2479
AD
6992002-01-11 Akim Demaille <akim@epita.fr>
700
701 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 702 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 703
b85810ae
AD
7042002-01-09 Akim Demaille <akim@epita.fr>
705
706 * src/files.c, src/files.h (output_infix): New.
707 (tab_extension): Remove.
708 (compute_base_names): Compute the former, drop the latter.
709 * src/output.c (prepare): Insert the muscles `output-infix', and
710 `output-suffix'.
711 * src/parse-skel.y (string, string.1): New.
712 (section.header): Use it.
713 (section.yacc): Remove.
714 (prefix): Remove too.
715 * src/scan-skel.l: Adjust.
716 * src/bison.simple, src/bison.hairy: Adjust.
717
cae60122
AD
7182002-01-09 Akim Demaille <akim@epita.fr>
719
720 * configure.in (WERROR_CFLAGS): Compute it.
721 * src/Makefile.am (CFLAGS): Pass it.
722 * tests/atlocal.in (CFLAGS): Idem.
723 * src/files.c: Fix a few warnings.
724 (get_extension_index): Remove, unused.
725
ae404801
AD
7262002-01-08 Akim Demaille <akim@epita.fr>
727
728 * src/getargs.c (AS_FILE_NAME): New.
729 (getargs): Use it to convert DOSish file names.
730 * src/files.c (base_name): Rename as full_base_name to avoid
731 clashes with `base_name ()'.
732 (filename_split): New.
733 (compute_base_names): N-th rewrite, using filename_split.
734
22312b71
AD
7352002-01-08 Akim Demaille <akim@epita.fr>
736
737 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
738 New, stolen from the Fileutils 4.1.
739 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
740 * configure.in: Check for the presence of memrchr, and of its
741 prototype.
742
a67cef01
TVH
7432002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
744
745 * lib/hash.h (__P): Added definition for this macro.
746 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
747 BUILT_SOURCES, to ensure they are generated first.
748 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
749 %error-verbose to allow bootstrapping with bison 1.30x.
750
2b25d624
AD
7512002-01-06 Akim Demaille <akim@epita.fr>
752
753 * src/reader.c (parse_braces): Don't fetch the next char, the
754 convention is to fetch on entry.
755 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
756 'switch' without a following semicolon.
757 * tests/regression.at (braces parsing): New.
758
3460813b
AD
7592002-01-06 Akim Demaille <akim@epita.fr>
760
761 Bison is dead wrong in its RR conflict reports.
762
763 * tests/torture.at (GNU Cim Grammar): New.
764 * src/conflicts.c (count_rr_conflicts): Fix.
765
73784c64
AD
7662002-01-06 Akim Demaille <akim@epita.fr>
767
768 Creating package.m4 from configure.ac causes too many problems.
769
770 * tests/Makefile.am (package.m4): Create it by hand,
771 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
772
25d81090
AD
7732002-01-06 Akim Demaille <akim@epita.fr>
774
775 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
776 skeleton.h.
777
a9b8959e
PE
7782002-01-04 Paul Eggert <eggert@twinsun.com>
779
780 * doc/bison.texinfo (Debugging):
781 Remove YYSTDERR; it's no longer defined or used.
782 Also, s/cstdio.h/cstdio/.
783
25d81090
AD
7842002-01-03 Akim Demaille <akim@epita.fr>
785
786 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
787
1109455c
AD
7882002-01-03 Akim Demaille <akim@epita.fr>
789
790 * src/parse-skel.y (process_skeleton): Don't bind the parser's
791 tracing code to --trace, wait for a better --trace option, with
792 args.
793
7ea5e977
AD
7942002-01-03 Akim Demaille <akim@epita.fr>
795
796 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
797 The ISO C++ standard is extremely clear about it: stderr is
798 considered a macro, not a regular symbol (see table 94 `Header
799 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
800 Therefore std:: does not apply to it. It still does with fprintf.
801 Also, s/cstdio.h/cstdio/.
802
fab5b110
AD
8032002-01-03 Akim Demaille <akim@epita.fr>
804
805 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
806 for non system headers.
807
aed7fd9b
AD
8082002-01-02 Akim Demaille <akim@epita.fr>
809
810 Equip the skeleton chain with location tracking, runtime trace,
811 pure parser and scanner.
812
813 * src/parse-skel.y: Request a pure parser, locations, and prefix
814 renaming.
815 (%union): Having several members with the same type does not help
816 type mismatches, simplify.
817 (YYPRINT, yyprint): New.
818 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
819 (skel_error): this.
820 Handle locations.
821 * src/scan-skel.l: Adjust to these changes.
822 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
823 (LOCATION_PRINT, skel_control_t): New.
824
24fad99e
AD
8252001-12-30 Akim Demaille <akim@epita.fr>
826
827 * src/parse-skel.y: Get rid of the shift/reduce conflict:
828 replace `gb' with BLANKS.
829 * src/scan-skel.l: Adjust.
830
a4b36db4
AD
8312001-12-30 Akim Demaille <akim@epita.fr>
832
833 * src/system.h: We don't need nor want bcopy.
834 Throw away MS-DOS crap: we don't need getpid.
835 * configure.in: We don't need strndup. It was even causing
836 problems: because Flex includes the headers *before* us,
837 _GNU_SOURCE is not defined by config.h, and therefore strndup was
838 not visible.
839 * lib/xstrndup.c: New.
840 * src/scan-skel.l: Use it.
841 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
842 * src/parse-skel.y: Use %directives instead of #defines.
843
1239777d
AD
8442001-12-30 Akim Demaille <akim@epita.fr>
845
846 * src/skeleton.h: New.
847 * src/output.c (output_parser, output_master_parser): Remove, dead
848 code.
849 * src/output.h (get_lines_number, actions_output, guards_output)
850 (token_definitions_output): Prototype them.
851 * src/parse-skel.y: Add the license notice.
852 Include output.h and skeleton.h.
853 (process_skeleton): Returns void, and takes a single parameter.
854 * src/scan-skel.l: Add the license notice.
855 Include skeleton.h.
856 Don't use %option yylineno: it seems that then Flex imagines
857 REJECT has been used, and therefore it won't reallocate its
858 buffers (which makes no other sense to me than a bug). It results
859 in warnings for `unused: yy_flex_realloc'.
860
9b3add5b
RA
8612001-12-30 Robert Anisko <robert.anisko@epita.fr>
862
863 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
864 (MUSCLE_INSERT_PREFIX): ...to there.
865 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
866 (MUSCLE_INSERT_PREFIX): Move from here...
867
868 * src/bison.hairy: Add a section directive. Put braces around muscle
869 names. This parser skeleton is still broken, but Bison should not
870 choke on a bad muscle 'syntax'.
871 * src/bison.simple: Add a section directive. Put braces around muscle
872 names.
873
874 * src/files.h (strsuffix, stringappend): Add declarations.
875 (tab_extension): Add declaration.
876 (short_base_name): Add declaration.
877
878 * src/files.c (strsuffix, stringappend): No longer static. These
879 functions are used in the skeleton parser.
880 (tab_extension): New.
881 (compute_base_names): Use the computations done in this function
fab5b110 882 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
883 names.
884 (short_base_name): No longer static.
885
886 * src/output.c (output_skeleton): New.
887 (output): Disable call to output_master_parser, and give a try to
888 a new skeleton handling system.
889 (guards_output, actions_output): No longer static.
890 (token_definitions_output, get_lines_number): No longer static.
891
892 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
893
fab5b110 894 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
895 parse-skel.y.
896
897 * src/parse-skel.y: New file.
898 * src/scan-skel.l: New file.
899
b5b61c61
AD
9002001-12-29 Akim Demaille <akim@epita.fr>
901
902 %name-prefix is broken.
903
904 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
905 Adjust all dependencies.
906 * tests/headers.at (export YYLTYPE): Strengthen this test: use
907 %name-prefix.
908
909 Renaming yylval but not yylloc is not consistent. Now we do.
910
911 * src/bison.simple: Prefix yylloc if used.
912 * doc/bison.texinfo (Decl Summary): Document that.
913
8c9a50be
AD
9142001-12-29 Akim Demaille <akim@epita.fr>
915
916 * doc/bison.texinfo: Promote `%long-directive' over
917 `%long_directive'.
918 Remove all references to fixed-output-files, yacc is enough.
919
d99361e6
AD
9202001-12-29 Akim Demaille <akim@epita.fr>
921
922 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
923 user prologue. These are defaults.
924 * tests/actions.at (Mid-rule actions): Make sure the user can
925 define YYDEBUG and YYERROR_VERBOSE.
926
b9cecb91
AD
9272001-12-29 Akim Demaille <akim@epita.fr>
928
929 * src/output.c (header_output): Don't forget to export YYLTYPE and
930 yylloc.
931 * tests/headers.at (export YYLTYPE): New, make sure it does.
932 * tests/regression.at (%union and --defines, Invalid CPP headers):
933 Move to...
934 * tests/headers.at: here.
935
aea13e97
AD
9362001-12-29 Akim Demaille <akim@epita.fr>
937
938 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
939
931394cb
AD
9402001-12-29 Akim Demaille <akim@epita.fr>
941
942 * tests/actions.at (Mid-rule actions): Output on a single line
943 instead of several.
944
704a47c4
AD
9452001-12-29 Akim Demaille <akim@epita.fr>
946
947 * doc/bison.texinfo: Formatting changes.
948
091e20bb
AD
9492001-12-29 Akim Demaille <akim@epita.fr>
950
951 Don't store the token defs in a muscle, just be ready to output it
952 on command. Now possible via `symbols'. Fixes a memory leak.
953
954 * src/output.c (token_definitions_output): New.
955 (output_parser, header_output): Use it.
956 * src/reader.c (symbols_save): Remove.
957
cce71710
AD
9582001-12-29 Akim Demaille <akim@epita.fr>
959
960 * src/bison.simple: Do not provide a default for YYSTYPE and
961 YYLTYPE before the user's prologue. Otherwise it's hardly... a
962 default.
963
82c035a8
AD
9642001-12-29 Akim Demaille <akim@epita.fr>
965
966 Mid-rule actions are simply... ignored!
967
968 * src/reader.c (readgram): Be sure to attach mid-rule actions to
969 the empty-rule associated to the dummy symbol, not to the host
970 rule.
971 * tests/actions.at (Mid-rule actions): New.
972
8419d367
AD
9732001-12-29 Akim Demaille <akim@epita.fr>
974
975 Memory leak.
976
977 * src/reader.c (reader): Free grammar.
978
375d5806
AD
9792001-12-29 Akim Demaille <akim@epita.fr>
980
981 Memory leak.
982
983 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
984 since it allocates it for each state, although only one is needed.
985 (allocate_storage): Do it here.
986
f51cb8ff
AD
9872001-12-29 Akim Demaille <akim@epita.fr>
988
989 * src/options.h, src/options.c (create_long_option_table): Rename
990 as...
991 (long_option_table_new): this, with a clearer prototype.
992 (percent_table): Remove, unused,
993 * src/getargs.c (getargs): Adjust.
994
29e88316
AD
9952001-12-29 Akim Demaille <akim@epita.fr>
996
997 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
998 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
999 as states.
1000
b9f71f19
AD
10012001-12-29 Akim Demaille <akim@epita.fr>
1002
1003 * src/lalr.c (build_relations): Rename `states' as `states1'.
1004 Sorry, I don't understand exactly what it is, no better name...
1005
1a2b5d37
AD
10062001-12-29 Akim Demaille <akim@epita.fr>
1007
1008 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1009 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1010 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1011 as rules.
1012
1cca533e
AD
10132001-12-29 Akim Demaille <akim@epita.fr>
1014
1015 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1016 ago.
1017
c03ae966
AD
10182001-12-29 Akim Demaille <akim@epita.fr>
1019
1020 * src/reader.c, src/reader.h (user_toknums): Remove.
1021 Adjust all users to use symbols[i]->user_token_number.
1022
5a670b1e
AD
10232001-12-29 Akim Demaille <akim@epita.fr>
1024
1025 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1026 Adjust all users to use symbols[i]->prec or ->assoc.
1027
ad949da9
AD
10282001-12-29 Akim Demaille <akim@epita.fr>
1029
1030 * src/reader.c, src/reader.h (tags): Remove.
1031 Adjust all users to use symbols[i]->tag.
1032
0e78e603
AD
10332001-12-29 Akim Demaille <akim@epita.fr>
1034
1035 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1036 and rule_table.
1037 * src/reader.c (packsymbols): Fill this table.
1038 Drop sprec.
1039 * src/conflicts.c (resolve_sr_conflict): Adjust.
1040 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1041 single table.
1042 Use symbols[i]->tag instead of tags[i].
1043
213e640e
AD
10442001-12-29 Akim Demaille <akim@epita.fr>
1045
1046 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1047 In addition, put a comment in there, to replace...
1048 * tests/regression.at (%union and C comments): Remove.
1049
e7b8bef1
AD
10502001-12-29 Akim Demaille <akim@epita.fr>
1051
1052 * tests/regression.at (Web2c Actions): Blindly move the actual
1053 output as expected output. The contents *seem* right to me, but I
1054 can't pretend reading perfectly parser tables... Nonetheless, all
1055 the other tests pass correctly, the table look OK, even though the
1056 presence of `$axiom' is to be noted: AFAICS it is useless (but
1057 harmless).
1058
b68e7744
AD
10592001-12-29 Akim Demaille <akim@epita.fr>
1060
1061 * src/reader.c (readgram): Don't add the rule 0 if there were no
1062 rules read. In other words, add it _after_ having performed
1063 grammar sanity checks.
1064 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1065
78d5bae9
AD
10662001-12-29 Akim Demaille <akim@epita.fr>
1067
1068 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1069 visible, and some states have now a different number.
1070
ff442794
AD
10712001-12-29 Akim Demaille <akim@epita.fr>
1072
1073 * src/reader.c (readgram): Bind the initial rule's lineno to that
1074 of the first rule.
1075 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1076 (Solved SR Conflicts): Adjust rule 0's line number.
1077
610ab194
AD
10782001-12-29 Akim Demaille <akim@epita.fr>
1079
1080 Fix the `GAWK Grammar' failure.
1081
1082 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1083 the reductions of the first state which was mistakenly confused
1084 with the final state because precisely final_state was initialized
1085 to 0.
1086 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1087 now noticed by Bison.
1088 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1089 have a reduction on $default.
1090
29d29c8f
AD
10912001-12-29 Akim Demaille <akim@epita.fr>
1092
1093 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1094 rule line numbers.
1095 * src/closure.c (print_closure): Likewise.
1096 * src/derives.c (print_derives): Likewise.
1097 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1098 now.
1099
7c6b64d0
AD
11002001-12-29 Akim Demaille <akim@epita.fr>
1101
1102 * src/lalr.c (lookaheads_print): New.
1103 (lalr): Call it when --trace-flag.
1104 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1105 are dumped.
1106
3d4daee3
AD
11072001-12-29 Akim Demaille <akim@epita.fr>
1108
1109 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1110 when walking through ritem, even via rule->rhs.
1111 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1112 (useful_production, useless_nonterminals): Likewise.
1113 (reduce_grammar_tables): Likewise, plus update nritems.
1114 * src/nullable.c (set_nullable): Likewise.
1115 * src/lalr.c (build_relations): Likewise.
1116 * tests/sets.at (Nullable): Adjust.
1117 Fortunately, now, the $axiom is no longer nullable.
1118
9e7f6bbd
AD
11192001-12-29 Akim Demaille <akim@epita.fr>
1120
1121 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1122 the 0-sentinel.
1123 * src/gram.c (ritem_longest_rhs): Likewise.
1124 * src/reduce.c (nonterminals_reduce): Likewise.
1125 * src/print_graph.c (print_graph): Likewise.
1126 * src/output.c (output_rule_data): Likewise.
1127 * src/nullable.c (set_nullable): Likewise.
1128
255ef638
AD
11292001-12-29 Akim Demaille <akim@epita.fr>
1130
1131 * src/output.c: Comment changes.
1132
0d8a7363
AD
11332001-12-27 Paul Eggert <eggert@twinsun.com>
1134
1135 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1136 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1137 Sparc, as they were causing more porting problems than the
1138 (minor) performance improvement was worth.
1139
1140 Also, catch up with 1.31's YYSTD.
1141
3db472b9
AD
11422001-12-27 Akim Demaille <akim@epita.fr>
1143
1144 * src/output.c (output_gram): Rely on nritems, not the
1145 0-sentinel. See below.
1146 Use -1 as separator, not 0.
1147 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1148 Rely on -1 as separator in yyrhs, instead of 0.
1149 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1150 twice `Now at end of input', therefore there are two lines less to
1151 expect.
1152
b365aa05
AD
11532001-12-27 Akim Demaille <akim@epita.fr>
1154
1155 * tests/regression.at (Unresolved SR Conflicts):
1156 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1157 below.
1158
30171f79
AD
11592001-12-27 Akim Demaille <akim@epita.fr>
1160
1161 * src/LR0.c (new_state): Recognize the final state by the fact it
1162 is reached by eoftoken.
1163 (insert_start_shifting_state, insert_eof_shifting_state)
1164 (insert_accepting_state, augment_automaton): Remove, since now
1165 these states are automatically computed from the initial state.
1166 (generate_states): Adjust.
1167 * src/print.c: When reporting a rule number to the user, substract
1168 1, so that the axiom rule is rule 0, and the first user rule is 1.
1169 * src/reduce.c: Likewise.
1170 * src/print_graph.c (print_core): For the time being, just as for
1171 the report, depend upon --trace-flags to dump the full set of
1172 items.
1173 * src/reader.c (readgram): Once the grammar read, insert the rule
1174 0: `$axiom: START-SYMBOL $'.
1175 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1176 number of the states has changed (the final state is no longer
1177 necessarily the last), catch up.
1178
75142d45
AD
11792001-12-27 Akim Demaille <akim@epita.fr>
1180
1181 Try to make the use of the eoftoken valid. Given that its value
1182 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1183 is used instead of > 0 where appropriate, (ii), depend upon nritems
1184 instead of the 0-sentinel.
1185
1186 * src/gram.h, src/gram.c (nritems): New.
1187 Expected to be duplication of nitems, but for the time being...
1188 * src/reader.c (packgram): Assert nritems and nitems are equal.
1189 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1190 * src/closure.c (print_closure, print_fderives): Likewise.
1191 * src/gram.c (ritem_print): Likewise.
1192 * src/print.c (print_core, print_grammar): Likewise.
1193 * src/print_graph.c: Likewise.
1194
b7c49edf
AD
11952001-12-27 Akim Demaille <akim@epita.fr>
1196
1197 * src/main.c (main): If there are complains after grammar
1198 reductions, then output the report anyway if requested, then die.
1199 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1200 * src/reader.c (eoftoken): New.
1201 (parse_token_decl): If the token being defined has value `0', it
1202 is the eoftoken.
1203 (packsymbols): No longer hack `tags' to insert `$' by hand.
1204 Be sure to preserve the value of the eoftoken.
1205 (reader): Make sure eoftoken is defined.
1206 Initialize nsyms to 0: now eoftoken is created just like the others.
1207 * src/print.c (print_grammar): Don't special case the eof token.
1208 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1209 lie anyway, albeit pleasant.
1210 * tests/calc.at: Exercise error messages with eoftoken.
1211 Change the grammar so that empty input is invalid.
1212 Adjust expectations.
1213 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1214
ec2da99f
AD
12152001-12-27 Akim Demaille <akim@epita.fr>
1216
1217 * configure.in: Check the protos of strchr ans strspn.
1218 Replace strchr if needed.
1219 * src/system.h: Provide the protos of strchr, strspn and memchr if
1220 missing.
1221 * lib/strchr.c: New.
1222 * src/reader.c (symbols_save): Use strchr.
1223
8adfa272
AD
12242001-12-27 Akim Demaille <akim@epita.fr>
1225
1226 * src/print.c, src/print_graph.c (escape): New.
1227 Use it to quote the TAGS outputs.
1228 * src/print_graph.c (print_state): Now errors are in red, and
1229 reductions in green.
1230 Prefer high to wide: output the state number on a line of its own.
1231
80dac38c
AD
12322001-12-27 Akim Demaille <akim@epita.fr>
1233
1234 * src/state.h, src/state.c (reductions_new): New.
1235 * src/LR0.c (set_state_table): Let all the states have a
1236 `reductions', even if reduced to 0.
1237 (save_reductions): Adjust.
1238 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1239 * src/print.c (print_reductions, print_actions): Adjust.
1240 * src/output.c (action_row): Adjust.
1241
2cec70b9
AD
12422001-12-27 Akim Demaille <akim@epita.fr>
1243
1244 * src/state.h, src/state.c (errs_new, errs_dup): New.
1245 * src/LR0.c (set_state_table): Let all the states have an errs,
1246 even if reduced to 0.
1247 * src/print.c (print_errs, print_reductions): Adjust.
1248 * src/output.c (output_actions, action_row): Adjust.
1249 * src/conflicts.c (resolve_sr_conflict): Adjust.
1250
13ca549a
AD
12512001-12-27 Akim Demaille <akim@epita.fr>
1252
1253 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1254
5092aba5
AD
12552001-12-27 Akim Demaille <akim@epita.fr>
1256
1257 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1258 * src/print.c: here.
1259 (lookaheadset, shiftset): New, used as additional storage by
1260 print_reductions.
1261 (print_results): Adjust.
1262 (print_shifts, print_gotos, print_errs): New, extracted from...
1263 (print_actions): here.
1264 * src/print_graph.c (print_actions): Remove dead code.
1265
11e2beca
AD
12662001-12-27 Akim Demaille <akim@epita.fr>
1267
1268 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1269 `$n' and `@n'.
1270
dac3c910
AD
12712001-12-27 Akim Demaille <akim@epita.fr>
1272
1273 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1274 (build_relations): Adjust.
1275
d0b0fefa
AD
12762001-12-27 Akim Demaille <akim@epita.fr>
1277
1278 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1279 duplication.
1280
adc8c848
AD
12812001-12-27 Akim Demaille <akim@epita.fr>
1282
1283 * src/reader.c (packgram): Catch nitems overflows.
1284
14d293ac
AD
12852001-12-27 Akim Demaille <akim@epita.fr>
1286
1287 * src/files.c, src/files.h (guard_obstack): Remove.
1288 * src/output.c (output): Adjust.
1289 * src/reader.c (parse_braces): New, factoring...
1290 (copy_action, copy_guard): these two which are renamed as...
1291 (parse_action, parse_guard): these.
1292 As a voluntary consequence, using braces around guards is now
1293 mandatory.
1294
f499b062
AD
12952001-12-27 Akim Demaille <akim@epita.fr>
1296
1297 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1298 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1299 members.
1300 (symbol_list_new): Adjust.
1301 (copy_action): action_line is the first line, not the last.
1302 (copy_guard): Just as for actions, store the `action' only, not
1303 the switch/case/break flesh.
1304 Don't parse the user action that might follow the guard, let...
1305 (readgram): do it, i.e., now, there can be an action after a
1306 guard.
1307 In other words the guard is just explicitly optional.
1308 (packgram): Adjust.
1309 * src/output.c (guards_output): New.
1310 (output_parser): Call it when needed.
1311 (output): Also free the guard and attrs obstacks.
1312 * src/files.c, src/files.h (obstack_save): Remove.
1313 (output_files): Remove.
1314 As a result, if one needs the former `.act' file, using an
1315 appropriate skeleton which requires actions and guards is now
1316 required.
1317 * src/main.c (main): Adjust.
1318 * tests/semantic.at: New.
1319 * tests/regression.at: Use `input.y' as input file name.
1320 Avoid 8+3 problems by requiring input.c when the test needs the
1321 parser.
1322
d945f5cd
AD
13232001-12-27 Akim Demaille <akim@epita.fr>
1324
1325 * src/reader.c (symbol_list_new): Be sure to initialize all the
1326 fields.
1327
d200e455
AD
13282001-12-27 Akim Demaille <akim@epita.fr>
1329
1330 All the hacks using a final pseudo state are now useless.
1331
1332 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1333 * src/lalr.c (nLA): New.
1334 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1335 instead of lookaheadsp from the pseudo state (nstate + 1).
1336
f9507c28
AD
13372001-12-27 Akim Demaille <akim@epita.fr>
1338
1339 * src/output.c (action_row, token_actions): Use a state_t instead
1340 of a integer, and nlookaheads instead of the following state's
1341 lookaheadsp.
1342
065fbd27
AD
13432001-12-27 Akim Demaille <akim@epita.fr>
1344
1345 * src/conflicts.c (log_resolution, flush_shift)
1346 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1347 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1348 (conflicts_print, print_reductions): Use a state_t instead of an
1349 integer when referring to a state.
1350 As much as possible, depend upon nlookaheads, instead of the
1351 `lookaheadsp' member of the following state (since lookaheads of
1352 successive states are successive, the difference between state n + 1
1353 and n served as the number of lookaheads for state n).
1354 * src/lalr.c (add_lookback_edge): Likewise.
1355 * src/print.c (print_core, print_actions, print_state)
1356 (print_results): Likewise.
1357 * src/print_graph.c (print_core, print_actions, print_state)
1358 (print_graph): Likewise.
1359 * src/conflicts.h: Adjust.
1360
1b177bd7
AD
13612001-12-27 Akim Demaille <akim@epita.fr>
1362
1363 * src/bison.hairy: Formatting/comment changes.
1364 ANSIfy.
1365 Remove `register' indications.
1366 Add plenty of `static'.
1367
7742ddeb
AD
13682001-12-27 Akim Demaille <akim@epita.fr>
1369
1370 * src/output.c (prepare): Drop the muscle `ntbase' which
1371 duplicates ntokens.
1372 * src/bison.simple: Formatting/comment changes.
1373 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1374 is an undocumented synonym.
1375
1fa14068
AD
13762001-12-22 Akim Demaille <akim@epita.fr>
1377
1378 * src/output.c (output_table_data): Change the prototype to use
1379 `int' for array ranges: some invocations do pass an int, not a
1380 short.
1381 Reported by Wayne Green.
1382
b9752825
AD
13832001-12-22 Akim Demaille <akim@epita.fr>
1384
1385 Some actions of web2c.y are improperly triggered.
1386 Reported by Mike Castle.
1387
1388 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1389 * tests/regression.at (Web2c): Rename as...
1390 (Web2c Report): this.
1391 (Web2c Actions): New.
1392
776209d6
AD
13932001-12-22 Akim Demaille <akim@epita.fr>
1394
1395 Reductions in web2c.y are improperly reported.
1396 Reported by Mike Castle.
1397
1398 * src/conflicts.c (print_reductions): Fix.
1399 * tests/regression.at (Web2c): New.
1400
275fc3ad
AD
14012001-12-18 Akim Demaille <akim@epita.fr>
1402
1403 Some host fail on `assert (!"foo")', which expands to
1404 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1405 Reported by Nelson Beebee.
1406
1407 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1408 `#define it_succeeded 0' and `assert (it_succeeded)'.
1409
897668ee
MA
14102001-12-17 Marc Autret <autret_m@epita.fr>
1411
1412 * src/bison.simple: Don't hard code the skeleton line and filename.
1413 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1414 New line counter 'skeleton_line' (skeleton-line muscle).
1415
ab3399e0
PE
14162001-12-17 Paul Eggert <eggert@twinsun.com>
1417
1418 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1419 YYDEBUG must be defined to a nonzero value.
1420
1421 * src/bison.simple (yytname): Do not assume that the user defines
1422 YYDEBUG to a properly parenthesized expression.
1423
3877f72b
AD
14242001-12-17 Akim Demaille <akim@epita.fr>
1425
1426 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1427 nlookaheads is a new member.
1428 Adjust all users.
1429 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1430 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1431 state.
776209d6 1432
331dbc1b
AD
14332001-12-17 Akim Demaille <akim@epita.fr>
1434
1435 * src/files.h, src/files.c (open_files, close_files): Remove.
1436 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1437 let...
1438 * src/reader.c (reader): Do it.
776209d6 1439
be750e4c
AD
14402001-12-17 Akim Demaille <akim@epita.fr>
1441
1442 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1443
709ae8c6
AD
14442001-12-17 Akim Demaille <akim@epita.fr>
1445
1446 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1447 (flush_reduce): New.
1448 (resolve_sr_conflict): Adjust.
776209d6 1449
f87685c3
AD
14502001-12-17 Akim Demaille <akim@epita.fr>
1451
1452 * src/output.c (output_obstack): Be static and rename as...
1453 (format_obstack): this, to avoid any confusion with files.c's
1454 output_obstack.
1455 * src/reader.h (muscle_obstack): Move to...
1456 * src/output.h: here, since it's defined in output.c.
1457
837491d8
AD
14582001-12-17 Akim Demaille <akim@epita.fr>
1459
1460 * src/output.c (action_row, save_column, default_goto)
1461 (sort_actions, matching_state, pack_vector): Better variable
1462 locality.
1463
796d61fb
AD
14642001-12-17 Akim Demaille <akim@epita.fr>
1465
1466 * src/output.c: Various formatting changes.
776209d6 1467
64d15509
AD
14682001-12-17 Akim Demaille <akim@epita.fr>
1469
1470 * src/files.c (output_files): Free the output_obstack.
1471 * src/main.c (main): Call print and print_graph conditionally.
1472 * src/print.c (print): Work unconditionally.
1473 * src/print_graph.c (print_graph): Work unconditionally.
1474 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1475
fbc8ecb7
MA
14762001-12-16 Marc Autret <autret_m@epita.fr>
1477
1478 * src/output.c (actions_output): Fix. When we use %no-lines,
1479 there is one less line per action.
1480
f0440388
MA
14812001-12-16 Marc Autret <autret_m@epita.fr>
1482
1483 * src/bison.simple: Remove a useless #line directive.
1484 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1485 * src/output.c (get_lines_number): New.
776209d6 1486 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1487 output muscles.
1488 Fix line numbering.
1489 (actions_output): Computes the number of lines taken by actions.
1490 (output_master_parser): Insert new skeleton which is the name of
1491 the output parser file name.
1492
a79986b8
MA
14932001-12-15 Marc Autret <autret_m@epita.fr>
1494
1495 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1496
4ec8e00f
MA
14972001-12-15 Marc Autret <autret_m@epita.fr>
1498
1499 * src/output.c (output_gram): Keep track of the hairy one.
1500
1a4648ff
AD
15012001-12-15 Akim Demaille <akim@epita.fr>
1502
1503 Make `make distcheck' work.
1504
1505 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1506 system.h which uses libgettext.h.
1507
9c2c67e6
AD
15082001-12-15 Akim Demaille <akim@epita.fr>
1509
1510 * src/nullable.c (set_nullable): Useless rules must be skipped,
1511 otherwise, since we range over their symbols, we might look at a
1512 nonterminal which no longer ``exists'', i.e., it is not counted in
1513 `nvars', hence we overflow our arrays.
1514
93ede233
AD
15152001-12-15 Akim Demaille <akim@epita.fr>
1516
1517 The header can also be produced directly, without any obstack!
1518 Yahoo!
1519
1520 * src/files.c, src/files.h (defines_obstack): Remove.
1521 (compute_header_macro): Global.
1522 (defines_obstack_save): Remove.
1523 * src/reader.c (parse_union_decl): No longer output to
1524 defines_obstack: its content can be found in the `stype' muscle
1525 anyway.
1526 (output_token_translations): Merge into...
1527 (symbols_output): this.
1528 Rename as...
1529 (symbols_save): this.
1530 (reader): Adjust.
1531 * src/output.c (header_output): New.
1532 (output): Call it.
1533
2666f928
AD
15342001-12-15 Akim Demaille <akim@epita.fr>
1535
1536 * src/reader.c (parse_union_decl): Instead of handling two obstack
1537 simultaneously, use one to define the `stype' muscle, and use the
1538 value of the latter to fill defines_obstack.
1539 (copy_comment): Remove.
1540 (copy_comment2): Work for a single obstack.
1541 Rename as...
1542 (copy_comment): this.
1543
428046f8
AD
15442001-12-15 Akim Demaille <akim@epita.fr>
1545
1546 * src/lex.c, src/lex.h (xgetc): No longer static.
1547 * src/reader.c (parse_union_decl): Revamp.
1548
ea52d706
AD
15492001-12-15 Akim Demaille <akim@epita.fr>
1550
1551 Still making progress in separating Bison into (i) input, (ii)
1552 process, (iii) output: now we can directly output the parser file
1553 without using table_obstack at all.
1554
1555 * src/files.c, src/files.h (table_obstack): Bye bye.
1556 (parser_file_name): New.
1557 * src/files.c (compute_output_file_names): Compute it.
1558 * src/output.c (actions_output, output_parser)
1559 (output_master_parser): To a file instead of an obstack.
1560
3f96f4dc
AD
15612001-12-15 Akim Demaille <akim@epita.fr>
1562
1563 Attach actions to rules, instead of pre-outputting them to
1564 actions_obstack.
1565
1566 * src/gram.h (rule_t): action and action_line are new members.
1567 * src/reader.c (symbol_list): Likewise.
1568 (copy_action): Save the actions within the rule.
1569 (packgram): Save them in rule_table.
1570 * src/output.c (actions_output): New.
1571 (output_parser): Use it on `%%actions'.
1572 (output_rule_data): Don't free rule_table.
1573 (output): Do it.
1574 (prepare): Don't save the `action' muscle.
1575 * src/bison.simple: s/%%action/%%actions/.
1576
51576fb3
AD
15772001-12-15 Akim Demaille <akim@epita.fr>
1578
1579 * src/reader.c (copy_action): When --yacc, don't append a `;'
1580 to the user action: let it fail if lacking.
dee049eb 1581 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1582
2648a72d
AD
15832001-12-14 Akim Demaille <akim@epita.fr>
1584
1585 * src/lex.c (literalchar): Simply return the char you decoded, non
1586 longer mess around with obstacks and int pointers.
1587 Adjust all callers.
1588
92790e5b
AD
15892001-12-14 Akim Demaille <akim@epita.fr>
1590
1591 * src/lex.c (literalchar): Don't escape the special characters,
1592 just decode them, and keep them as char (before, eol was output as
1593 the 2 char string `\n' etc.).
1594 * src/output.c (output_rule_data): Use quotearg to output the
1595 token strings.
1596
927c1557
PE
15972001-12-13 Paul Eggert <eggert@twinsun.com>
1598
1599 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1600 Do not infringe on the global user namespace when using C++.
1601 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1602 All uses of `fprintf' and `stderr' changed.
1603
1604 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1605
ed8e1f68
AD
16062001-12-13 Akim Demaille <akim@epita.fr>
1607
1608 The computation of nullable is broken: it doesn't handle empty
1609 RHS's properly.
1610
1611 * tests/torture.at (GNU AWK Grammar): New.
1612 * tests/sets.at (Nullable): New.
1613 * src/nullable.c (set_nullable): Instead of blindly looping over
1614 `ritems', loop over the rules, and then over their rhs's.
1615
1616 Work around Autotest bugs.
1617
1618 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1619 frame, because Autotest understand lines starting with a `+' as
1620 traces from the shell. Then, they are not processed properly.
1621 Admittedly an Autotest bug, but we don't have time to wait for
1622 Autotest to catch up.
1623 * tests/regression.at (Broken Closure): Adjust to the new table
1624 frames.
1625 Move to...
1626 * tests/sets.at: here.
1627
cb581495
AD
16282001-12-13 Akim Demaille <akim@epita.fr>
1629
1630 * src/closure.c (closure): Use nrules instead of playing tricks
1631 with BITS_PER_WORD.
1632
2e729273
AD
16332001-12-13 Akim Demaille <akim@epita.fr>
1634
1635 * src/print.c (print_actions): Output the handling of `$' as the
1636 traces do: shifting the token EOF. Before EOF was treated as a
1637 nonterminal.
1638 * tests/regression.at: Adjust some tests.
1639 * src/print_graph.c (print_core): Complete the set of items via
1640 closure. The next-to-final and final states are still unsatisfying,
1641 but that's to be addressed elsewhere.
1642 No longer output the rule numbers, but do output the state number.
1643 A single loop for the shifts + gotos is enough, but picked a
1644 distinct color for each.
1645 (print_graph): Initialize and finalize closure.
1646
107f7dfb
AD
16472001-12-13 Akim Demaille <akim@epita.fr>
1648
1649 * src/reader.c (readgram): Remove dead code, an strip useless
1650 braces.
1651 (get_type): Remove, unused.
1652
9b53a24f
AD
16532001-12-12 Akim Demaille <akim@epita.fr>
1654
1655 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1656 on that of lib/error.c.
1657
dbfb6dcd
AD
16582001-12-12 Akim Demaille <akim@epita.fr>
1659
1660 Some hosts don't like `/' in includes.
1661
1662 * src/system.h: Include libgettext.h without qualifying the path.
1663 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1664 $(top_srcdir).
1665
c25fb648
MA
16662001-12-11 Marc Autret <autret_m@epita.fr>
1667
1668 * src/output.c (output_parser): Remove useless muscle.
1669
710ddc4f
MA
16702001-12-11 Marc Autret <autret_m@epita.fr>
1671
1672 * src/bison.simple: Remove #line just before %%epilogue. It
1673 is now handled in ...
1674 * src/reader.c (read_additionnal_code): Add the output of a
1675 #line for the epilogue.
1676
e83d80b8
MA
16772001-12-10 Marc Autret <autret_m@epita.fr>
1678
927c1557 1679 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1680 replace precedent remove.
1681 * src/bison.simple: Remove #line before %%prologue because
1682 %%input-line is wrong at this time.
1683
971d5158
MA
16842001-12-10 Marc Autret <autret_m@epita.fr>
1685
1686 * src/reader.c (symbols_output): Clean up.
927c1557 1687 * src/output.c (output_gram, output): Clean up.
971d5158 1688
5edafffd
AD
16892001-12-10 Akim Demaille <akim@epita.fr>
1690
1691 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1692 * src/LR0.c (set_state_table): here.
1693 * src/lalr.c (lalr): Call it.
1694
0279f8e9
AD
16952001-12-10 Akim Demaille <akim@epita.fr>
1696
1697 * src/state.h (shifts): Remove the `number' member: shifts are
1698 attached to state, hence no longer need to be labelled with a
1699 state number.
1700
190c4f5f
AD
17012001-12-10 Akim Demaille <akim@epita.fr>
1702
1703 Now that states have a complete set of members, the linked list of
1704 shifts is useless: just fill directly the state's shifts member.
1705
1706 * src/state.h (shifts): Remove the `next' member.
1707 * src/LR0.c (first_state, last_state): Remove.
1708 Adjust the callers.
1709 (augment_automaton): Don't look for the shifts that must be added
1710 a shift on EOF: it is those of the state we looked for! But now,
1711 since shifts are attached, it is no longer needed to looking
1712 merely by its id: its number.
1713
2a73b93d
AD
17142001-12-10 Akim Demaille <akim@epita.fr>
1715
1716 * src/LR0.c (augment_automaton): Better variable locality.
1717 Remove an impossible branch: if there is a state corresponding to
1718 the start symbol being shifted, then there is shift for the start
1719 symbol from the initial state.
1720
74392f6a
AD
17212001-12-10 Akim Demaille <akim@epita.fr>
1722
1723 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1724 only when appropriate: when insert_start_shifting_state' is not
1725 invoked.
1726 * tests/regression.at (Rule Line Numbers): Adjust.
1727
37c82725
AD
17282001-12-10 Akim Demaille <akim@epita.fr>
1729
1730 * src/LR0.c (augment_automaton): Now that all states have shifts,
1731 merge the two cases addition shifts to the initial state.
1732
6a164e0c
AD
17332001-12-10 Akim Demaille <akim@epita.fr>
1734
1735 * src/lalr.c (set_state_table): Move to...
1736 * src/LR0.c: here.
1737 * src/lalr.c (lalr): Don't call it...
1738 * src/LR0.c (generate_states): do it.
1739 * src/LR0.h (first_state): Remove, only the table is used.
1740
7215de24
AD
17412001-12-10 Akim Demaille <akim@epita.fr>
1742
1743 * src/LR0.h (first_shift, first_reduction): Remove.
1744 * src/lalr.c: Don't use first_shift: find shifts through the
1745 states.
1746
80e25d4d
AD
17472001-12-10 Akim Demaille <akim@epita.fr>
1748
1749 * src/LR0.c: Attach shifts to states as soon as they are
1750 computed.
1751 * src/lalr.c (set_state_table): Instead of assigning shifts to
1752 state, just assert that the mapping was properly done.
1753
0ab3728b
AD
17542001-12-10 Akim Demaille <akim@epita.fr>
1755
1756 * src/LR0.c (insert_start_shift): Rename as...
1757 (insert_start_shifting_state): this.
1758 (insert_eof_shifting_state, insert_accepting_state): New.
1759 (augment_automaton): Adjust.
1760 Better locality of the variables.
1761 When looking if the start_symbol is shifted from the initial
1762 state, using `while (... symbol != start_symbol ...)' sounds
1763 better than `while (... symbol < start_symbol ...)': If fail
1764 to see how the order between symbols could be relevant!
1765
78af9bbc
AD
17662001-12-10 Akim Demaille <akim@epita.fr>
1767
1768 * src/getargs.h: Don't declare `spec_name_prefix' and
1769 `spec_file_prefix', declared by src/files.h.
1770 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1771 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1772 * src/output.c (prepare): Adjust.
1773 * src/reader.c (symbols_output): Likewise.
1774 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1775
bdef2a41
AD
17762001-12-10 Akim Demaille <akim@epita.fr>
1777
1778 * src/muscle_tab.c (muscle_init): NULL is a better default than
1779 `"0"'.
1780
3735969c
AD
17812001-12-10 Akim Demaille <akim@epita.fr>
1782
1783 * src/reader.c (reader): Calling symbols_output once is enough.
1784
49701457
AD
17852001-12-10 Akim Demaille <akim@epita.fr>
1786
1787 Now that states have a complete set of members, the linked list of
1788 reductions is useless: just fill directly the state's reductions
1789 member.
1790
1791 * src/state.h (struct reductions): Remove member `number' and
1792 `next'.
1793 * src/LR0.c (first_reduction, last_reduction): Remove.
1794 (save_reductions): Don't link the new reductions, store them in
1795 this_state.
1796 * src/lalr.c (set_state_table): No need to attach reductions to
1797 states, it's already done.
1798 * src/output.c (output_actions): No longer free the shifts, then
1799 the reductions, then the states: free all the states and their
1800 members.
1801
0edad749
AD
18022001-12-10 Akim Demaille <akim@epita.fr>
1803
1804 * src/options.c (OPTN, DRTV, BOTH): New.
1805 (option_table): Use them.
1806
0edad749
AD
1807 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1808 the job of system.h.
1809 * src/options.c: Don't include stdio.h and xalloc.h for the same
1810 reasons.
1811
5449dd0f
AD
18122001-12-10 Akim Demaille <akim@epita.fr>
1813
1814 * src/output.c (output, prepare): Make sure the values of the
1815 muscles `action' and `prologue' are 0-terminated.
1816
a870c567
AD
18172001-12-10 Akim Demaille <akim@epita.fr>
1818
1819 Clean up GCC warnings.
1820
1821 * src/reader.c (copy_action): `buf' is not used.
1822 (parse_skel_decl): Be static.
1823 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1824 * src/options.h (create_long_option_table): Have a real prototype.
1825 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1826 (hash_delete_at): Return const void *.
1827 Adjust casts to preserve the const.
1828
80df8768
AD
18292001-12-10 Akim Demaille <akim@epita.fr>
1830
1831 * configure.in: Require 2.52g.
1832 M4 is not needed, but AUTOM4TE is.
1833 * m4/m4.m4: Remove.
1834 * tests/Makefile.am: Adjust.
1835
f693ad14
AD
18362001-12-10 Akim Demaille <akim@epita.fr>
1837
1838 One structure for states is enough, even though theoretically
1839 there are LR(0) states and LALR(1) states.
1840
1841 * src/lalr.h (state_t): Remove.
1842 (state_table): Be state_t **, not state_t *.
1843 * src/state.h (core, CORE_ALLOC): Rename as...
1844 (state_t, STATE_ALLOC): this.
1845 Add the LALR(1) members: shifts, reductions, errs.
1846 * src/LR0.c (state_table): Rename as...
1847 (state_hash): this, to avoid name clashes with the global
1848 `state_table'.
1849 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1850 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1851
74ffbcb6
AD
18522001-12-10 Akim Demaille <akim@epita.fr>
1853
1854 Bison dumps core on bash.y.
1855 Reported by Pascal Bart.
1856
1857 * src/warshall.c (bitmatrix_print): New.
1858 (TC): Use it.
1859 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1860 j must be the outer loop.
1861 * tests/regression.at (Broken Closure): New.
1862
07708e19
AD
18632001-12-05 Akim Demaille <akim@epita.fr>
1864
1865 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1866 its argument.
1867