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