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