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