]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/output.h, src/output.c (get_lines_number): Remove.
[bison.git] / ChangeLog
CommitLineData
4f940944
AD
12002-04-22 Akim Demaille <akim@epita.fr>
2
3 * src/output.h, src/output.c (get_lines_number): Remove.
4
3ded9a63
AD
52002-04-19 Akim Demaille <akim@epita.fr>
6
7 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
8 as Lex/Flex'.
9 (Debugging): More details about enabling the debugging features.
10 (Table of Symbols): Describe $$, $n, @$, and @n.
11 Suggested by Tim Josling.
12
e0c471a9
AD
132002-04-19 Akim Demaille <akim@epita.fr>
14
15 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16
fecc10cd
AD
172002-04-10 Akim Demaille <akim@epita.fr>
18
19 * src/system.h: Rely on HAVE_LIMITS_H.
20 Suggested by Paul Eggert.
21
51dec47b
AD
222002-04-09 Akim Demaille <akim@epita.fr>
23
24 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
25 full stderr, and strip it according to the bison options, instead
26 of composing the error message from different bits.
27 This makes it easier to check for several error messages.
28 Adjust all the invocations.
29 Add an invocation exercising the error token.
30 Add an invocation demonstrating a stupid error message.
31 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
32 Adjust the tests.
33 Error message are for stderr, not stdout.
34
007a50a4
AD
352002-04-09 Akim Demaille <akim@epita.fr>
36
37 * src/gram.h, src/gram.c (error_token_number): Remove, use
38 errtoken->number.
39 * src/reader.c (reader): Don't specify the user token number (2)
40 for $undefined, as it uselessly prevents using it.
41 * src/gram.h (token_number_t): Move to...
42 * src/symtab.h: here.
43 (state_t.number): Is a token_number_t.
44 * src/print.c, src/reader.c: Use undeftoken->number instead of
45 hard coded 2.
46 (Even though this 2 is not the same as above: the number of the
47 undeftoken remains being 2, it is its user token number which
48 might not be 2).
49 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
50 `user_token_number_max'.
51 Output `undef_token_number'.
52 * data/bison.simple, data/bison.c++: Use them.
53 Be sure to map invalid yylex return values to
54 `undef_token_number'. This saves us from gratuitous SEGV.
55
56 * tests/conflicts.at (Solved SR Conflicts)
57 (Unresolved SR Conflicts): Adjust.
58 * tests/regression.at (Web2c Actions): Adjust.
59
06446ccf
AD
602002-04-08 Akim Demaille <akim@epita.fr>
61
62 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
63 Adding #line.
64 Remove the duplicate `typedefs'.
65 (RhsNumberType): Fix the declaration and various other typos.
66 Use __ofile__.
67 * data/bison.simple: Use __ofile__.
68 * src/scan-skel.l: Handle __ofile__.
69
62a3e4f0
AD
702002-04-08 Akim Demaille <akim@epita.fr>
71
72 * src/gram.h (item_number_t): New, the type of item numbers in
73 RITEM. Note that it must be able to code symbol numbers as
74 positive number, and the negation of rule numbers as negative
75 numbers.
76 Adjust all dependencies (pretty many).
77 * src/reduce.c (rule): Remove this `short *' pointer: use
78 item_number_t.
79 * src/system.h (MINSHORT, MAXSHORT): Remove.
80 Include `limits.h'.
81 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
82 (shortcpy): Remove.
83 (MAXTABLE): Move to...
84 * src/output.c (MAXTABLE): here.
85 (prepare_rules): Use output_int_table to output rhs.
86 * data/bison.simple, data/bison.c++: Adjust.
87 * tests/torture.at (Big triangle): Move the limit from 254 to
88 500.
89 * tests/regression.at (Web2c Actions): Ajust.
90
91 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
92 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
93 passes, but produces negative #line number, once fixed, GCC is
94 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
95 C), it passes.
96 * src/state.h (state_h): Code input lines on ints, not shorts.
97
bb88b0fc
AD
982002-04-08 Akim Demaille <akim@epita.fr>
99
100 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
101 and then the grammar.
102
9a636f47
AD
1032002-04-08 Akim Demaille <akim@epita.fr>
104
105 * src/system.h: No longer using strndup.
106
680e8701
AD
1072002-04-07 Akim Demaille <akim@epita.fr>
108
109 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
110 * src/output.c (output_table_data): Return the longest number.
111 (prepare_tokens): Output `token_number_max').
112 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
113 New.
114 Use them to define yy_token_number_type/TokenNumberType.
115 Use this type for yytranslate.
116 * tests/torture.at (Big triangle): Push the limit from 124 to
117 253.
118 * tests/regression.at (Web2c Actions): Adjust.
119
817e9f41
AD
1202002-04-07 Akim Demaille <akim@epita.fr>
121
122 * tests/torture.at (Big triangle): New.
123 (GNU AWK Grammar, GNU Cim Grammar): Move to...
124 * tests/existing.at: here.
125
5123689b
AD
1262002-04-07 Akim Demaille <akim@epita.fr>
127
128 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
129 nritems.
130 Adjust dependencies.
131
f3849179
AD
1322002-04-07 Akim Demaille <akim@epita.fr>
133
134 * src/reader.c: Normalize increments to prefix form.
135
bd02036a
AD
1362002-04-07 Akim Demaille <akim@epita.fr>
137
138 * src/reader.c, symtab.c: Remove debugging code.
139
db8837cb
AD
1402002-04-07 Akim Demaille <akim@epita.fr>
141
142 Rename all the `bucket's as `symbol_t'.
143
144 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
145 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
146 * src/symtab.c, src/symtab.h (bucket): Rename as...
147 (symbol_t): this.
148 (symbol_list_new, bucket_check_defined, bucket_make_alias)
149 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
150 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
151 (buckets_new, buckets_free, buckets_do): Rename as...
152 (symbol_list_new, symbol_check_defined, symbol_make_alias)
153 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
154 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
155 (symbols_new, symbols_free, symbols_do): these.
156
72a23c97
AD
1572002-04-07 Akim Demaille <akim@epita.fr>
158
159 Use lib/hash for the symbol table.
160
161 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
162 EOF.
163 * src/lex.c (lex): Set the `number' member of new terminals.
164 * src/reader.c (bucket_check_defined, bucket_make_alias)
165 (bucket_check_alias_consistence, bucket_translation): New.
166 (reader, grammar_free, readgram, token_translations_init)
167 (packsymbols): Adjust.
168 (reader): Number the predefined tokens.
169 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
170 for predefined tokens.
171 * src/symtab.h (bucket): Remove all the hash table related
172 members.
173 * src/symtab.c (symtab): Replace by...
174 (bucket_table): this.
175 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
176 (buckets_new, buckets_do): New.
177
280a38c3
AD
1782002-04-07 Akim Demaille <akim@epita.fr>
179
180 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
181 (start_symbol, max_user_token_number, semantic_parser)
182 (error_token_number): Initialize.
183 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
184 Initialize.
185 (reader): Don't.
186 (errtoken, eoftoken, undeftoken, axiom): Extern.
187
03b31c0c
AD
1882002-04-07 Akim Demaille <akim@epita.fr>
189
190 * src/gram.h (rule_s): prec and precsym are now pointers
191 to the bucket giving the priority/associativity.
192 Member `associativity' removed: useless.
193 * src/reduce.c, src/conflicts.c: Adjust.
194
8b3df748
AD
1952002-04-07 Akim Demaille <akim@epita.fr>
196
197 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
198 Properly escape the symbols' TAG when outputting them.
199
e601aa1d
AD
2002002-04-07 Akim Demaille <akim@epita.fr>
201
202 * src/lalr.h (LA): Is a bitsetv, not bitset*.
203
b0299a2e
AD
2042002-04-07 Akim Demaille <akim@epita.fr>
205
206 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
207 (LArule): this, which is an array to rule_t*.
208 * src/print.c, src/conflicts.c: Adjust.
209
d7e1f00c
AD
2102002-04-07 Akim Demaille <akim@epita.fr>
211
212 * src/gram.h (rule_t): Rename `number' as `user_number'.
213 `number' is a new member.
214 Adjust dependencies.
215 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
216
cc9305dd
AD
2172002-04-07 Akim Demaille <akim@epita.fr>
218
219 As a result of the previous patch, it is no longer needed
220 to reorder ritem itself.
221
222 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
223
b0940840
AD
2242002-04-07 Akim Demaille <akim@epita.fr>
225
226 Be sure never to walk through RITEMS, but use only data related to
227 the rules themselves. RITEMS should be banished.
228
229 * src/output.c (output_token_translations): Rename as...
230 (prepare_tokens): this.
231 In addition to `translate', prepare the muscles `tname' and
232 `toknum', which were handled by...
233 (output_rule_data): this.
234 Remove, and move the remainder of its outputs into...
235 (prepare_rules): this new routines, which also merges content from
236 (output_gram): this.
237 (prepare_rules): Be sure never to walk through RITEMS.
238 (output_stos): Rename as...
239 (prepare_stos): this.
240 (output): Always invoke prepare_states, after all, just don't use it
241 in the output if you don't need it.
242
643a5994
AD
2432002-04-07 Akim Demaille <akim@epita.fr>
244
245 * src/LR0.c (new_state): Display `nstates' as the name of the
246 newly created state.
247 Adjust to initialize first_state and last_state if needed.
248 Be sure to distinguish the initial from the final state.
249 (new_states): Create the itemset of the initial state, and use
250 new_state.
251 * src/closure.c (closure): Now that the initial state has its
252 items properly set, there is no need for a special case when
253 creating `ruleset'.
254
255 As a result, now the rule 0, reducing to $axiom, is visible in the
256 outputs. Adjust the test suite.
257
258 * tests/conflicts.at (Solved SR Conflicts)
259 (Unresolved SR Conflicts): Adjust.
260 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
261 * tests/conflicts.at (S/R in initial): New.
262
b4c4ccc2
AD
2632002-04-07 Akim Demaille <akim@epita.fr>
264
265 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
266 the RHS of the rules.
267 * src/output.c (output_gram): Likewise.
268
bba97eb2
AD
2692002-04-07 Akim Demaille <akim@epita.fr>
270
271 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
272 bucket.
273 Adjust all dependencies.
274 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
275 `number' of the buckets too.
276 * src/gram.h: Include `symtab.h'.
277 (associativity): Move to...
278 * src/symtab.h: here.
279 No longer include `gram.h'.
280
c3b407f4
AD
2812002-04-07 Akim Demaille <akim@epita.fr>
282
283 * src/gram.h, src/gram.c (rules_rhs_length): New.
284 (ritem_longest_rhs): Use it.
285 * src/gram.h (rule_t): `number' is a new member.
286 * src/reader.c (packgram): Set it.
287 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
288 the end of `rules', and count them out of `nrules'.
289 (reduce_output, dump_grammar): Adjust.
290 * src/print.c (print_grammar): It is no longer needed to check for
291 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
292 * tests/reduce.at (Reduced Automaton): New test.
293
11652ab3
AD
2942002-04-07 Akim Demaille <akim@epita.fr>
295
296 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
297 lacking `+ 1' to nrules, Bison reported as useless a token if it
298 was used solely to set the precedence of the last rule...
299
26b23c1a
AD
3002002-04-07 Akim Demaille <akim@epita.fr>
301
302 * data/bison.c++, data/bison.simple: Don't output the current file
303 name in #line, to avoid useless diffs between two identical
304 outputs under different names.
305
18bcecb0
AD
3062002-04-07 Akim Demaille <akim@epita.fr>
307
308 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
309 Normalize loops to using `< nrules + 1', not `<= nrules'.
310
fa770c86
AD
3112002-04-07 Akim Demaille <akim@epita.fr>
312
313 * TODO: Update.
314
d9b739c3
AD
3152002-04-07 Akim Demaille <akim@epita.fr>
316
317 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
318 bucket.value as bucket.number.
319
99013900
AD
3202002-04-07 Akim Demaille <akim@epita.fr>
321
322 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
323 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
324 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
325 RHS, instead of being an index in RITEMS.
326
e966383b
PE
3272002-04-04 Paul Eggert <eggert@twinsun.com>
328
329 * doc/bison.texinfo: Update copyright date.
330 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
331 (Symbols): Warn about running Bison in one character set,
332 but compiling and/or running in an incompatible one.
333 Warn about character code 256, too.
334
3352002-04-03 Paul Eggert <eggert@twinsun.com>
336
337 * src/bison.data (YYSTACK_ALLOC): Depend on whether
338 YYERROR_VERBOSE is nonzero, not whether it is defined.
339
340 Merge changes from bison-1_29-branch.
c307773e 341
8d6c48b9
PE
3422002-03-20 Paul Eggert <eggert@twinsun.com>
343
344 Merge fixes from Debian bison_1.34-1.diff.
345
346 * configure.in (AC_PREREQ): 2.53.
347
e53c6322
AD
3482002-03-20 Akim Demaille <akim@epita.fr>
349
350 * src/conflicts.c (log_resolution): Argument `resolution' is const.
351
9ffbeca7
PE
3522002-03-19 Paul Eggert <eggert@twinsun.com>
353
21db0b2a
PE
354 * src/bison.simple (YYCOPY): New macro.
355 (YYSTACK_RELOCATE): Use it.
356 Remove Type arg; no longer needed. All callers changed.
357 (yymemcpy): Remove; no longer needed.
358
9ffbeca7
PE
359 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
360 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
361
642cb8f8
AD
3622002-03-19 Akim Demaille <akim@epita.fr>
363
364 Test and fix the #line outputs.
365
366 * tests/atlocal.at (GCC): New.
367 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
368 (Prologue synch line, ,%union synch line, Postprologue synch line)
369 (Action synch line, Epilogue synch line): New tests.
370 * src/reader.c (parse_union_decl): Define the muscle stype_line.
371 * data/bison.simple, data/bison.c++: Use it.
372
3c31a486
AD
3732002-03-19 Akim Demaille <akim@epita.fr>
374
375 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
376 (Solved SR Conflicts, %expect not enough, %expect right)
377 (%expect too much): Move to...
378 * tests/conflicts.at: this new file.
379
0d8bed56
AD
3802002-03-19 Akim Demaille <akim@epita.fr>
381
382 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
383 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
384 that we can move to enums for instance.
385 * src/output.c (token_definitions_output): Output a list of
386 `token-name, token-number' instead of the #define.
387 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
388
9208d17f
AD
3892002-03-14 Akim Demaille <akim@epita.fr>
390
391 Use Gettext 0.11.1.
392
af27eacb
RA
3932002-03-09 Robert Anisko <robert@lrde.epita.fr>
394
395 * data/bison.c++: Make the user able to add members to the generated
396 parser by subclassing.
397
9101a310
RA
3982002-03-05 Robert Anisko <robert@lrde.epita.fr>
399
400 * src/reader.c (read_additionnal_code): `c' should be an integer, not
401 a character.
402 Reported by Nicolas Tisserand and Nicolas Burrus.
403
fff9bf0b
RA
4042002-03-04 Robert Anisko <robert@lrde.epita.fr>
405
406 * src/reader.c: Warn about lacking semi-colons, do not complain.
407
64dba31e
RA
4082002-03-04 Robert Anisko <robert@lrde.epita.fr>
409
410 * data/bison.c++: Remove a debug line.
411
374f5a14
RA
4122002-03-04 Robert Anisko <robert@lrde.epita.fr>
413
414 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
415 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
416 provide a default implementation.
417
bfcf1f3a
AD
4182002-03-04 Akim Demaille <akim@epita.fr>
419
420 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
421 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
422 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
423 * tests/semantic.at (Parsing Guards): Similarly.
424 * src/reader.at (readgram): Complain if the last rule is not ended
425 with a semi-colon.
426
65ccf9fc
AD
4272002-03-04 Akim Demaille <akim@epita.fr>
428
429 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
430 * src/closure.c: here.
431 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
432 RTC.
433 * src/warshall.h, src/warshall.c: Remove.
434 * tests/sets.at (Broken Closure): Adjust.
435
d0039cbc
AD
4362002-03-04 Akim Demaille <akim@epita.fr>
437
438 * src/output.c (output_skeleton): tempdir is const.
439 bytes_read is unused.
440
345cea78
AD
4412002-03-04 Akim Demaille <akim@epita.fr>
442
443 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
444 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
445 Update.
446 From Michael Hayes.
447
564801f7
AD
4482002-03-04 Akim Demaille <akim@epita.fr>
449
450 * src/closure.c (closure): `r' is unused.
451
e5352bc7
AD
4522002-03-04 Akim Demaille <akim@epita.fr>
453
454 * tests/sets.at (Broken Closure): Add the ending `;'.
455 * src/reader.at (readgram): Complain if a rule is not ended with a
456 semi-colon.
457
914feea9
AD
4582002-03-04 Akim Demaille <akim@epita.fr>
459
460 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
461 (count_sr_conflicts): Use bitset_count.
462 * src/reduce.c (inaccessable_symbols): Ditto.
463 (bits_size): Remove.
464 * src/warshall.h, src/warshall.c: Convert to bitsetv.
465
f0250de6
AD
4662002-03-04 Akim Demaille <akim@epita.fr>
467
468 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
469 * src/reduce.c: Remove the `bitset_zero's following the
470 `bitset_create's, as now it is performed by the latter.
471
ef017502
AD
4722002-03-04 Akim Demaille <akim@epita.fr>
473
474 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
475 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
476 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
477 latest sources from Michael.
478
76514394
AD
4792002-03-04 Akim Demaille <akim@epita.fr>
480
481 * src/output.c (output): Don't free the grammar.
482 * src/reader.c (grammar_free): New.
483 * src/main.c (main): Call it and don't free symtab here.
484
55024580
AD
4852002-03-04 Akim Demaille <akim@epita.fr>
486
487 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
488 before returning.
489 Reported by Benoit Perrot.
490
f9abaa2c
AD
4912002-03-04 Akim Demaille <akim@epita.fr>
492
493 Use bitset operations when possible, not loops over bits.
494
495 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
496 bitset_or.
497 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
498 * src/reduce.c (useless_nonterminals): Formatting changes.
499 * src/warshall.c (TC): Use bitset_or.
500
0e721e75
AD
5012002-03-04 Akim Demaille <akim@epita.fr>
502
503 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
504 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
505 Ditto.
506
0fb1ffb1
AD
5072002-03-04 Akim Demaille <akim@epita.fr>
508
509 * src/lalr.c (F): Now a bitset*.
510 Adjust all dependencies.
511
b86796bf
AD
5122002-03-04 Akim Demaille <akim@epita.fr>
513
514 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
515 Adjust all dependencies.
516
602bbf31
AD
5172002-03-04 Akim Demaille <akim@epita.fr>
518
519 * src/L0.c, src/LR0.h (nstates): Be size_t.
520 Adjust comparisons (signed vs unsigned).
521 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
522 bitset*.
523 Adjust all dependencies.
524
d8a0245c
AD
5252002-03-04 Akim Demaille <akim@epita.fr>
526
527 * src/closure.c (firsts): Now, also a bitset.
528 Adjust all dependencies.
529 (varsetsize): Remove, now unused.
530 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
531
34ba9743
AD
5322002-03-04 Akim Demaille <akim@epita.fr>
533
534 * src/print.c: Convert to use bitset.h, not hand coded iterations
535 over ints.
536
ed86e78c
AD
5372002-03-04 Akim Demaille <akim@epita.fr>
538
539 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
540
dfdb1797
AD
5412002-03-04 Akim Demaille <akim@epita.fr>
542
543 * src/closure.c (ruleset): Be a bitset.
544 (rulesetsize): Remove.
545
7086e707
AD
5462002-03-04 Akim Demaille <akim@epita.fr>
547
548 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
549 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
550 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
551 * src/closure.c (fderives): Be an array of bitsets.
552
98254360
RA
5532002-02-28 Robert Anisko <robert@lrde.epita.fr>
554
555 * data/bison.c++: Merge the two generated headers. Insert a copyright
556 notice in each output file.
557
a75c057f
AD
5582002-02-28 Akim Demaille <akim@epita.fr>
559
560 * data/bison.c++: Copy the prologue of bison.simple to fetch
561 useful M4 definitions, such as b4_header_guard.
562
06b00abc
AD
5632002-02-25 Akim Demaille <akim@epita.fr>
564
565 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
566 translator friendly scheme for the bgr
567 copyright notice.
06b00abc 568
70e7d534
AD
5692002-02-25 Akim Demaille <akim@epita.fr>
570
571 * src/output.c (header_output): Remove, now handled completely via
572 M4.
573
abe017f6
AD
5742002-02-25 Akim Demaille <akim@epita.fr>
575
576 * m4/m4.m4: New, from CVS Autoconf.
577 * configure.in: Invoke it.
578 * src/output.c (output_skeleton): Use its result instead of the
579 hard coded name.
580
381fb12e
AD
5812002-02-25 Akim Demaille <akim@epita.fr>
582
583 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
584 Fileutils 4.1.5.
585 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
586 * src/output.c (output_skeleton): Use mkstemp to create a real
587 temporary file.
588 Move the filling of `skeleton' and its muscle to...
589 (prepare): here.
590 (output): Move the definition of the prologue muscle to...
591 (prepare): here.
592 * src/system.h (DEFAULT_TMPDIR): New.
593
6f38107f
PE
5942002-02-14 Paul Eggert <eggert@twinsun.com>
595
596 Remove the support for C++ namespace cleanliness; it was
597 causing more problems than it was curing, since it didn't work
598 properly on some nonstandard C++ compilers. This can wait
599 for a proper C++ parser.
600
601 * NEWS: Document this.
602 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
603 of C++, as it's treated like C now.
604 * src/bison.simple (YYSTD): Remove.
605 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
606 Treat C++ just like Standard C instead of trying to support
607 namespace cleanliness.
608
80cce3da
AD
6092002-02-14 Akim Demaille <akim@epita.fr>
610
611 * tests/regression.at (else): Adjust to Andreas' change.
612
842e8679
AD
6132002-02-14 Akim Demaille <akim@epita.fr>
614
615 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
616
4bda3f10
AD
6172002-02-13 Andreas Schwab <schwab@suse.de>
618
619 * src/output.c (output_rule_data): Don't output NULL, it might
620 not be defined yet.
621
4162fa07 6222002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 623
4162fa07
RA
624 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
625 (Copyright notice): Update.
b418ecd8 626
bd16a5dc
AD
6272002-02-11 Akim Demaille <akim@epita.fr>
628
629 * tests/regression.at (%nonassoc and eof): Don't include
630 nonportable headers.
631
8d69a1a3
RA
6322002-02-08 Robert Anisko <robert@lrde.epita.fr>
633
634 * data/bison.c++: Correct error recovery. Make the user able to
635 initialize the starting location.
636
9b2d0677
AD
6372002-02-07 Akim Demaille <akim@epita.fr>
638
639 * tests/input.at: New.
640
69e2658b
RA
6412002-02-07 Robert Anisko <robert@lrde.epita.fr>
642
643 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 644 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
645 directives around tables only needed for debugging.
646
4aacc3a7
RA
6472002-02-07 Robert Anisko <robert@lrde.epita.fr>
648
649 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
650 C++ parsers.
651 (yy::b4_name::parse): Use print_.
652
762a801e
RA
6532002-02-07 Robert Anisko <robert@lrde.epita.fr>
654
655 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
656
4bb2bc3f
RA
6572002-02-07 Robert Anisko <robert@lrde.epita.fr>
658
659 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
660 C++ parsers.
661 (yy::b4_name::parse): Build verbose error messages, and use error_.
662
6b45a3ca
RA
6632002-02-06 Robert Anisko <robert@lrde.epita.fr>
664
665 * data/bison.c++: Fix m4 quoting in comments.
666
50997c6e
RA
6672002-02-06 Robert Anisko <robert@lrde.epita.fr>
668
669 * data/bison.c++: Adjust the parser code. Fix some muscles that were
670 not expanded by m4.
671
3f3eed27
AD
6722002-02-05 Akim Demaille <akim@epita.fr>
673
674 * data/bison.c++: Adjust to the M4 back end.
675 More is certainly needed.
676
be2a1a68
AD
6772002-02-05 Akim Demaille <akim@epita.fr>
678
679 Give a try to M4 as a back end.
680
681 * lib/readpipe.c: New, from wdiff.
682 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
683 BISON_HAIRY.
684 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
685 specific values. Now it is m4 that performs the lookup.
686 * src/parse-skel.y: Remove.
687 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
688 * src/output.c (actions_output, guards_output)
689 (token_definitions_output): No longer keeps track of the output
690 line number, hence remove the second argument.
691 (guards_output): Check against the guard member of a rule, not the
692 action member.
693 Adjust callers.
694 (output_skeleton): Don't look for the skeleton location, let m4 do
695 that.
696 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
697 file will be used.
698 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
699 (prepare): Given that for the time being changesyntax is not
700 usable in M4, rename the muscles using `-' to `_'.
701 Define `defines_flag', `output_parser_name' and `output_header_name'.
702 * src/output.h (actions_output, guards_output)
703 (token_definitions_output): Adjust prototypes.
704 * src/scan-skel.l: Instead of scanning the skeletons, it now
705 processes the output of m4: `__oline__' and `#output'.
706 * data/bison.simple: Adjust to be used by M4(sugar).
707 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
708 to date.
709 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
710 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
711 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
712 shamelessly stolen from CVS Autoconf.
713
beda758b
AD
7142002-02-05 Akim Demaille <akim@epita.fr>
715
716 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
717 * configure.in: Check for the declarations of free and malloc.
718 * src/muscle_tab.c: Adjust.
719
5ece6d43
AD
7202002-02-05 Akim Demaille <akim@epita.fr>
721
722 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
723 which have no values.
724
5bb18f9a
AD
7252002-02-05 Akim Demaille <akim@epita.fr>
726
727 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
728 * data/: here.
729
894dd62e
PE
7302002-01-29 Paul Eggert <eggert@twinsun.com>
731
732 * src/bison.simple (YYSIZE_T): Do not define merely because
733 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
734 On some platforms, <alloca.h> does not declare YYSTD (size_t).
735
82841af7
AD
7362002-01-27 Akim Demaille <akim@epita.fr>
737
738 Fix `%nonassoc and eof'.
739
740 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
741 which were not properly copied! Replace
742 memcpy (res->errs, src->errs, src->nerrs);
743 with
744 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
745 !!!
746 * tests/regression.at (%nonassoc and eof): Adjust to newest
747 Autotest: `.' is not in the PATH.
748
318b76e9
AD
7492002-01-27 Akim Demaille <akim@epita.fr>
750
751 * tests/sets.at (AT_EXTRACT_SETS): New.
752 (Nullable): Use it.
753 (Firsts): New.
754
30d2f3d5
AD
7552002-01-26 Akim Demaille <akim@epita.fr>
756
757 * tests/actions.at, tests/calc.at, tests/headers.at,
758 * tests/torture.at: Adjust to the newest Autotest which no longer
759 forces `.' in the PATH.
760
30f8c395
AD
7612002-01-25 Akim Demaille <akim@epita.fr>
762
763 * tests/regression.at (%nonassoc and eof): New.
764 Suggested by Robert Anisko.
765
29ae55f1
AD
7662002-01-24 Akim Demaille <akim@epita.fr>
767
768 Bison dumps core when trying to complain about broken input files.
769 Reported by Cris van Pelt.
770
771 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
772 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
773 into...
774 (Invalid inputs): Strengthen: exercise parse_percent_token.
775
2b548aa6
RA
7762002-01-24 Robert Anisko <robert.anisko@epita.fr>
777
778 * src/Makefile.am: Add bison.c++.
779 * src/bison.c++: New skeleton.
780
bb0146c2
AD
7812002-01-21 Paolo Bonzini <bonzini@gnu.org>
782
783 * po/it.po: New.
784
bec30531
AD
7852002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
786
787 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
788
fc6edc45
MA
7892002-01-20 Marc Autret <marc@gnu.org>
790
791 * src/files.c (compute_output_file_names): Fix
792
5e5d5415
MA
7932002-01-20 Marc Autret <marc@gnu.org>
794
795 * tests/output.at: New test.
796 * src/files.c (compute_base_names): Don't map extensions when
797 the YACC flag is set, use defaults.
798 Reported by Evgeny Stambulchik.
799
44ea3fbd
MA
8002002-01-20 Marc Autret <marc@gnu.org>
801
bb0146c2 802 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
803 compilers as well (i.e. the vendor C compiler).
804 Suggested by Albert Chin-A-Young.
805
338963d1
TVH
8062002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
807
808 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
809 canonical definition.
810 * src/system.h: Use the canonical definition for PARAMS (avoids
811 a conflict with the macro from lib/hash.h).
812
c57b2479
AD
8132002-01-11 Akim Demaille <akim@epita.fr>
814
815 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 816 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 817
b85810ae
AD
8182002-01-09 Akim Demaille <akim@epita.fr>
819
820 * src/files.c, src/files.h (output_infix): New.
821 (tab_extension): Remove.
822 (compute_base_names): Compute the former, drop the latter.
823 * src/output.c (prepare): Insert the muscles `output-infix', and
824 `output-suffix'.
825 * src/parse-skel.y (string, string.1): New.
826 (section.header): Use it.
827 (section.yacc): Remove.
828 (prefix): Remove too.
829 * src/scan-skel.l: Adjust.
830 * src/bison.simple, src/bison.hairy: Adjust.
831
cae60122
AD
8322002-01-09 Akim Demaille <akim@epita.fr>
833
834 * configure.in (WERROR_CFLAGS): Compute it.
835 * src/Makefile.am (CFLAGS): Pass it.
836 * tests/atlocal.in (CFLAGS): Idem.
837 * src/files.c: Fix a few warnings.
838 (get_extension_index): Remove, unused.
839
ae404801
AD
8402002-01-08 Akim Demaille <akim@epita.fr>
841
842 * src/getargs.c (AS_FILE_NAME): New.
843 (getargs): Use it to convert DOSish file names.
844 * src/files.c (base_name): Rename as full_base_name to avoid
845 clashes with `base_name ()'.
846 (filename_split): New.
847 (compute_base_names): N-th rewrite, using filename_split.
848
22312b71
AD
8492002-01-08 Akim Demaille <akim@epita.fr>
850
851 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
852 New, stolen from the Fileutils 4.1.
853 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
854 * configure.in: Check for the presence of memrchr, and of its
855 prototype.
856
a67cef01
TVH
8572002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
858
859 * lib/hash.h (__P): Added definition for this macro.
860 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
861 BUILT_SOURCES, to ensure they are generated first.
862 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
863 %error-verbose to allow bootstrapping with bison 1.30x.
864
2b25d624
AD
8652002-01-06 Akim Demaille <akim@epita.fr>
866
867 * src/reader.c (parse_braces): Don't fetch the next char, the
868 convention is to fetch on entry.
869 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
870 'switch' without a following semicolon.
871 * tests/regression.at (braces parsing): New.
872
3460813b
AD
8732002-01-06 Akim Demaille <akim@epita.fr>
874
875 Bison is dead wrong in its RR conflict reports.
876
877 * tests/torture.at (GNU Cim Grammar): New.
878 * src/conflicts.c (count_rr_conflicts): Fix.
879
73784c64
AD
8802002-01-06 Akim Demaille <akim@epita.fr>
881
882 Creating package.m4 from configure.ac causes too many problems.
883
884 * tests/Makefile.am (package.m4): Create it by hand,
885 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
886
25d81090
AD
8872002-01-06 Akim Demaille <akim@epita.fr>
888
889 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
890 skeleton.h.
891
a9b8959e
PE
8922002-01-04 Paul Eggert <eggert@twinsun.com>
893
894 * doc/bison.texinfo (Debugging):
895 Remove YYSTDERR; it's no longer defined or used.
896 Also, s/cstdio.h/cstdio/.
897
25d81090
AD
8982002-01-03 Akim Demaille <akim@epita.fr>
899
900 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
901
1109455c
AD
9022002-01-03 Akim Demaille <akim@epita.fr>
903
904 * src/parse-skel.y (process_skeleton): Don't bind the parser's
905 tracing code to --trace, wait for a better --trace option, with
906 args.
907
7ea5e977
AD
9082002-01-03 Akim Demaille <akim@epita.fr>
909
910 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
911 The ISO C++ standard is extremely clear about it: stderr is
912 considered a macro, not a regular symbol (see table 94 `Header
913 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
914 Therefore std:: does not apply to it. It still does with fprintf.
915 Also, s/cstdio.h/cstdio/.
916
fab5b110
AD
9172002-01-03 Akim Demaille <akim@epita.fr>
918
919 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
920 for non system headers.
921
aed7fd9b
AD
9222002-01-02 Akim Demaille <akim@epita.fr>
923
924 Equip the skeleton chain with location tracking, runtime trace,
925 pure parser and scanner.
926
927 * src/parse-skel.y: Request a pure parser, locations, and prefix
928 renaming.
929 (%union): Having several members with the same type does not help
930 type mismatches, simplify.
931 (YYPRINT, yyprint): New.
932 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
933 (skel_error): this.
934 Handle locations.
935 * src/scan-skel.l: Adjust to these changes.
936 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
937 (LOCATION_PRINT, skel_control_t): New.
938
24fad99e
AD
9392001-12-30 Akim Demaille <akim@epita.fr>
940
941 * src/parse-skel.y: Get rid of the shift/reduce conflict:
942 replace `gb' with BLANKS.
943 * src/scan-skel.l: Adjust.
944
a4b36db4
AD
9452001-12-30 Akim Demaille <akim@epita.fr>
946
947 * src/system.h: We don't need nor want bcopy.
948 Throw away MS-DOS crap: we don't need getpid.
949 * configure.in: We don't need strndup. It was even causing
950 problems: because Flex includes the headers *before* us,
951 _GNU_SOURCE is not defined by config.h, and therefore strndup was
952 not visible.
953 * lib/xstrndup.c: New.
954 * src/scan-skel.l: Use it.
955 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
956 * src/parse-skel.y: Use %directives instead of #defines.
957
1239777d
AD
9582001-12-30 Akim Demaille <akim@epita.fr>
959
960 * src/skeleton.h: New.
961 * src/output.c (output_parser, output_master_parser): Remove, dead
962 code.
963 * src/output.h (get_lines_number, actions_output, guards_output)
964 (token_definitions_output): Prototype them.
965 * src/parse-skel.y: Add the license notice.
966 Include output.h and skeleton.h.
967 (process_skeleton): Returns void, and takes a single parameter.
968 * src/scan-skel.l: Add the license notice.
969 Include skeleton.h.
970 Don't use %option yylineno: it seems that then Flex imagines
971 REJECT has been used, and therefore it won't reallocate its
972 buffers (which makes no other sense to me than a bug). It results
973 in warnings for `unused: yy_flex_realloc'.
974
9b3add5b
RA
9752001-12-30 Robert Anisko <robert.anisko@epita.fr>
976
977 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
978 (MUSCLE_INSERT_PREFIX): ...to there.
979 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
980 (MUSCLE_INSERT_PREFIX): Move from here...
981
982 * src/bison.hairy: Add a section directive. Put braces around muscle
983 names. This parser skeleton is still broken, but Bison should not
984 choke on a bad muscle 'syntax'.
985 * src/bison.simple: Add a section directive. Put braces around muscle
986 names.
987
988 * src/files.h (strsuffix, stringappend): Add declarations.
989 (tab_extension): Add declaration.
990 (short_base_name): Add declaration.
991
992 * src/files.c (strsuffix, stringappend): No longer static. These
993 functions are used in the skeleton parser.
994 (tab_extension): New.
995 (compute_base_names): Use the computations done in this function
fab5b110 996 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
997 names.
998 (short_base_name): No longer static.
999
1000 * src/output.c (output_skeleton): New.
1001 (output): Disable call to output_master_parser, and give a try to
1002 a new skeleton handling system.
1003 (guards_output, actions_output): No longer static.
1004 (token_definitions_output, get_lines_number): No longer static.
1005
1006 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1007
fab5b110 1008 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1009 parse-skel.y.
1010
1011 * src/parse-skel.y: New file.
1012 * src/scan-skel.l: New file.
1013
b5b61c61
AD
10142001-12-29 Akim Demaille <akim@epita.fr>
1015
1016 %name-prefix is broken.
1017
1018 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1019 Adjust all dependencies.
1020 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1021 %name-prefix.
1022
1023 Renaming yylval but not yylloc is not consistent. Now we do.
1024
1025 * src/bison.simple: Prefix yylloc if used.
1026 * doc/bison.texinfo (Decl Summary): Document that.
1027
8c9a50be
AD
10282001-12-29 Akim Demaille <akim@epita.fr>
1029
1030 * doc/bison.texinfo: Promote `%long-directive' over
1031 `%long_directive'.
1032 Remove all references to fixed-output-files, yacc is enough.
1033
d99361e6
AD
10342001-12-29 Akim Demaille <akim@epita.fr>
1035
1036 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1037 user prologue. These are defaults.
1038 * tests/actions.at (Mid-rule actions): Make sure the user can
1039 define YYDEBUG and YYERROR_VERBOSE.
1040
b9cecb91
AD
10412001-12-29 Akim Demaille <akim@epita.fr>
1042
1043 * src/output.c (header_output): Don't forget to export YYLTYPE and
1044 yylloc.
1045 * tests/headers.at (export YYLTYPE): New, make sure it does.
1046 * tests/regression.at (%union and --defines, Invalid CPP headers):
1047 Move to...
1048 * tests/headers.at: here.
1049
aea13e97
AD
10502001-12-29 Akim Demaille <akim@epita.fr>
1051
1052 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1053
931394cb
AD
10542001-12-29 Akim Demaille <akim@epita.fr>
1055
1056 * tests/actions.at (Mid-rule actions): Output on a single line
1057 instead of several.
1058
704a47c4
AD
10592001-12-29 Akim Demaille <akim@epita.fr>
1060
1061 * doc/bison.texinfo: Formatting changes.
1062
091e20bb
AD
10632001-12-29 Akim Demaille <akim@epita.fr>
1064
1065 Don't store the token defs in a muscle, just be ready to output it
1066 on command. Now possible via `symbols'. Fixes a memory leak.
1067
1068 * src/output.c (token_definitions_output): New.
1069 (output_parser, header_output): Use it.
1070 * src/reader.c (symbols_save): Remove.
1071
cce71710
AD
10722001-12-29 Akim Demaille <akim@epita.fr>
1073
1074 * src/bison.simple: Do not provide a default for YYSTYPE and
1075 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1076 default.
1077
82c035a8
AD
10782001-12-29 Akim Demaille <akim@epita.fr>
1079
1080 Mid-rule actions are simply... ignored!
1081
1082 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1083 the empty-rule associated to the dummy symbol, not to the host
1084 rule.
1085 * tests/actions.at (Mid-rule actions): New.
1086
8419d367
AD
10872001-12-29 Akim Demaille <akim@epita.fr>
1088
1089 Memory leak.
1090
1091 * src/reader.c (reader): Free grammar.
1092
375d5806
AD
10932001-12-29 Akim Demaille <akim@epita.fr>
1094
1095 Memory leak.
1096
1097 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1098 since it allocates it for each state, although only one is needed.
1099 (allocate_storage): Do it here.
1100
f51cb8ff
AD
11012001-12-29 Akim Demaille <akim@epita.fr>
1102
1103 * src/options.h, src/options.c (create_long_option_table): Rename
1104 as...
1105 (long_option_table_new): this, with a clearer prototype.
1106 (percent_table): Remove, unused,
1107 * src/getargs.c (getargs): Adjust.
1108
29e88316
AD
11092001-12-29 Akim Demaille <akim@epita.fr>
1110
1111 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1112 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1113 as states.
1114
b9f71f19
AD
11152001-12-29 Akim Demaille <akim@epita.fr>
1116
1117 * src/lalr.c (build_relations): Rename `states' as `states1'.
1118 Sorry, I don't understand exactly what it is, no better name...
1119
1a2b5d37
AD
11202001-12-29 Akim Demaille <akim@epita.fr>
1121
1122 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1123 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1124 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1125 as rules.
1126
1cca533e
AD
11272001-12-29 Akim Demaille <akim@epita.fr>
1128
1129 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1130 ago.
1131
c03ae966
AD
11322001-12-29 Akim Demaille <akim@epita.fr>
1133
1134 * src/reader.c, src/reader.h (user_toknums): Remove.
1135 Adjust all users to use symbols[i]->user_token_number.
1136
5a670b1e
AD
11372001-12-29 Akim Demaille <akim@epita.fr>
1138
1139 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1140 Adjust all users to use symbols[i]->prec or ->assoc.
1141
ad949da9
AD
11422001-12-29 Akim Demaille <akim@epita.fr>
1143
1144 * src/reader.c, src/reader.h (tags): Remove.
1145 Adjust all users to use symbols[i]->tag.
1146
0e78e603
AD
11472001-12-29 Akim Demaille <akim@epita.fr>
1148
1149 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1150 and rule_table.
1151 * src/reader.c (packsymbols): Fill this table.
1152 Drop sprec.
1153 * src/conflicts.c (resolve_sr_conflict): Adjust.
1154 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1155 single table.
1156 Use symbols[i]->tag instead of tags[i].
1157
213e640e
AD
11582001-12-29 Akim Demaille <akim@epita.fr>
1159
1160 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1161 In addition, put a comment in there, to replace...
1162 * tests/regression.at (%union and C comments): Remove.
1163
e7b8bef1
AD
11642001-12-29 Akim Demaille <akim@epita.fr>
1165
1166 * tests/regression.at (Web2c Actions): Blindly move the actual
1167 output as expected output. The contents *seem* right to me, but I
1168 can't pretend reading perfectly parser tables... Nonetheless, all
1169 the other tests pass correctly, the table look OK, even though the
1170 presence of `$axiom' is to be noted: AFAICS it is useless (but
1171 harmless).
1172
b68e7744
AD
11732001-12-29 Akim Demaille <akim@epita.fr>
1174
1175 * src/reader.c (readgram): Don't add the rule 0 if there were no
1176 rules read. In other words, add it _after_ having performed
1177 grammar sanity checks.
1178 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1179
78d5bae9
AD
11802001-12-29 Akim Demaille <akim@epita.fr>
1181
1182 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1183 visible, and some states have now a different number.
1184
ff442794
AD
11852001-12-29 Akim Demaille <akim@epita.fr>
1186
1187 * src/reader.c (readgram): Bind the initial rule's lineno to that
1188 of the first rule.
1189 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1190 (Solved SR Conflicts): Adjust rule 0's line number.
1191
610ab194
AD
11922001-12-29 Akim Demaille <akim@epita.fr>
1193
1194 Fix the `GAWK Grammar' failure.
1195
1196 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1197 the reductions of the first state which was mistakenly confused
1198 with the final state because precisely final_state was initialized
1199 to 0.
1200 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1201 now noticed by Bison.
1202 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1203 have a reduction on $default.
1204
29d29c8f
AD
12052001-12-29 Akim Demaille <akim@epita.fr>
1206
1207 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1208 rule line numbers.
1209 * src/closure.c (print_closure): Likewise.
1210 * src/derives.c (print_derives): Likewise.
1211 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1212 now.
1213
7c6b64d0
AD
12142001-12-29 Akim Demaille <akim@epita.fr>
1215
1216 * src/lalr.c (lookaheads_print): New.
1217 (lalr): Call it when --trace-flag.
1218 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1219 are dumped.
1220
3d4daee3
AD
12212001-12-29 Akim Demaille <akim@epita.fr>
1222
1223 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1224 when walking through ritem, even via rule->rhs.
1225 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1226 (useful_production, useless_nonterminals): Likewise.
1227 (reduce_grammar_tables): Likewise, plus update nritems.
1228 * src/nullable.c (set_nullable): Likewise.
1229 * src/lalr.c (build_relations): Likewise.
1230 * tests/sets.at (Nullable): Adjust.
1231 Fortunately, now, the $axiom is no longer nullable.
1232
9e7f6bbd
AD
12332001-12-29 Akim Demaille <akim@epita.fr>
1234
1235 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1236 the 0-sentinel.
1237 * src/gram.c (ritem_longest_rhs): Likewise.
1238 * src/reduce.c (nonterminals_reduce): Likewise.
1239 * src/print_graph.c (print_graph): Likewise.
1240 * src/output.c (output_rule_data): Likewise.
1241 * src/nullable.c (set_nullable): Likewise.
1242
255ef638
AD
12432001-12-29 Akim Demaille <akim@epita.fr>
1244
1245 * src/output.c: Comment changes.
1246
0d8a7363
AD
12472001-12-27 Paul Eggert <eggert@twinsun.com>
1248
1249 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1250 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1251 Sparc, as they were causing more porting problems than the
1252 (minor) performance improvement was worth.
1253
1254 Also, catch up with 1.31's YYSTD.
1255
3db472b9
AD
12562001-12-27 Akim Demaille <akim@epita.fr>
1257
1258 * src/output.c (output_gram): Rely on nritems, not the
1259 0-sentinel. See below.
1260 Use -1 as separator, not 0.
1261 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1262 Rely on -1 as separator in yyrhs, instead of 0.
1263 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1264 twice `Now at end of input', therefore there are two lines less to
1265 expect.
1266
b365aa05
AD
12672001-12-27 Akim Demaille <akim@epita.fr>
1268
1269 * tests/regression.at (Unresolved SR Conflicts):
1270 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1271 below.
1272
30171f79
AD
12732001-12-27 Akim Demaille <akim@epita.fr>
1274
1275 * src/LR0.c (new_state): Recognize the final state by the fact it
1276 is reached by eoftoken.
1277 (insert_start_shifting_state, insert_eof_shifting_state)
1278 (insert_accepting_state, augment_automaton): Remove, since now
1279 these states are automatically computed from the initial state.
1280 (generate_states): Adjust.
1281 * src/print.c: When reporting a rule number to the user, substract
1282 1, so that the axiom rule is rule 0, and the first user rule is 1.
1283 * src/reduce.c: Likewise.
1284 * src/print_graph.c (print_core): For the time being, just as for
1285 the report, depend upon --trace-flags to dump the full set of
1286 items.
1287 * src/reader.c (readgram): Once the grammar read, insert the rule
1288 0: `$axiom: START-SYMBOL $'.
1289 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1290 number of the states has changed (the final state is no longer
1291 necessarily the last), catch up.
1292
75142d45
AD
12932001-12-27 Akim Demaille <akim@epita.fr>
1294
1295 Try to make the use of the eoftoken valid. Given that its value
1296 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1297 is used instead of > 0 where appropriate, (ii), depend upon nritems
1298 instead of the 0-sentinel.
1299
1300 * src/gram.h, src/gram.c (nritems): New.
1301 Expected to be duplication of nitems, but for the time being...
1302 * src/reader.c (packgram): Assert nritems and nitems are equal.
1303 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1304 * src/closure.c (print_closure, print_fderives): Likewise.
1305 * src/gram.c (ritem_print): Likewise.
1306 * src/print.c (print_core, print_grammar): Likewise.
1307 * src/print_graph.c: Likewise.
1308
b7c49edf
AD
13092001-12-27 Akim Demaille <akim@epita.fr>
1310
1311 * src/main.c (main): If there are complains after grammar
1312 reductions, then output the report anyway if requested, then die.
1313 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1314 * src/reader.c (eoftoken): New.
1315 (parse_token_decl): If the token being defined has value `0', it
1316 is the eoftoken.
1317 (packsymbols): No longer hack `tags' to insert `$' by hand.
1318 Be sure to preserve the value of the eoftoken.
1319 (reader): Make sure eoftoken is defined.
1320 Initialize nsyms to 0: now eoftoken is created just like the others.
1321 * src/print.c (print_grammar): Don't special case the eof token.
1322 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1323 lie anyway, albeit pleasant.
1324 * tests/calc.at: Exercise error messages with eoftoken.
1325 Change the grammar so that empty input is invalid.
1326 Adjust expectations.
1327 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1328
ec2da99f
AD
13292001-12-27 Akim Demaille <akim@epita.fr>
1330
1331 * configure.in: Check the protos of strchr ans strspn.
1332 Replace strchr if needed.
1333 * src/system.h: Provide the protos of strchr, strspn and memchr if
1334 missing.
1335 * lib/strchr.c: New.
1336 * src/reader.c (symbols_save): Use strchr.
1337
8adfa272
AD
13382001-12-27 Akim Demaille <akim@epita.fr>
1339
1340 * src/print.c, src/print_graph.c (escape): New.
1341 Use it to quote the TAGS outputs.
1342 * src/print_graph.c (print_state): Now errors are in red, and
1343 reductions in green.
1344 Prefer high to wide: output the state number on a line of its own.
1345
80dac38c
AD
13462001-12-27 Akim Demaille <akim@epita.fr>
1347
1348 * src/state.h, src/state.c (reductions_new): New.
1349 * src/LR0.c (set_state_table): Let all the states have a
1350 `reductions', even if reduced to 0.
1351 (save_reductions): Adjust.
1352 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1353 * src/print.c (print_reductions, print_actions): Adjust.
1354 * src/output.c (action_row): Adjust.
1355
2cec70b9
AD
13562001-12-27 Akim Demaille <akim@epita.fr>
1357
1358 * src/state.h, src/state.c (errs_new, errs_dup): New.
1359 * src/LR0.c (set_state_table): Let all the states have an errs,
1360 even if reduced to 0.
1361 * src/print.c (print_errs, print_reductions): Adjust.
1362 * src/output.c (output_actions, action_row): Adjust.
1363 * src/conflicts.c (resolve_sr_conflict): Adjust.
1364
13ca549a
AD
13652001-12-27 Akim Demaille <akim@epita.fr>
1366
1367 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1368
5092aba5
AD
13692001-12-27 Akim Demaille <akim@epita.fr>
1370
1371 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1372 * src/print.c: here.
1373 (lookaheadset, shiftset): New, used as additional storage by
1374 print_reductions.
1375 (print_results): Adjust.
1376 (print_shifts, print_gotos, print_errs): New, extracted from...
1377 (print_actions): here.
1378 * src/print_graph.c (print_actions): Remove dead code.
1379
11e2beca
AD
13802001-12-27 Akim Demaille <akim@epita.fr>
1381
1382 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1383 `$n' and `@n'.
1384
dac3c910
AD
13852001-12-27 Akim Demaille <akim@epita.fr>
1386
1387 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1388 (build_relations): Adjust.
1389
d0b0fefa
AD
13902001-12-27 Akim Demaille <akim@epita.fr>
1391
1392 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1393 duplication.
1394
adc8c848
AD
13952001-12-27 Akim Demaille <akim@epita.fr>
1396
1397 * src/reader.c (packgram): Catch nitems overflows.
1398
14d293ac
AD
13992001-12-27 Akim Demaille <akim@epita.fr>
1400
1401 * src/files.c, src/files.h (guard_obstack): Remove.
1402 * src/output.c (output): Adjust.
1403 * src/reader.c (parse_braces): New, factoring...
1404 (copy_action, copy_guard): these two which are renamed as...
1405 (parse_action, parse_guard): these.
1406 As a voluntary consequence, using braces around guards is now
1407 mandatory.
1408
f499b062
AD
14092001-12-27 Akim Demaille <akim@epita.fr>
1410
1411 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1412 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1413 members.
1414 (symbol_list_new): Adjust.
1415 (copy_action): action_line is the first line, not the last.
1416 (copy_guard): Just as for actions, store the `action' only, not
1417 the switch/case/break flesh.
1418 Don't parse the user action that might follow the guard, let...
1419 (readgram): do it, i.e., now, there can be an action after a
1420 guard.
1421 In other words the guard is just explicitly optional.
1422 (packgram): Adjust.
1423 * src/output.c (guards_output): New.
1424 (output_parser): Call it when needed.
1425 (output): Also free the guard and attrs obstacks.
1426 * src/files.c, src/files.h (obstack_save): Remove.
1427 (output_files): Remove.
1428 As a result, if one needs the former `.act' file, using an
1429 appropriate skeleton which requires actions and guards is now
1430 required.
1431 * src/main.c (main): Adjust.
1432 * tests/semantic.at: New.
1433 * tests/regression.at: Use `input.y' as input file name.
1434 Avoid 8+3 problems by requiring input.c when the test needs the
1435 parser.
1436
d945f5cd
AD
14372001-12-27 Akim Demaille <akim@epita.fr>
1438
1439 * src/reader.c (symbol_list_new): Be sure to initialize all the
1440 fields.
1441
d200e455
AD
14422001-12-27 Akim Demaille <akim@epita.fr>
1443
1444 All the hacks using a final pseudo state are now useless.
1445
1446 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1447 * src/lalr.c (nLA): New.
1448 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1449 instead of lookaheadsp from the pseudo state (nstate + 1).
1450
f9507c28
AD
14512001-12-27 Akim Demaille <akim@epita.fr>
1452
1453 * src/output.c (action_row, token_actions): Use a state_t instead
1454 of a integer, and nlookaheads instead of the following state's
1455 lookaheadsp.
1456
065fbd27
AD
14572001-12-27 Akim Demaille <akim@epita.fr>
1458
1459 * src/conflicts.c (log_resolution, flush_shift)
1460 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1461 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1462 (conflicts_print, print_reductions): Use a state_t instead of an
1463 integer when referring to a state.
1464 As much as possible, depend upon nlookaheads, instead of the
1465 `lookaheadsp' member of the following state (since lookaheads of
1466 successive states are successive, the difference between state n + 1
1467 and n served as the number of lookaheads for state n).
1468 * src/lalr.c (add_lookback_edge): Likewise.
1469 * src/print.c (print_core, print_actions, print_state)
1470 (print_results): Likewise.
1471 * src/print_graph.c (print_core, print_actions, print_state)
1472 (print_graph): Likewise.
1473 * src/conflicts.h: Adjust.
1474
1b177bd7
AD
14752001-12-27 Akim Demaille <akim@epita.fr>
1476
1477 * src/bison.hairy: Formatting/comment changes.
1478 ANSIfy.
1479 Remove `register' indications.
1480 Add plenty of `static'.
1481
7742ddeb
AD
14822001-12-27 Akim Demaille <akim@epita.fr>
1483
1484 * src/output.c (prepare): Drop the muscle `ntbase' which
1485 duplicates ntokens.
1486 * src/bison.simple: Formatting/comment changes.
1487 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1488 is an undocumented synonym.
1489
1fa14068
AD
14902001-12-22 Akim Demaille <akim@epita.fr>
1491
1492 * src/output.c (output_table_data): Change the prototype to use
1493 `int' for array ranges: some invocations do pass an int, not a
1494 short.
1495 Reported by Wayne Green.
1496
b9752825
AD
14972001-12-22 Akim Demaille <akim@epita.fr>
1498
1499 Some actions of web2c.y are improperly triggered.
1500 Reported by Mike Castle.
1501
1502 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1503 * tests/regression.at (Web2c): Rename as...
1504 (Web2c Report): this.
1505 (Web2c Actions): New.
1506
776209d6
AD
15072001-12-22 Akim Demaille <akim@epita.fr>
1508
1509 Reductions in web2c.y are improperly reported.
1510 Reported by Mike Castle.
1511
1512 * src/conflicts.c (print_reductions): Fix.
1513 * tests/regression.at (Web2c): New.
1514
275fc3ad
AD
15152001-12-18 Akim Demaille <akim@epita.fr>
1516
1517 Some host fail on `assert (!"foo")', which expands to
1518 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1519 Reported by Nelson Beebee.
1520
1521 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1522 `#define it_succeeded 0' and `assert (it_succeeded)'.
1523
897668ee
MA
15242001-12-17 Marc Autret <autret_m@epita.fr>
1525
1526 * src/bison.simple: Don't hard code the skeleton line and filename.
1527 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1528 New line counter 'skeleton_line' (skeleton-line muscle).
1529
ab3399e0
PE
15302001-12-17 Paul Eggert <eggert@twinsun.com>
1531
1532 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1533 YYDEBUG must be defined to a nonzero value.
1534
1535 * src/bison.simple (yytname): Do not assume that the user defines
1536 YYDEBUG to a properly parenthesized expression.
1537
3877f72b
AD
15382001-12-17 Akim Demaille <akim@epita.fr>
1539
1540 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1541 nlookaheads is a new member.
1542 Adjust all users.
1543 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1544 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1545 state.
776209d6 1546
331dbc1b
AD
15472001-12-17 Akim Demaille <akim@epita.fr>
1548
1549 * src/files.h, src/files.c (open_files, close_files): Remove.
1550 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1551 let...
1552 * src/reader.c (reader): Do it.
776209d6 1553
be750e4c
AD
15542001-12-17 Akim Demaille <akim@epita.fr>
1555
1556 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1557
709ae8c6
AD
15582001-12-17 Akim Demaille <akim@epita.fr>
1559
1560 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1561 (flush_reduce): New.
1562 (resolve_sr_conflict): Adjust.
776209d6 1563
f87685c3
AD
15642001-12-17 Akim Demaille <akim@epita.fr>
1565
1566 * src/output.c (output_obstack): Be static and rename as...
1567 (format_obstack): this, to avoid any confusion with files.c's
1568 output_obstack.
1569 * src/reader.h (muscle_obstack): Move to...
1570 * src/output.h: here, since it's defined in output.c.
1571
837491d8
AD
15722001-12-17 Akim Demaille <akim@epita.fr>
1573
1574 * src/output.c (action_row, save_column, default_goto)
1575 (sort_actions, matching_state, pack_vector): Better variable
1576 locality.
1577
796d61fb
AD
15782001-12-17 Akim Demaille <akim@epita.fr>
1579
1580 * src/output.c: Various formatting changes.
776209d6 1581
64d15509
AD
15822001-12-17 Akim Demaille <akim@epita.fr>
1583
1584 * src/files.c (output_files): Free the output_obstack.
1585 * src/main.c (main): Call print and print_graph conditionally.
1586 * src/print.c (print): Work unconditionally.
1587 * src/print_graph.c (print_graph): Work unconditionally.
1588 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1589
fbc8ecb7
MA
15902001-12-16 Marc Autret <autret_m@epita.fr>
1591
1592 * src/output.c (actions_output): Fix. When we use %no-lines,
1593 there is one less line per action.
1594
f0440388
MA
15952001-12-16 Marc Autret <autret_m@epita.fr>
1596
1597 * src/bison.simple: Remove a useless #line directive.
1598 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1599 * src/output.c (get_lines_number): New.
776209d6 1600 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1601 output muscles.
1602 Fix line numbering.
1603 (actions_output): Computes the number of lines taken by actions.
1604 (output_master_parser): Insert new skeleton which is the name of
1605 the output parser file name.
1606
a79986b8
MA
16072001-12-15 Marc Autret <autret_m@epita.fr>
1608
1609 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1610
4ec8e00f
MA
16112001-12-15 Marc Autret <autret_m@epita.fr>
1612
1613 * src/output.c (output_gram): Keep track of the hairy one.
1614
1a4648ff
AD
16152001-12-15 Akim Demaille <akim@epita.fr>
1616
1617 Make `make distcheck' work.
1618
1619 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1620 system.h which uses libgettext.h.
1621
9c2c67e6
AD
16222001-12-15 Akim Demaille <akim@epita.fr>
1623
1624 * src/nullable.c (set_nullable): Useless rules must be skipped,
1625 otherwise, since we range over their symbols, we might look at a
1626 nonterminal which no longer ``exists'', i.e., it is not counted in
1627 `nvars', hence we overflow our arrays.
1628
93ede233
AD
16292001-12-15 Akim Demaille <akim@epita.fr>
1630
1631 The header can also be produced directly, without any obstack!
1632 Yahoo!
1633
1634 * src/files.c, src/files.h (defines_obstack): Remove.
1635 (compute_header_macro): Global.
1636 (defines_obstack_save): Remove.
1637 * src/reader.c (parse_union_decl): No longer output to
1638 defines_obstack: its content can be found in the `stype' muscle
1639 anyway.
1640 (output_token_translations): Merge into...
1641 (symbols_output): this.
1642 Rename as...
1643 (symbols_save): this.
1644 (reader): Adjust.
1645 * src/output.c (header_output): New.
1646 (output): Call it.
1647
2666f928
AD
16482001-12-15 Akim Demaille <akim@epita.fr>
1649
1650 * src/reader.c (parse_union_decl): Instead of handling two obstack
1651 simultaneously, use one to define the `stype' muscle, and use the
1652 value of the latter to fill defines_obstack.
1653 (copy_comment): Remove.
1654 (copy_comment2): Work for a single obstack.
1655 Rename as...
1656 (copy_comment): this.
1657
428046f8
AD
16582001-12-15 Akim Demaille <akim@epita.fr>
1659
1660 * src/lex.c, src/lex.h (xgetc): No longer static.
1661 * src/reader.c (parse_union_decl): Revamp.
1662
ea52d706
AD
16632001-12-15 Akim Demaille <akim@epita.fr>
1664
1665 Still making progress in separating Bison into (i) input, (ii)
1666 process, (iii) output: now we can directly output the parser file
1667 without using table_obstack at all.
1668
1669 * src/files.c, src/files.h (table_obstack): Bye bye.
1670 (parser_file_name): New.
1671 * src/files.c (compute_output_file_names): Compute it.
1672 * src/output.c (actions_output, output_parser)
1673 (output_master_parser): To a file instead of an obstack.
1674
3f96f4dc
AD
16752001-12-15 Akim Demaille <akim@epita.fr>
1676
1677 Attach actions to rules, instead of pre-outputting them to
1678 actions_obstack.
1679
1680 * src/gram.h (rule_t): action and action_line are new members.
1681 * src/reader.c (symbol_list): Likewise.
1682 (copy_action): Save the actions within the rule.
1683 (packgram): Save them in rule_table.
1684 * src/output.c (actions_output): New.
1685 (output_parser): Use it on `%%actions'.
1686 (output_rule_data): Don't free rule_table.
1687 (output): Do it.
1688 (prepare): Don't save the `action' muscle.
1689 * src/bison.simple: s/%%action/%%actions/.
1690
51576fb3
AD
16912001-12-15 Akim Demaille <akim@epita.fr>
1692
1693 * src/reader.c (copy_action): When --yacc, don't append a `;'
1694 to the user action: let it fail if lacking.
dee049eb 1695 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1696
2648a72d
AD
16972001-12-14 Akim Demaille <akim@epita.fr>
1698
1699 * src/lex.c (literalchar): Simply return the char you decoded, non
1700 longer mess around with obstacks and int pointers.
1701 Adjust all callers.
1702
92790e5b
AD
17032001-12-14 Akim Demaille <akim@epita.fr>
1704
1705 * src/lex.c (literalchar): Don't escape the special characters,
1706 just decode them, and keep them as char (before, eol was output as
1707 the 2 char string `\n' etc.).
1708 * src/output.c (output_rule_data): Use quotearg to output the
1709 token strings.
1710
927c1557
PE
17112001-12-13 Paul Eggert <eggert@twinsun.com>
1712
1713 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1714 Do not infringe on the global user namespace when using C++.
1715 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1716 All uses of `fprintf' and `stderr' changed.
1717
1718 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1719
ed8e1f68
AD
17202001-12-13 Akim Demaille <akim@epita.fr>
1721
1722 The computation of nullable is broken: it doesn't handle empty
1723 RHS's properly.
1724
1725 * tests/torture.at (GNU AWK Grammar): New.
1726 * tests/sets.at (Nullable): New.
1727 * src/nullable.c (set_nullable): Instead of blindly looping over
1728 `ritems', loop over the rules, and then over their rhs's.
1729
1730 Work around Autotest bugs.
1731
1732 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1733 frame, because Autotest understand lines starting with a `+' as
1734 traces from the shell. Then, they are not processed properly.
1735 Admittedly an Autotest bug, but we don't have time to wait for
1736 Autotest to catch up.
1737 * tests/regression.at (Broken Closure): Adjust to the new table
1738 frames.
1739 Move to...
1740 * tests/sets.at: here.
1741
cb581495
AD
17422001-12-13 Akim Demaille <akim@epita.fr>
1743
1744 * src/closure.c (closure): Use nrules instead of playing tricks
1745 with BITS_PER_WORD.
1746
2e729273
AD
17472001-12-13 Akim Demaille <akim@epita.fr>
1748
1749 * src/print.c (print_actions): Output the handling of `$' as the
1750 traces do: shifting the token EOF. Before EOF was treated as a
1751 nonterminal.
1752 * tests/regression.at: Adjust some tests.
1753 * src/print_graph.c (print_core): Complete the set of items via
1754 closure. The next-to-final and final states are still unsatisfying,
1755 but that's to be addressed elsewhere.
1756 No longer output the rule numbers, but do output the state number.
1757 A single loop for the shifts + gotos is enough, but picked a
1758 distinct color for each.
1759 (print_graph): Initialize and finalize closure.
1760
107f7dfb
AD
17612001-12-13 Akim Demaille <akim@epita.fr>
1762
1763 * src/reader.c (readgram): Remove dead code, an strip useless
1764 braces.
1765 (get_type): Remove, unused.
1766
9b53a24f
AD
17672001-12-12 Akim Demaille <akim@epita.fr>
1768
1769 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1770 on that of lib/error.c.
1771
dbfb6dcd
AD
17722001-12-12 Akim Demaille <akim@epita.fr>
1773
1774 Some hosts don't like `/' in includes.
1775
1776 * src/system.h: Include libgettext.h without qualifying the path.
1777 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1778 $(top_srcdir).
1779
c25fb648
MA
17802001-12-11 Marc Autret <autret_m@epita.fr>
1781
1782 * src/output.c (output_parser): Remove useless muscle.
1783
710ddc4f
MA
17842001-12-11 Marc Autret <autret_m@epita.fr>
1785
1786 * src/bison.simple: Remove #line just before %%epilogue. It
1787 is now handled in ...
1788 * src/reader.c (read_additionnal_code): Add the output of a
1789 #line for the epilogue.
1790
e83d80b8
MA
17912001-12-10 Marc Autret <autret_m@epita.fr>
1792
927c1557 1793 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1794 replace precedent remove.
1795 * src/bison.simple: Remove #line before %%prologue because
1796 %%input-line is wrong at this time.
1797
971d5158
MA
17982001-12-10 Marc Autret <autret_m@epita.fr>
1799
1800 * src/reader.c (symbols_output): Clean up.
927c1557 1801 * src/output.c (output_gram, output): Clean up.
971d5158 1802
5edafffd
AD
18032001-12-10 Akim Demaille <akim@epita.fr>
1804
1805 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1806 * src/LR0.c (set_state_table): here.
1807 * src/lalr.c (lalr): Call it.
1808
0279f8e9
AD
18092001-12-10 Akim Demaille <akim@epita.fr>
1810
1811 * src/state.h (shifts): Remove the `number' member: shifts are
1812 attached to state, hence no longer need to be labelled with a
1813 state number.
1814
190c4f5f
AD
18152001-12-10 Akim Demaille <akim@epita.fr>
1816
1817 Now that states have a complete set of members, the linked list of
1818 shifts is useless: just fill directly the state's shifts member.
1819
1820 * src/state.h (shifts): Remove the `next' member.
1821 * src/LR0.c (first_state, last_state): Remove.
1822 Adjust the callers.
1823 (augment_automaton): Don't look for the shifts that must be added
1824 a shift on EOF: it is those of the state we looked for! But now,
1825 since shifts are attached, it is no longer needed to looking
1826 merely by its id: its number.
1827
2a73b93d
AD
18282001-12-10 Akim Demaille <akim@epita.fr>
1829
1830 * src/LR0.c (augment_automaton): Better variable locality.
1831 Remove an impossible branch: if there is a state corresponding to
1832 the start symbol being shifted, then there is shift for the start
1833 symbol from the initial state.
1834
74392f6a
AD
18352001-12-10 Akim Demaille <akim@epita.fr>
1836
1837 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1838 only when appropriate: when insert_start_shifting_state' is not
1839 invoked.
1840 * tests/regression.at (Rule Line Numbers): Adjust.
1841
37c82725
AD
18422001-12-10 Akim Demaille <akim@epita.fr>
1843
1844 * src/LR0.c (augment_automaton): Now that all states have shifts,
1845 merge the two cases addition shifts to the initial state.
1846
6a164e0c
AD
18472001-12-10 Akim Demaille <akim@epita.fr>
1848
1849 * src/lalr.c (set_state_table): Move to...
1850 * src/LR0.c: here.
1851 * src/lalr.c (lalr): Don't call it...
1852 * src/LR0.c (generate_states): do it.
1853 * src/LR0.h (first_state): Remove, only the table is used.
1854
7215de24
AD
18552001-12-10 Akim Demaille <akim@epita.fr>
1856
1857 * src/LR0.h (first_shift, first_reduction): Remove.
1858 * src/lalr.c: Don't use first_shift: find shifts through the
1859 states.
1860
80e25d4d
AD
18612001-12-10 Akim Demaille <akim@epita.fr>
1862
1863 * src/LR0.c: Attach shifts to states as soon as they are
1864 computed.
1865 * src/lalr.c (set_state_table): Instead of assigning shifts to
1866 state, just assert that the mapping was properly done.
1867
0ab3728b
AD
18682001-12-10 Akim Demaille <akim@epita.fr>
1869
1870 * src/LR0.c (insert_start_shift): Rename as...
1871 (insert_start_shifting_state): this.
1872 (insert_eof_shifting_state, insert_accepting_state): New.
1873 (augment_automaton): Adjust.
1874 Better locality of the variables.
1875 When looking if the start_symbol is shifted from the initial
1876 state, using `while (... symbol != start_symbol ...)' sounds
1877 better than `while (... symbol < start_symbol ...)': If fail
1878 to see how the order between symbols could be relevant!
1879
78af9bbc
AD
18802001-12-10 Akim Demaille <akim@epita.fr>
1881
1882 * src/getargs.h: Don't declare `spec_name_prefix' and
1883 `spec_file_prefix', declared by src/files.h.
1884 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1885 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1886 * src/output.c (prepare): Adjust.
1887 * src/reader.c (symbols_output): Likewise.
1888 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1889
bdef2a41
AD
18902001-12-10 Akim Demaille <akim@epita.fr>
1891
1892 * src/muscle_tab.c (muscle_init): NULL is a better default than
1893 `"0"'.
1894
3735969c
AD
18952001-12-10 Akim Demaille <akim@epita.fr>
1896
1897 * src/reader.c (reader): Calling symbols_output once is enough.
1898
49701457
AD
18992001-12-10 Akim Demaille <akim@epita.fr>
1900
1901 Now that states have a complete set of members, the linked list of
1902 reductions is useless: just fill directly the state's reductions
1903 member.
1904
1905 * src/state.h (struct reductions): Remove member `number' and
1906 `next'.
1907 * src/LR0.c (first_reduction, last_reduction): Remove.
1908 (save_reductions): Don't link the new reductions, store them in
1909 this_state.
1910 * src/lalr.c (set_state_table): No need to attach reductions to
1911 states, it's already done.
1912 * src/output.c (output_actions): No longer free the shifts, then
1913 the reductions, then the states: free all the states and their
1914 members.
1915
0edad749
AD
19162001-12-10 Akim Demaille <akim@epita.fr>
1917
1918 * src/options.c (OPTN, DRTV, BOTH): New.
1919 (option_table): Use them.
1920
0edad749
AD
1921 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
1922 the job of system.h.
1923 * src/options.c: Don't include stdio.h and xalloc.h for the same
1924 reasons.
1925
5449dd0f
AD
19262001-12-10 Akim Demaille <akim@epita.fr>
1927
1928 * src/output.c (output, prepare): Make sure the values of the
1929 muscles `action' and `prologue' are 0-terminated.
1930
a870c567
AD
19312001-12-10 Akim Demaille <akim@epita.fr>
1932
1933 Clean up GCC warnings.
1934
1935 * src/reader.c (copy_action): `buf' is not used.
1936 (parse_skel_decl): Be static.
1937 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
1938 * src/options.h (create_long_option_table): Have a real prototype.
1939 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
1940 (hash_delete_at): Return const void *.
1941 Adjust casts to preserve the const.
1942
80df8768
AD
19432001-12-10 Akim Demaille <akim@epita.fr>
1944
1945 * configure.in: Require 2.52g.
1946 M4 is not needed, but AUTOM4TE is.
1947 * m4/m4.m4: Remove.
1948 * tests/Makefile.am: Adjust.
1949
f693ad14
AD
19502001-12-10 Akim Demaille <akim@epita.fr>
1951
1952 One structure for states is enough, even though theoretically
1953 there are LR(0) states and LALR(1) states.
1954
1955 * src/lalr.h (state_t): Remove.
1956 (state_table): Be state_t **, not state_t *.
1957 * src/state.h (core, CORE_ALLOC): Rename as...
1958 (state_t, STATE_ALLOC): this.
1959 Add the LALR(1) members: shifts, reductions, errs.
1960 * src/LR0.c (state_table): Rename as...
1961 (state_hash): this, to avoid name clashes with the global
1962 `state_table'.
1963 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
1964 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
1965
74ffbcb6
AD
19662001-12-10 Akim Demaille <akim@epita.fr>
1967
1968 Bison dumps core on bash.y.
1969 Reported by Pascal Bart.
1970
1971 * src/warshall.c (bitmatrix_print): New.
1972 (TC): Use it.
1973 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
1974 j must be the outer loop.
1975 * tests/regression.at (Broken Closure): New.
1976
07708e19
AD
19772001-12-05 Akim Demaille <akim@epita.fr>
1978
1979 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
1980 its argument.
1981