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