]> git.saurik.com Git - bison.git/blame - ChangeLog
(YYCOPY): Fix [] quoting problem in the non-GCC case.
[bison.git] / ChangeLog
CommitLineData
8c6d399a
PE
12002-04-26 Paul Eggert <eggert@twinsun.com>
2
3 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
4 Define if we define YYSTYPE and YYLTYPE, respectively.
5
2b7ed18a
RA
62002-04-25 Robert Anisko <robert@lrde.epita.fr>
7
8 * src/scan-skel.l: Postprocess quadrigraphs.
9
10 * src/reader.c (copy_character): New function, used to output
11 single characters while replacing `[' and `]' with quadrigraphs, to
12 avoid troubles with M4 quotes.
13 (copy_comment): Output characters with copy_character.
14 (read_additionnal_code): Likewise.
15 (copy_string2): Likewise.
16 (copy_definition): Likewise.
17
18 * tests/calc.at: Exercise M4 quoting.
19
34a89c50
AD
202002-04-25 Akim Demaille <akim@epita.fr>
21
22 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
23 between `!' and the command.
24 Reported by Paul Eggert.
25
0dd1580a
RA
262002-04-24 Robert Anisko <robert@lrde.epita.fr>
27
28 * tests/calc.at: Exercise prologue splitting.
29
30 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
31 `b4_post_prologue' instead of `b4_prologue'.
32
33 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
34 muscles.
35 (output): Free pre_prologue_obstack and post_prologue_obstack.
36 * src/files.h, src/files.c (attrs_obstack): Remove.
37 (pre_prologue_obstack, post_prologue_obstack): New.
38 * src/reader.c (copy_definition): Add a parameter to specify the
39 obstack to fill, instead of using attrs_obstack unconditionally.
40 (read_declarations): Pass pre_prologue_obstack to copy_definition if
41 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
42
83c1796f
PE
432002-04-23 Paul Eggert <eggert@twinsun.com>
44
45 * data/bison.simple: Remove unnecessary commentary and white
46 space differences from 1_29-branch.
47 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
48
49 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
50 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
51 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
52 constructors or destructors.
53
54 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
55
1207eeac
AD
562002-04-23 Akim Demaille <akim@epita.fr>
57
58 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
59 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
60 location with columns.
61 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
62 All reported by Paul Eggert.
63
78ab8f67
AD
642002-04-22 Akim Demaille <akim@epita.fr>
65
66 * src/reduce.c (dump_grammar): Move to...
67 * src/gram.h, src/gram.c (grammar_dump): here.
68 Be sure to separate long item numbers.
69 Don't read the members of a rule's prec if its nil.
70
133c20e2
AD
712002-04-22 Akim Demaille <akim@epita.fr>
72
73 * src/output.c (table_size, table_grow): New.
74 (MAXTABLE): Remove, replace uses with table_size.
75 (pack_vector): Instead of dying when the table is too big, grow it.
76
9515e8a7
AD
772002-04-22 Akim Demaille <akim@epita.fr>
78
79 * data/bison.simple (yyr1): Its type is that of a token number.
80 * data/bison.c++ (r1_): Likewise.
81 * tests/regression.at (Web2c Actions): Adjust.
82
23c5a174
AD
832002-04-22 Akim Demaille <akim@epita.fr>
84
85 * src/reader.c (token_translations_init): 256 is now the default
86 value for the error token, i.e., it will be assigned another
87 number if the user assigned 256 to one of her tokens.
88 (reader): Don't force 256 to error.
89 * doc/bison.texinfo (Symbols): Adjust.
90 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
91 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
92 etc. instead of 10, 20, 30 (which was used to `jump' over error
93 (256) and undefined (2)).
94
5fbb0954
AD
952002-04-22 Akim Demaille <akim@epita.fr>
96
97 Propagate more token_number_t.
98
99 * src/gram.h (token_number_as_item_number)
100 (item_number_as_token_number): New.
101 * src/output.c (GENERATE_OUTPUT_TABLE): New.
102 Use it to create output_item_number_table and
103 output_token_number_table.
104 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
105 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
106 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
107 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
108
4f940944
AD
1092002-04-22 Akim Demaille <akim@epita.fr>
110
111 * src/output.h, src/output.c (get_lines_number): Remove.
112
3ded9a63
AD
1132002-04-19 Akim Demaille <akim@epita.fr>
114
115 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
116 as Lex/Flex'.
117 (Debugging): More details about enabling the debugging features.
118 (Table of Symbols): Describe $$, $n, @$, and @n.
119 Suggested by Tim Josling.
120
e0c471a9
AD
1212002-04-19 Akim Demaille <akim@epita.fr>
122
123 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
124
fecc10cd
AD
1252002-04-10 Akim Demaille <akim@epita.fr>
126
127 * src/system.h: Rely on HAVE_LIMITS_H.
128 Suggested by Paul Eggert.
129
51dec47b
AD
1302002-04-09 Akim Demaille <akim@epita.fr>
131
132 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
133 full stderr, and strip it according to the bison options, instead
134 of composing the error message from different bits.
135 This makes it easier to check for several error messages.
136 Adjust all the invocations.
137 Add an invocation exercising the error token.
138 Add an invocation demonstrating a stupid error message.
139 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
140 Adjust the tests.
141 Error message are for stderr, not stdout.
142
007a50a4
AD
1432002-04-09 Akim Demaille <akim@epita.fr>
144
145 * src/gram.h, src/gram.c (error_token_number): Remove, use
146 errtoken->number.
147 * src/reader.c (reader): Don't specify the user token number (2)
148 for $undefined, as it uselessly prevents using it.
149 * src/gram.h (token_number_t): Move to...
150 * src/symtab.h: here.
151 (state_t.number): Is a token_number_t.
152 * src/print.c, src/reader.c: Use undeftoken->number instead of
153 hard coded 2.
154 (Even though this 2 is not the same as above: the number of the
155 undeftoken remains being 2, it is its user token number which
156 might not be 2).
157 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
158 `user_token_number_max'.
159 Output `undef_token_number'.
160 * data/bison.simple, data/bison.c++: Use them.
161 Be sure to map invalid yylex return values to
162 `undef_token_number'. This saves us from gratuitous SEGV.
163
164 * tests/conflicts.at (Solved SR Conflicts)
165 (Unresolved SR Conflicts): Adjust.
166 * tests/regression.at (Web2c Actions): Adjust.
167
06446ccf
AD
1682002-04-08 Akim Demaille <akim@epita.fr>
169
170 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
171 Adding #line.
172 Remove the duplicate `typedefs'.
173 (RhsNumberType): Fix the declaration and various other typos.
174 Use __ofile__.
175 * data/bison.simple: Use __ofile__.
176 * src/scan-skel.l: Handle __ofile__.
177
62a3e4f0
AD
1782002-04-08 Akim Demaille <akim@epita.fr>
179
180 * src/gram.h (item_number_t): New, the type of item numbers in
181 RITEM. Note that it must be able to code symbol numbers as
182 positive number, and the negation of rule numbers as negative
183 numbers.
184 Adjust all dependencies (pretty many).
185 * src/reduce.c (rule): Remove this `short *' pointer: use
186 item_number_t.
187 * src/system.h (MINSHORT, MAXSHORT): Remove.
188 Include `limits.h'.
189 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
190 (shortcpy): Remove.
191 (MAXTABLE): Move to...
192 * src/output.c (MAXTABLE): here.
193 (prepare_rules): Use output_int_table to output rhs.
194 * data/bison.simple, data/bison.c++: Adjust.
195 * tests/torture.at (Big triangle): Move the limit from 254 to
196 500.
197 * tests/regression.at (Web2c Actions): Ajust.
198
199 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
200 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
201 passes, but produces negative #line number, once fixed, GCC is
202 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
203 C), it passes.
204 * src/state.h (state_h): Code input lines on ints, not shorts.
205
bb88b0fc
AD
2062002-04-08 Akim Demaille <akim@epita.fr>
207
208 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
209 and then the grammar.
210
9a636f47
AD
2112002-04-08 Akim Demaille <akim@epita.fr>
212
213 * src/system.h: No longer using strndup.
214
680e8701
AD
2152002-04-07 Akim Demaille <akim@epita.fr>
216
217 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
218 * src/output.c (output_table_data): Return the longest number.
219 (prepare_tokens): Output `token_number_max').
220 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
221 New.
222 Use them to define yy_token_number_type/TokenNumberType.
223 Use this type for yytranslate.
224 * tests/torture.at (Big triangle): Push the limit from 124 to
225 253.
226 * tests/regression.at (Web2c Actions): Adjust.
227
817e9f41
AD
2282002-04-07 Akim Demaille <akim@epita.fr>
229
230 * tests/torture.at (Big triangle): New.
231 (GNU AWK Grammar, GNU Cim Grammar): Move to...
232 * tests/existing.at: here.
233
5123689b
AD
2342002-04-07 Akim Demaille <akim@epita.fr>
235
236 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
237 nritems.
238 Adjust dependencies.
239
f3849179
AD
2402002-04-07 Akim Demaille <akim@epita.fr>
241
242 * src/reader.c: Normalize increments to prefix form.
243
bd02036a
AD
2442002-04-07 Akim Demaille <akim@epita.fr>
245
246 * src/reader.c, symtab.c: Remove debugging code.
247
db8837cb
AD
2482002-04-07 Akim Demaille <akim@epita.fr>
249
250 Rename all the `bucket's as `symbol_t'.
251
252 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
253 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
254 * src/symtab.c, src/symtab.h (bucket): Rename as...
255 (symbol_t): this.
256 (symbol_list_new, bucket_check_defined, bucket_make_alias)
257 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
258 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
259 (buckets_new, buckets_free, buckets_do): Rename as...
260 (symbol_list_new, symbol_check_defined, symbol_make_alias)
261 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
262 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
263 (symbols_new, symbols_free, symbols_do): these.
264
72a23c97
AD
2652002-04-07 Akim Demaille <akim@epita.fr>
266
267 Use lib/hash for the symbol table.
268
269 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
270 EOF.
271 * src/lex.c (lex): Set the `number' member of new terminals.
272 * src/reader.c (bucket_check_defined, bucket_make_alias)
273 (bucket_check_alias_consistence, bucket_translation): New.
274 (reader, grammar_free, readgram, token_translations_init)
275 (packsymbols): Adjust.
276 (reader): Number the predefined tokens.
277 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
278 for predefined tokens.
279 * src/symtab.h (bucket): Remove all the hash table related
280 members.
281 * src/symtab.c (symtab): Replace by...
282 (bucket_table): this.
283 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
284 (buckets_new, buckets_do): New.
285
280a38c3
AD
2862002-04-07 Akim Demaille <akim@epita.fr>
287
288 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
289 (start_symbol, max_user_token_number, semantic_parser)
290 (error_token_number): Initialize.
291 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
292 Initialize.
293 (reader): Don't.
294 (errtoken, eoftoken, undeftoken, axiom): Extern.
295
03b31c0c
AD
2962002-04-07 Akim Demaille <akim@epita.fr>
297
298 * src/gram.h (rule_s): prec and precsym are now pointers
299 to the bucket giving the priority/associativity.
300 Member `associativity' removed: useless.
301 * src/reduce.c, src/conflicts.c: Adjust.
302
8b3df748
AD
3032002-04-07 Akim Demaille <akim@epita.fr>
304
305 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
306 Properly escape the symbols' TAG when outputting them.
307
e601aa1d
AD
3082002-04-07 Akim Demaille <akim@epita.fr>
309
310 * src/lalr.h (LA): Is a bitsetv, not bitset*.
311
b0299a2e
AD
3122002-04-07 Akim Demaille <akim@epita.fr>
313
314 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
315 (LArule): this, which is an array to rule_t*.
316 * src/print.c, src/conflicts.c: Adjust.
317
d7e1f00c
AD
3182002-04-07 Akim Demaille <akim@epita.fr>
319
320 * src/gram.h (rule_t): Rename `number' as `user_number'.
321 `number' is a new member.
322 Adjust dependencies.
323 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
324
cc9305dd
AD
3252002-04-07 Akim Demaille <akim@epita.fr>
326
327 As a result of the previous patch, it is no longer needed
328 to reorder ritem itself.
329
330 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
331
b0940840
AD
3322002-04-07 Akim Demaille <akim@epita.fr>
333
334 Be sure never to walk through RITEMS, but use only data related to
335 the rules themselves. RITEMS should be banished.
336
337 * src/output.c (output_token_translations): Rename as...
338 (prepare_tokens): this.
339 In addition to `translate', prepare the muscles `tname' and
340 `toknum', which were handled by...
341 (output_rule_data): this.
342 Remove, and move the remainder of its outputs into...
343 (prepare_rules): this new routines, which also merges content from
344 (output_gram): this.
345 (prepare_rules): Be sure never to walk through RITEMS.
346 (output_stos): Rename as...
347 (prepare_stos): this.
348 (output): Always invoke prepare_states, after all, just don't use it
349 in the output if you don't need it.
350
643a5994
AD
3512002-04-07 Akim Demaille <akim@epita.fr>
352
353 * src/LR0.c (new_state): Display `nstates' as the name of the
354 newly created state.
355 Adjust to initialize first_state and last_state if needed.
356 Be sure to distinguish the initial from the final state.
357 (new_states): Create the itemset of the initial state, and use
358 new_state.
359 * src/closure.c (closure): Now that the initial state has its
360 items properly set, there is no need for a special case when
361 creating `ruleset'.
362
363 As a result, now the rule 0, reducing to $axiom, is visible in the
364 outputs. Adjust the test suite.
365
366 * tests/conflicts.at (Solved SR Conflicts)
367 (Unresolved SR Conflicts): Adjust.
368 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
369 * tests/conflicts.at (S/R in initial): New.
370
b4c4ccc2
AD
3712002-04-07 Akim Demaille <akim@epita.fr>
372
373 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
374 the RHS of the rules.
375 * src/output.c (output_gram): Likewise.
376
bba97eb2
AD
3772002-04-07 Akim Demaille <akim@epita.fr>
378
379 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
380 bucket.
381 Adjust all dependencies.
382 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
383 `number' of the buckets too.
384 * src/gram.h: Include `symtab.h'.
385 (associativity): Move to...
386 * src/symtab.h: here.
387 No longer include `gram.h'.
388
c3b407f4
AD
3892002-04-07 Akim Demaille <akim@epita.fr>
390
391 * src/gram.h, src/gram.c (rules_rhs_length): New.
392 (ritem_longest_rhs): Use it.
393 * src/gram.h (rule_t): `number' is a new member.
394 * src/reader.c (packgram): Set it.
395 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
396 the end of `rules', and count them out of `nrules'.
397 (reduce_output, dump_grammar): Adjust.
398 * src/print.c (print_grammar): It is no longer needed to check for
399 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
400 * tests/reduce.at (Reduced Automaton): New test.
401
11652ab3
AD
4022002-04-07 Akim Demaille <akim@epita.fr>
403
404 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
405 lacking `+ 1' to nrules, Bison reported as useless a token if it
406 was used solely to set the precedence of the last rule...
407
26b23c1a
AD
4082002-04-07 Akim Demaille <akim@epita.fr>
409
410 * data/bison.c++, data/bison.simple: Don't output the current file
411 name in #line, to avoid useless diffs between two identical
412 outputs under different names.
413
18bcecb0
AD
4142002-04-07 Akim Demaille <akim@epita.fr>
415
416 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
417 Normalize loops to using `< nrules + 1', not `<= nrules'.
418
fa770c86
AD
4192002-04-07 Akim Demaille <akim@epita.fr>
420
421 * TODO: Update.
422
d9b739c3
AD
4232002-04-07 Akim Demaille <akim@epita.fr>
424
425 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
426 bucket.value as bucket.number.
427
99013900
AD
4282002-04-07 Akim Demaille <akim@epita.fr>
429
430 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
431 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
432 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
433 RHS, instead of being an index in RITEMS.
434
e966383b
PE
4352002-04-04 Paul Eggert <eggert@twinsun.com>
436
437 * doc/bison.texinfo: Update copyright date.
438 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
439 (Symbols): Warn about running Bison in one character set,
440 but compiling and/or running in an incompatible one.
441 Warn about character code 256, too.
442
4432002-04-03 Paul Eggert <eggert@twinsun.com>
444
445 * src/bison.data (YYSTACK_ALLOC): Depend on whether
446 YYERROR_VERBOSE is nonzero, not whether it is defined.
447
448 Merge changes from bison-1_29-branch.
c307773e 449
8d6c48b9
PE
4502002-03-20 Paul Eggert <eggert@twinsun.com>
451
452 Merge fixes from Debian bison_1.34-1.diff.
453
454 * configure.in (AC_PREREQ): 2.53.
455
e53c6322
AD
4562002-03-20 Akim Demaille <akim@epita.fr>
457
458 * src/conflicts.c (log_resolution): Argument `resolution' is const.
459
9ffbeca7
PE
4602002-03-19 Paul Eggert <eggert@twinsun.com>
461
21db0b2a
PE
462 * src/bison.simple (YYCOPY): New macro.
463 (YYSTACK_RELOCATE): Use it.
464 Remove Type arg; no longer needed. All callers changed.
465 (yymemcpy): Remove; no longer needed.
466
9ffbeca7
PE
467 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
468 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
469
642cb8f8
AD
4702002-03-19 Akim Demaille <akim@epita.fr>
471
472 Test and fix the #line outputs.
473
474 * tests/atlocal.at (GCC): New.
475 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
476 (Prologue synch line, ,%union synch line, Postprologue synch line)
477 (Action synch line, Epilogue synch line): New tests.
478 * src/reader.c (parse_union_decl): Define the muscle stype_line.
479 * data/bison.simple, data/bison.c++: Use it.
480
3c31a486
AD
4812002-03-19 Akim Demaille <akim@epita.fr>
482
483 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
484 (Solved SR Conflicts, %expect not enough, %expect right)
485 (%expect too much): Move to...
486 * tests/conflicts.at: this new file.
487
0d8bed56
AD
4882002-03-19 Akim Demaille <akim@epita.fr>
489
490 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
491 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
492 that we can move to enums for instance.
493 * src/output.c (token_definitions_output): Output a list of
494 `token-name, token-number' instead of the #define.
495 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
496
9208d17f
AD
4972002-03-14 Akim Demaille <akim@epita.fr>
498
499 Use Gettext 0.11.1.
500
af27eacb
RA
5012002-03-09 Robert Anisko <robert@lrde.epita.fr>
502
503 * data/bison.c++: Make the user able to add members to the generated
504 parser by subclassing.
505
9101a310
RA
5062002-03-05 Robert Anisko <robert@lrde.epita.fr>
507
508 * src/reader.c (read_additionnal_code): `c' should be an integer, not
509 a character.
510 Reported by Nicolas Tisserand and Nicolas Burrus.
511
fff9bf0b
RA
5122002-03-04 Robert Anisko <robert@lrde.epita.fr>
513
514 * src/reader.c: Warn about lacking semi-colons, do not complain.
515
64dba31e
RA
5162002-03-04 Robert Anisko <robert@lrde.epita.fr>
517
518 * data/bison.c++: Remove a debug line.
519
374f5a14
RA
5202002-03-04 Robert Anisko <robert@lrde.epita.fr>
521
522 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
523 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
524 provide a default implementation.
525
bfcf1f3a
AD
5262002-03-04 Akim Demaille <akim@epita.fr>
527
528 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
529 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
530 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
531 * tests/semantic.at (Parsing Guards): Similarly.
532 * src/reader.at (readgram): Complain if the last rule is not ended
533 with a semi-colon.
534
65ccf9fc
AD
5352002-03-04 Akim Demaille <akim@epita.fr>
536
537 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
538 * src/closure.c: here.
539 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
540 RTC.
541 * src/warshall.h, src/warshall.c: Remove.
542 * tests/sets.at (Broken Closure): Adjust.
543
d0039cbc
AD
5442002-03-04 Akim Demaille <akim@epita.fr>
545
546 * src/output.c (output_skeleton): tempdir is const.
547 bytes_read is unused.
548
345cea78
AD
5492002-03-04 Akim Demaille <akim@epita.fr>
550
551 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
552 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
553 Update.
554 From Michael Hayes.
555
564801f7
AD
5562002-03-04 Akim Demaille <akim@epita.fr>
557
558 * src/closure.c (closure): `r' is unused.
559
e5352bc7
AD
5602002-03-04 Akim Demaille <akim@epita.fr>
561
562 * tests/sets.at (Broken Closure): Add the ending `;'.
563 * src/reader.at (readgram): Complain if a rule is not ended with a
564 semi-colon.
565
914feea9
AD
5662002-03-04 Akim Demaille <akim@epita.fr>
567
568 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
569 (count_sr_conflicts): Use bitset_count.
570 * src/reduce.c (inaccessable_symbols): Ditto.
571 (bits_size): Remove.
572 * src/warshall.h, src/warshall.c: Convert to bitsetv.
573
f0250de6
AD
5742002-03-04 Akim Demaille <akim@epita.fr>
575
576 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
577 * src/reduce.c: Remove the `bitset_zero's following the
578 `bitset_create's, as now it is performed by the latter.
579
ef017502
AD
5802002-03-04 Akim Demaille <akim@epita.fr>
581
582 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
583 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
584 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
585 latest sources from Michael.
586
76514394
AD
5872002-03-04 Akim Demaille <akim@epita.fr>
588
589 * src/output.c (output): Don't free the grammar.
590 * src/reader.c (grammar_free): New.
591 * src/main.c (main): Call it and don't free symtab here.
592
55024580
AD
5932002-03-04 Akim Demaille <akim@epita.fr>
594
595 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
596 before returning.
597 Reported by Benoit Perrot.
598
f9abaa2c
AD
5992002-03-04 Akim Demaille <akim@epita.fr>
600
601 Use bitset operations when possible, not loops over bits.
602
603 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
604 bitset_or.
605 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
606 * src/reduce.c (useless_nonterminals): Formatting changes.
607 * src/warshall.c (TC): Use bitset_or.
608
0e721e75
AD
6092002-03-04 Akim Demaille <akim@epita.fr>
610
611 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
612 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
613 Ditto.
614
0fb1ffb1
AD
6152002-03-04 Akim Demaille <akim@epita.fr>
616
617 * src/lalr.c (F): Now a bitset*.
618 Adjust all dependencies.
619
b86796bf
AD
6202002-03-04 Akim Demaille <akim@epita.fr>
621
622 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
623 Adjust all dependencies.
624
602bbf31
AD
6252002-03-04 Akim Demaille <akim@epita.fr>
626
627 * src/L0.c, src/LR0.h (nstates): Be size_t.
628 Adjust comparisons (signed vs unsigned).
629 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
630 bitset*.
631 Adjust all dependencies.
632
d8a0245c
AD
6332002-03-04 Akim Demaille <akim@epita.fr>
634
635 * src/closure.c (firsts): Now, also a bitset.
636 Adjust all dependencies.
637 (varsetsize): Remove, now unused.
638 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
639
34ba9743
AD
6402002-03-04 Akim Demaille <akim@epita.fr>
641
642 * src/print.c: Convert to use bitset.h, not hand coded iterations
643 over ints.
644
ed86e78c
AD
6452002-03-04 Akim Demaille <akim@epita.fr>
646
647 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
648
dfdb1797
AD
6492002-03-04 Akim Demaille <akim@epita.fr>
650
651 * src/closure.c (ruleset): Be a bitset.
652 (rulesetsize): Remove.
653
7086e707
AD
6542002-03-04 Akim Demaille <akim@epita.fr>
655
656 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
657 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
658 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
659 * src/closure.c (fderives): Be an array of bitsets.
660
98254360
RA
6612002-02-28 Robert Anisko <robert@lrde.epita.fr>
662
663 * data/bison.c++: Merge the two generated headers. Insert a copyright
664 notice in each output file.
665
a75c057f
AD
6662002-02-28 Akim Demaille <akim@epita.fr>
667
668 * data/bison.c++: Copy the prologue of bison.simple to fetch
669 useful M4 definitions, such as b4_header_guard.
670
06b00abc
AD
6712002-02-25 Akim Demaille <akim@epita.fr>
672
673 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
674 translator friendly scheme for the bgr
675 copyright notice.
06b00abc 676
70e7d534
AD
6772002-02-25 Akim Demaille <akim@epita.fr>
678
679 * src/output.c (header_output): Remove, now handled completely via
680 M4.
681
abe017f6
AD
6822002-02-25 Akim Demaille <akim@epita.fr>
683
684 * m4/m4.m4: New, from CVS Autoconf.
685 * configure.in: Invoke it.
686 * src/output.c (output_skeleton): Use its result instead of the
687 hard coded name.
688
381fb12e
AD
6892002-02-25 Akim Demaille <akim@epita.fr>
690
691 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
692 Fileutils 4.1.5.
693 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
694 * src/output.c (output_skeleton): Use mkstemp to create a real
695 temporary file.
696 Move the filling of `skeleton' and its muscle to...
697 (prepare): here.
698 (output): Move the definition of the prologue muscle to...
699 (prepare): here.
700 * src/system.h (DEFAULT_TMPDIR): New.
701
6f38107f
PE
7022002-02-14 Paul Eggert <eggert@twinsun.com>
703
704 Remove the support for C++ namespace cleanliness; it was
705 causing more problems than it was curing, since it didn't work
706 properly on some nonstandard C++ compilers. This can wait
707 for a proper C++ parser.
708
709 * NEWS: Document this.
710 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
711 of C++, as it's treated like C now.
712 * src/bison.simple (YYSTD): Remove.
713 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
714 Treat C++ just like Standard C instead of trying to support
715 namespace cleanliness.
716
80cce3da
AD
7172002-02-14 Akim Demaille <akim@epita.fr>
718
719 * tests/regression.at (else): Adjust to Andreas' change.
720
842e8679
AD
7212002-02-14 Akim Demaille <akim@epita.fr>
722
723 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
724
4bda3f10
AD
7252002-02-13 Andreas Schwab <schwab@suse.de>
726
727 * src/output.c (output_rule_data): Don't output NULL, it might
728 not be defined yet.
729
4162fa07 7302002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 731
4162fa07
RA
732 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
733 (Copyright notice): Update.
b418ecd8 734
bd16a5dc
AD
7352002-02-11 Akim Demaille <akim@epita.fr>
736
737 * tests/regression.at (%nonassoc and eof): Don't include
738 nonportable headers.
739
8d69a1a3
RA
7402002-02-08 Robert Anisko <robert@lrde.epita.fr>
741
742 * data/bison.c++: Correct error recovery. Make the user able to
743 initialize the starting location.
744
9b2d0677
AD
7452002-02-07 Akim Demaille <akim@epita.fr>
746
747 * tests/input.at: New.
748
69e2658b
RA
7492002-02-07 Robert Anisko <robert@lrde.epita.fr>
750
751 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 752 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
753 directives around tables only needed for debugging.
754
4aacc3a7
RA
7552002-02-07 Robert Anisko <robert@lrde.epita.fr>
756
757 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
758 C++ parsers.
759 (yy::b4_name::parse): Use print_.
760
762a801e
RA
7612002-02-07 Robert Anisko <robert@lrde.epita.fr>
762
763 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
764
4bb2bc3f
RA
7652002-02-07 Robert Anisko <robert@lrde.epita.fr>
766
767 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
768 C++ parsers.
769 (yy::b4_name::parse): Build verbose error messages, and use error_.
770
6b45a3ca
RA
7712002-02-06 Robert Anisko <robert@lrde.epita.fr>
772
773 * data/bison.c++: Fix m4 quoting in comments.
774
50997c6e
RA
7752002-02-06 Robert Anisko <robert@lrde.epita.fr>
776
777 * data/bison.c++: Adjust the parser code. Fix some muscles that were
778 not expanded by m4.
779
3f3eed27
AD
7802002-02-05 Akim Demaille <akim@epita.fr>
781
782 * data/bison.c++: Adjust to the M4 back end.
783 More is certainly needed.
784
be2a1a68
AD
7852002-02-05 Akim Demaille <akim@epita.fr>
786
787 Give a try to M4 as a back end.
788
789 * lib/readpipe.c: New, from wdiff.
790 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
791 BISON_HAIRY.
792 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
793 specific values. Now it is m4 that performs the lookup.
794 * src/parse-skel.y: Remove.
795 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
796 * src/output.c (actions_output, guards_output)
797 (token_definitions_output): No longer keeps track of the output
798 line number, hence remove the second argument.
799 (guards_output): Check against the guard member of a rule, not the
800 action member.
801 Adjust callers.
802 (output_skeleton): Don't look for the skeleton location, let m4 do
803 that.
804 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
805 file will be used.
806 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
807 (prepare): Given that for the time being changesyntax is not
808 usable in M4, rename the muscles using `-' to `_'.
809 Define `defines_flag', `output_parser_name' and `output_header_name'.
810 * src/output.h (actions_output, guards_output)
811 (token_definitions_output): Adjust prototypes.
812 * src/scan-skel.l: Instead of scanning the skeletons, it now
813 processes the output of m4: `__oline__' and `#output'.
814 * data/bison.simple: Adjust to be used by M4(sugar).
815 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
816 to date.
817 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
818 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
819 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
820 shamelessly stolen from CVS Autoconf.
821
beda758b
AD
8222002-02-05 Akim Demaille <akim@epita.fr>
823
824 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
825 * configure.in: Check for the declarations of free and malloc.
826 * src/muscle_tab.c: Adjust.
827
5ece6d43
AD
8282002-02-05 Akim Demaille <akim@epita.fr>
829
830 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
831 which have no values.
832
5bb18f9a
AD
8332002-02-05 Akim Demaille <akim@epita.fr>
834
835 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
836 * data/: here.
837
894dd62e
PE
8382002-01-29 Paul Eggert <eggert@twinsun.com>
839
840 * src/bison.simple (YYSIZE_T): Do not define merely because
841 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
842 On some platforms, <alloca.h> does not declare YYSTD (size_t).
843
82841af7
AD
8442002-01-27 Akim Demaille <akim@epita.fr>
845
846 Fix `%nonassoc and eof'.
847
848 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
849 which were not properly copied! Replace
850 memcpy (res->errs, src->errs, src->nerrs);
851 with
852 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
853 !!!
854 * tests/regression.at (%nonassoc and eof): Adjust to newest
855 Autotest: `.' is not in the PATH.
856
318b76e9
AD
8572002-01-27 Akim Demaille <akim@epita.fr>
858
859 * tests/sets.at (AT_EXTRACT_SETS): New.
860 (Nullable): Use it.
861 (Firsts): New.
862
30d2f3d5
AD
8632002-01-26 Akim Demaille <akim@epita.fr>
864
865 * tests/actions.at, tests/calc.at, tests/headers.at,
866 * tests/torture.at: Adjust to the newest Autotest which no longer
867 forces `.' in the PATH.
868
30f8c395
AD
8692002-01-25 Akim Demaille <akim@epita.fr>
870
871 * tests/regression.at (%nonassoc and eof): New.
872 Suggested by Robert Anisko.
873
29ae55f1
AD
8742002-01-24 Akim Demaille <akim@epita.fr>
875
876 Bison dumps core when trying to complain about broken input files.
877 Reported by Cris van Pelt.
878
879 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
880 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
881 into...
882 (Invalid inputs): Strengthen: exercise parse_percent_token.
883
2b548aa6
RA
8842002-01-24 Robert Anisko <robert.anisko@epita.fr>
885
886 * src/Makefile.am: Add bison.c++.
887 * src/bison.c++: New skeleton.
888
bb0146c2
AD
8892002-01-21 Paolo Bonzini <bonzini@gnu.org>
890
891 * po/it.po: New.
892
bec30531
AD
8932002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
894
895 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
896
fc6edc45
MA
8972002-01-20 Marc Autret <marc@gnu.org>
898
899 * src/files.c (compute_output_file_names): Fix
900
5e5d5415
MA
9012002-01-20 Marc Autret <marc@gnu.org>
902
903 * tests/output.at: New test.
904 * src/files.c (compute_base_names): Don't map extensions when
905 the YACC flag is set, use defaults.
906 Reported by Evgeny Stambulchik.
907
44ea3fbd
MA
9082002-01-20 Marc Autret <marc@gnu.org>
909
bb0146c2 910 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
911 compilers as well (i.e. the vendor C compiler).
912 Suggested by Albert Chin-A-Young.
913
338963d1
TVH
9142002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
915
916 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
917 canonical definition.
918 * src/system.h: Use the canonical definition for PARAMS (avoids
919 a conflict with the macro from lib/hash.h).
920
c57b2479
AD
9212002-01-11 Akim Demaille <akim@epita.fr>
922
923 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 924 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 925
b85810ae
AD
9262002-01-09 Akim Demaille <akim@epita.fr>
927
928 * src/files.c, src/files.h (output_infix): New.
929 (tab_extension): Remove.
930 (compute_base_names): Compute the former, drop the latter.
931 * src/output.c (prepare): Insert the muscles `output-infix', and
932 `output-suffix'.
933 * src/parse-skel.y (string, string.1): New.
934 (section.header): Use it.
935 (section.yacc): Remove.
936 (prefix): Remove too.
937 * src/scan-skel.l: Adjust.
938 * src/bison.simple, src/bison.hairy: Adjust.
939
cae60122
AD
9402002-01-09 Akim Demaille <akim@epita.fr>
941
942 * configure.in (WERROR_CFLAGS): Compute it.
943 * src/Makefile.am (CFLAGS): Pass it.
944 * tests/atlocal.in (CFLAGS): Idem.
945 * src/files.c: Fix a few warnings.
946 (get_extension_index): Remove, unused.
947
ae404801
AD
9482002-01-08 Akim Demaille <akim@epita.fr>
949
950 * src/getargs.c (AS_FILE_NAME): New.
951 (getargs): Use it to convert DOSish file names.
952 * src/files.c (base_name): Rename as full_base_name to avoid
953 clashes with `base_name ()'.
954 (filename_split): New.
955 (compute_base_names): N-th rewrite, using filename_split.
956
22312b71
AD
9572002-01-08 Akim Demaille <akim@epita.fr>
958
959 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
960 New, stolen from the Fileutils 4.1.
961 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
962 * configure.in: Check for the presence of memrchr, and of its
963 prototype.
964
a67cef01
TVH
9652002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
966
967 * lib/hash.h (__P): Added definition for this macro.
968 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
969 BUILT_SOURCES, to ensure they are generated first.
970 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
971 %error-verbose to allow bootstrapping with bison 1.30x.
972
2b25d624
AD
9732002-01-06 Akim Demaille <akim@epita.fr>
974
975 * src/reader.c (parse_braces): Don't fetch the next char, the
976 convention is to fetch on entry.
977 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
978 'switch' without a following semicolon.
979 * tests/regression.at (braces parsing): New.
980
3460813b
AD
9812002-01-06 Akim Demaille <akim@epita.fr>
982
983 Bison is dead wrong in its RR conflict reports.
984
985 * tests/torture.at (GNU Cim Grammar): New.
986 * src/conflicts.c (count_rr_conflicts): Fix.
987
73784c64
AD
9882002-01-06 Akim Demaille <akim@epita.fr>
989
990 Creating package.m4 from configure.ac causes too many problems.
991
992 * tests/Makefile.am (package.m4): Create it by hand,
993 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
994
25d81090
AD
9952002-01-06 Akim Demaille <akim@epita.fr>
996
997 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
998 skeleton.h.
999
a9b8959e
PE
10002002-01-04 Paul Eggert <eggert@twinsun.com>
1001
1002 * doc/bison.texinfo (Debugging):
1003 Remove YYSTDERR; it's no longer defined or used.
1004 Also, s/cstdio.h/cstdio/.
1005
25d81090
AD
10062002-01-03 Akim Demaille <akim@epita.fr>
1007
1008 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1009
1109455c
AD
10102002-01-03 Akim Demaille <akim@epita.fr>
1011
1012 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1013 tracing code to --trace, wait for a better --trace option, with
1014 args.
1015
7ea5e977
AD
10162002-01-03 Akim Demaille <akim@epita.fr>
1017
1018 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1019 The ISO C++ standard is extremely clear about it: stderr is
1020 considered a macro, not a regular symbol (see table 94 `Header
1021 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1022 Therefore std:: does not apply to it. It still does with fprintf.
1023 Also, s/cstdio.h/cstdio/.
1024
fab5b110
AD
10252002-01-03 Akim Demaille <akim@epita.fr>
1026
1027 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1028 for non system headers.
1029
aed7fd9b
AD
10302002-01-02 Akim Demaille <akim@epita.fr>
1031
1032 Equip the skeleton chain with location tracking, runtime trace,
1033 pure parser and scanner.
1034
1035 * src/parse-skel.y: Request a pure parser, locations, and prefix
1036 renaming.
1037 (%union): Having several members with the same type does not help
1038 type mismatches, simplify.
1039 (YYPRINT, yyprint): New.
1040 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1041 (skel_error): this.
1042 Handle locations.
1043 * src/scan-skel.l: Adjust to these changes.
1044 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1045 (LOCATION_PRINT, skel_control_t): New.
1046
24fad99e
AD
10472001-12-30 Akim Demaille <akim@epita.fr>
1048
1049 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1050 replace `gb' with BLANKS.
1051 * src/scan-skel.l: Adjust.
1052
a4b36db4
AD
10532001-12-30 Akim Demaille <akim@epita.fr>
1054
1055 * src/system.h: We don't need nor want bcopy.
1056 Throw away MS-DOS crap: we don't need getpid.
1057 * configure.in: We don't need strndup. It was even causing
1058 problems: because Flex includes the headers *before* us,
1059 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1060 not visible.
1061 * lib/xstrndup.c: New.
1062 * src/scan-skel.l: Use it.
1063 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1064 * src/parse-skel.y: Use %directives instead of #defines.
1065
1239777d
AD
10662001-12-30 Akim Demaille <akim@epita.fr>
1067
1068 * src/skeleton.h: New.
1069 * src/output.c (output_parser, output_master_parser): Remove, dead
1070 code.
1071 * src/output.h (get_lines_number, actions_output, guards_output)
1072 (token_definitions_output): Prototype them.
1073 * src/parse-skel.y: Add the license notice.
1074 Include output.h and skeleton.h.
1075 (process_skeleton): Returns void, and takes a single parameter.
1076 * src/scan-skel.l: Add the license notice.
1077 Include skeleton.h.
1078 Don't use %option yylineno: it seems that then Flex imagines
1079 REJECT has been used, and therefore it won't reallocate its
1080 buffers (which makes no other sense to me than a bug). It results
1081 in warnings for `unused: yy_flex_realloc'.
1082
9b3add5b
RA
10832001-12-30 Robert Anisko <robert.anisko@epita.fr>
1084
1085 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1086 (MUSCLE_INSERT_PREFIX): ...to there.
1087 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1088 (MUSCLE_INSERT_PREFIX): Move from here...
1089
1090 * src/bison.hairy: Add a section directive. Put braces around muscle
1091 names. This parser skeleton is still broken, but Bison should not
1092 choke on a bad muscle 'syntax'.
1093 * src/bison.simple: Add a section directive. Put braces around muscle
1094 names.
1095
1096 * src/files.h (strsuffix, stringappend): Add declarations.
1097 (tab_extension): Add declaration.
1098 (short_base_name): Add declaration.
1099
1100 * src/files.c (strsuffix, stringappend): No longer static. These
1101 functions are used in the skeleton parser.
1102 (tab_extension): New.
1103 (compute_base_names): Use the computations done in this function
fab5b110 1104 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1105 names.
1106 (short_base_name): No longer static.
1107
1108 * src/output.c (output_skeleton): New.
1109 (output): Disable call to output_master_parser, and give a try to
1110 a new skeleton handling system.
1111 (guards_output, actions_output): No longer static.
1112 (token_definitions_output, get_lines_number): No longer static.
1113
1114 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1115
fab5b110 1116 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1117 parse-skel.y.
1118
1119 * src/parse-skel.y: New file.
1120 * src/scan-skel.l: New file.
1121
b5b61c61
AD
11222001-12-29 Akim Demaille <akim@epita.fr>
1123
1124 %name-prefix is broken.
1125
1126 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1127 Adjust all dependencies.
1128 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1129 %name-prefix.
1130
1131 Renaming yylval but not yylloc is not consistent. Now we do.
1132
1133 * src/bison.simple: Prefix yylloc if used.
1134 * doc/bison.texinfo (Decl Summary): Document that.
1135
8c9a50be
AD
11362001-12-29 Akim Demaille <akim@epita.fr>
1137
1138 * doc/bison.texinfo: Promote `%long-directive' over
1139 `%long_directive'.
1140 Remove all references to fixed-output-files, yacc is enough.
1141
d99361e6
AD
11422001-12-29 Akim Demaille <akim@epita.fr>
1143
1144 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1145 user prologue. These are defaults.
1146 * tests/actions.at (Mid-rule actions): Make sure the user can
1147 define YYDEBUG and YYERROR_VERBOSE.
1148
b9cecb91
AD
11492001-12-29 Akim Demaille <akim@epita.fr>
1150
1151 * src/output.c (header_output): Don't forget to export YYLTYPE and
1152 yylloc.
1153 * tests/headers.at (export YYLTYPE): New, make sure it does.
1154 * tests/regression.at (%union and --defines, Invalid CPP headers):
1155 Move to...
1156 * tests/headers.at: here.
1157
aea13e97
AD
11582001-12-29 Akim Demaille <akim@epita.fr>
1159
1160 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1161
931394cb
AD
11622001-12-29 Akim Demaille <akim@epita.fr>
1163
1164 * tests/actions.at (Mid-rule actions): Output on a single line
1165 instead of several.
1166
704a47c4
AD
11672001-12-29 Akim Demaille <akim@epita.fr>
1168
1169 * doc/bison.texinfo: Formatting changes.
1170
091e20bb
AD
11712001-12-29 Akim Demaille <akim@epita.fr>
1172
1173 Don't store the token defs in a muscle, just be ready to output it
1174 on command. Now possible via `symbols'. Fixes a memory leak.
1175
1176 * src/output.c (token_definitions_output): New.
1177 (output_parser, header_output): Use it.
1178 * src/reader.c (symbols_save): Remove.
1179
cce71710
AD
11802001-12-29 Akim Demaille <akim@epita.fr>
1181
1182 * src/bison.simple: Do not provide a default for YYSTYPE and
1183 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1184 default.
1185
82c035a8
AD
11862001-12-29 Akim Demaille <akim@epita.fr>
1187
1188 Mid-rule actions are simply... ignored!
1189
1190 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1191 the empty-rule associated to the dummy symbol, not to the host
1192 rule.
1193 * tests/actions.at (Mid-rule actions): New.
1194
8419d367
AD
11952001-12-29 Akim Demaille <akim@epita.fr>
1196
1197 Memory leak.
1198
1199 * src/reader.c (reader): Free grammar.
1200
375d5806
AD
12012001-12-29 Akim Demaille <akim@epita.fr>
1202
1203 Memory leak.
1204
1205 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1206 since it allocates it for each state, although only one is needed.
1207 (allocate_storage): Do it here.
1208
f51cb8ff
AD
12092001-12-29 Akim Demaille <akim@epita.fr>
1210
1211 * src/options.h, src/options.c (create_long_option_table): Rename
1212 as...
1213 (long_option_table_new): this, with a clearer prototype.
1214 (percent_table): Remove, unused,
1215 * src/getargs.c (getargs): Adjust.
1216
29e88316
AD
12172001-12-29 Akim Demaille <akim@epita.fr>
1218
1219 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1220 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1221 as states.
1222
b9f71f19
AD
12232001-12-29 Akim Demaille <akim@epita.fr>
1224
1225 * src/lalr.c (build_relations): Rename `states' as `states1'.
1226 Sorry, I don't understand exactly what it is, no better name...
1227
1a2b5d37
AD
12282001-12-29 Akim Demaille <akim@epita.fr>
1229
1230 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1231 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1232 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1233 as rules.
1234
1cca533e
AD
12352001-12-29 Akim Demaille <akim@epita.fr>
1236
1237 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1238 ago.
1239
c03ae966
AD
12402001-12-29 Akim Demaille <akim@epita.fr>
1241
1242 * src/reader.c, src/reader.h (user_toknums): Remove.
1243 Adjust all users to use symbols[i]->user_token_number.
1244
5a670b1e
AD
12452001-12-29 Akim Demaille <akim@epita.fr>
1246
1247 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1248 Adjust all users to use symbols[i]->prec or ->assoc.
1249
ad949da9
AD
12502001-12-29 Akim Demaille <akim@epita.fr>
1251
1252 * src/reader.c, src/reader.h (tags): Remove.
1253 Adjust all users to use symbols[i]->tag.
1254
0e78e603
AD
12552001-12-29 Akim Demaille <akim@epita.fr>
1256
1257 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1258 and rule_table.
1259 * src/reader.c (packsymbols): Fill this table.
1260 Drop sprec.
1261 * src/conflicts.c (resolve_sr_conflict): Adjust.
1262 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1263 single table.
1264 Use symbols[i]->tag instead of tags[i].
1265
213e640e
AD
12662001-12-29 Akim Demaille <akim@epita.fr>
1267
1268 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1269 In addition, put a comment in there, to replace...
1270 * tests/regression.at (%union and C comments): Remove.
1271
e7b8bef1
AD
12722001-12-29 Akim Demaille <akim@epita.fr>
1273
1274 * tests/regression.at (Web2c Actions): Blindly move the actual
1275 output as expected output. The contents *seem* right to me, but I
1276 can't pretend reading perfectly parser tables... Nonetheless, all
1277 the other tests pass correctly, the table look OK, even though the
1278 presence of `$axiom' is to be noted: AFAICS it is useless (but
1279 harmless).
1280
b68e7744
AD
12812001-12-29 Akim Demaille <akim@epita.fr>
1282
1283 * src/reader.c (readgram): Don't add the rule 0 if there were no
1284 rules read. In other words, add it _after_ having performed
1285 grammar sanity checks.
1286 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1287
78d5bae9
AD
12882001-12-29 Akim Demaille <akim@epita.fr>
1289
1290 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1291 visible, and some states have now a different number.
1292
ff442794
AD
12932001-12-29 Akim Demaille <akim@epita.fr>
1294
1295 * src/reader.c (readgram): Bind the initial rule's lineno to that
1296 of the first rule.
1297 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1298 (Solved SR Conflicts): Adjust rule 0's line number.
1299
610ab194
AD
13002001-12-29 Akim Demaille <akim@epita.fr>
1301
1302 Fix the `GAWK Grammar' failure.
1303
1304 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1305 the reductions of the first state which was mistakenly confused
1306 with the final state because precisely final_state was initialized
1307 to 0.
1308 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1309 now noticed by Bison.
1310 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1311 have a reduction on $default.
1312
29d29c8f
AD
13132001-12-29 Akim Demaille <akim@epita.fr>
1314
1315 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1316 rule line numbers.
1317 * src/closure.c (print_closure): Likewise.
1318 * src/derives.c (print_derives): Likewise.
1319 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1320 now.
1321
7c6b64d0
AD
13222001-12-29 Akim Demaille <akim@epita.fr>
1323
1324 * src/lalr.c (lookaheads_print): New.
1325 (lalr): Call it when --trace-flag.
1326 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1327 are dumped.
1328
3d4daee3
AD
13292001-12-29 Akim Demaille <akim@epita.fr>
1330
1331 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1332 when walking through ritem, even via rule->rhs.
1333 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1334 (useful_production, useless_nonterminals): Likewise.
1335 (reduce_grammar_tables): Likewise, plus update nritems.
1336 * src/nullable.c (set_nullable): Likewise.
1337 * src/lalr.c (build_relations): Likewise.
1338 * tests/sets.at (Nullable): Adjust.
1339 Fortunately, now, the $axiom is no longer nullable.
1340
9e7f6bbd
AD
13412001-12-29 Akim Demaille <akim@epita.fr>
1342
1343 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1344 the 0-sentinel.
1345 * src/gram.c (ritem_longest_rhs): Likewise.
1346 * src/reduce.c (nonterminals_reduce): Likewise.
1347 * src/print_graph.c (print_graph): Likewise.
1348 * src/output.c (output_rule_data): Likewise.
1349 * src/nullable.c (set_nullable): Likewise.
1350
255ef638
AD
13512001-12-29 Akim Demaille <akim@epita.fr>
1352
1353 * src/output.c: Comment changes.
1354
0d8a7363
AD
13552001-12-27 Paul Eggert <eggert@twinsun.com>
1356
1357 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1358 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1359 Sparc, as they were causing more porting problems than the
1360 (minor) performance improvement was worth.
1361
1362 Also, catch up with 1.31's YYSTD.
1363
3db472b9
AD
13642001-12-27 Akim Demaille <akim@epita.fr>
1365
1366 * src/output.c (output_gram): Rely on nritems, not the
1367 0-sentinel. See below.
1368 Use -1 as separator, not 0.
1369 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1370 Rely on -1 as separator in yyrhs, instead of 0.
1371 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1372 twice `Now at end of input', therefore there are two lines less to
1373 expect.
1374
b365aa05
AD
13752001-12-27 Akim Demaille <akim@epita.fr>
1376
1377 * tests/regression.at (Unresolved SR Conflicts):
1378 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1379 below.
1380
30171f79
AD
13812001-12-27 Akim Demaille <akim@epita.fr>
1382
1383 * src/LR0.c (new_state): Recognize the final state by the fact it
1384 is reached by eoftoken.
1385 (insert_start_shifting_state, insert_eof_shifting_state)
1386 (insert_accepting_state, augment_automaton): Remove, since now
1387 these states are automatically computed from the initial state.
1388 (generate_states): Adjust.
1389 * src/print.c: When reporting a rule number to the user, substract
1390 1, so that the axiom rule is rule 0, and the first user rule is 1.
1391 * src/reduce.c: Likewise.
1392 * src/print_graph.c (print_core): For the time being, just as for
1393 the report, depend upon --trace-flags to dump the full set of
1394 items.
1395 * src/reader.c (readgram): Once the grammar read, insert the rule
1396 0: `$axiom: START-SYMBOL $'.
1397 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1398 number of the states has changed (the final state is no longer
1399 necessarily the last), catch up.
1400
75142d45
AD
14012001-12-27 Akim Demaille <akim@epita.fr>
1402
1403 Try to make the use of the eoftoken valid. Given that its value
1404 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1405 is used instead of > 0 where appropriate, (ii), depend upon nritems
1406 instead of the 0-sentinel.
1407
1408 * src/gram.h, src/gram.c (nritems): New.
1409 Expected to be duplication of nitems, but for the time being...
1410 * src/reader.c (packgram): Assert nritems and nitems are equal.
1411 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1412 * src/closure.c (print_closure, print_fderives): Likewise.
1413 * src/gram.c (ritem_print): Likewise.
1414 * src/print.c (print_core, print_grammar): Likewise.
1415 * src/print_graph.c: Likewise.
1416
b7c49edf
AD
14172001-12-27 Akim Demaille <akim@epita.fr>
1418
1419 * src/main.c (main): If there are complains after grammar
1420 reductions, then output the report anyway if requested, then die.
1421 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1422 * src/reader.c (eoftoken): New.
1423 (parse_token_decl): If the token being defined has value `0', it
1424 is the eoftoken.
1425 (packsymbols): No longer hack `tags' to insert `$' by hand.
1426 Be sure to preserve the value of the eoftoken.
1427 (reader): Make sure eoftoken is defined.
1428 Initialize nsyms to 0: now eoftoken is created just like the others.
1429 * src/print.c (print_grammar): Don't special case the eof token.
1430 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1431 lie anyway, albeit pleasant.
1432 * tests/calc.at: Exercise error messages with eoftoken.
1433 Change the grammar so that empty input is invalid.
1434 Adjust expectations.
1435 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1436
ec2da99f
AD
14372001-12-27 Akim Demaille <akim@epita.fr>
1438
1439 * configure.in: Check the protos of strchr ans strspn.
1440 Replace strchr if needed.
1441 * src/system.h: Provide the protos of strchr, strspn and memchr if
1442 missing.
1443 * lib/strchr.c: New.
1444 * src/reader.c (symbols_save): Use strchr.
1445
8adfa272
AD
14462001-12-27 Akim Demaille <akim@epita.fr>
1447
1448 * src/print.c, src/print_graph.c (escape): New.
1449 Use it to quote the TAGS outputs.
1450 * src/print_graph.c (print_state): Now errors are in red, and
1451 reductions in green.
1452 Prefer high to wide: output the state number on a line of its own.
1453
80dac38c
AD
14542001-12-27 Akim Demaille <akim@epita.fr>
1455
1456 * src/state.h, src/state.c (reductions_new): New.
1457 * src/LR0.c (set_state_table): Let all the states have a
1458 `reductions', even if reduced to 0.
1459 (save_reductions): Adjust.
1460 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1461 * src/print.c (print_reductions, print_actions): Adjust.
1462 * src/output.c (action_row): Adjust.
1463
2cec70b9
AD
14642001-12-27 Akim Demaille <akim@epita.fr>
1465
1466 * src/state.h, src/state.c (errs_new, errs_dup): New.
1467 * src/LR0.c (set_state_table): Let all the states have an errs,
1468 even if reduced to 0.
1469 * src/print.c (print_errs, print_reductions): Adjust.
1470 * src/output.c (output_actions, action_row): Adjust.
1471 * src/conflicts.c (resolve_sr_conflict): Adjust.
1472
13ca549a
AD
14732001-12-27 Akim Demaille <akim@epita.fr>
1474
1475 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1476
5092aba5
AD
14772001-12-27 Akim Demaille <akim@epita.fr>
1478
1479 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1480 * src/print.c: here.
1481 (lookaheadset, shiftset): New, used as additional storage by
1482 print_reductions.
1483 (print_results): Adjust.
1484 (print_shifts, print_gotos, print_errs): New, extracted from...
1485 (print_actions): here.
1486 * src/print_graph.c (print_actions): Remove dead code.
1487
11e2beca
AD
14882001-12-27 Akim Demaille <akim@epita.fr>
1489
1490 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1491 `$n' and `@n'.
1492
dac3c910
AD
14932001-12-27 Akim Demaille <akim@epita.fr>
1494
1495 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1496 (build_relations): Adjust.
1497
d0b0fefa
AD
14982001-12-27 Akim Demaille <akim@epita.fr>
1499
1500 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1501 duplication.
1502
adc8c848
AD
15032001-12-27 Akim Demaille <akim@epita.fr>
1504
1505 * src/reader.c (packgram): Catch nitems overflows.
1506
14d293ac
AD
15072001-12-27 Akim Demaille <akim@epita.fr>
1508
1509 * src/files.c, src/files.h (guard_obstack): Remove.
1510 * src/output.c (output): Adjust.
1511 * src/reader.c (parse_braces): New, factoring...
1512 (copy_action, copy_guard): these two which are renamed as...
1513 (parse_action, parse_guard): these.
1514 As a voluntary consequence, using braces around guards is now
1515 mandatory.
1516
f499b062
AD
15172001-12-27 Akim Demaille <akim@epita.fr>
1518
1519 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1520 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1521 members.
1522 (symbol_list_new): Adjust.
1523 (copy_action): action_line is the first line, not the last.
1524 (copy_guard): Just as for actions, store the `action' only, not
1525 the switch/case/break flesh.
1526 Don't parse the user action that might follow the guard, let...
1527 (readgram): do it, i.e., now, there can be an action after a
1528 guard.
1529 In other words the guard is just explicitly optional.
1530 (packgram): Adjust.
1531 * src/output.c (guards_output): New.
1532 (output_parser): Call it when needed.
1533 (output): Also free the guard and attrs obstacks.
1534 * src/files.c, src/files.h (obstack_save): Remove.
1535 (output_files): Remove.
1536 As a result, if one needs the former `.act' file, using an
1537 appropriate skeleton which requires actions and guards is now
1538 required.
1539 * src/main.c (main): Adjust.
1540 * tests/semantic.at: New.
1541 * tests/regression.at: Use `input.y' as input file name.
1542 Avoid 8+3 problems by requiring input.c when the test needs the
1543 parser.
1544
d945f5cd
AD
15452001-12-27 Akim Demaille <akim@epita.fr>
1546
1547 * src/reader.c (symbol_list_new): Be sure to initialize all the
1548 fields.
1549
d200e455
AD
15502001-12-27 Akim Demaille <akim@epita.fr>
1551
1552 All the hacks using a final pseudo state are now useless.
1553
1554 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1555 * src/lalr.c (nLA): New.
1556 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1557 instead of lookaheadsp from the pseudo state (nstate + 1).
1558
f9507c28
AD
15592001-12-27 Akim Demaille <akim@epita.fr>
1560
1561 * src/output.c (action_row, token_actions): Use a state_t instead
1562 of a integer, and nlookaheads instead of the following state's
1563 lookaheadsp.
1564
065fbd27
AD
15652001-12-27 Akim Demaille <akim@epita.fr>
1566
1567 * src/conflicts.c (log_resolution, flush_shift)
1568 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1569 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1570 (conflicts_print, print_reductions): Use a state_t instead of an
1571 integer when referring to a state.
1572 As much as possible, depend upon nlookaheads, instead of the
1573 `lookaheadsp' member of the following state (since lookaheads of
1574 successive states are successive, the difference between state n + 1
1575 and n served as the number of lookaheads for state n).
1576 * src/lalr.c (add_lookback_edge): Likewise.
1577 * src/print.c (print_core, print_actions, print_state)
1578 (print_results): Likewise.
1579 * src/print_graph.c (print_core, print_actions, print_state)
1580 (print_graph): Likewise.
1581 * src/conflicts.h: Adjust.
1582
1b177bd7
AD
15832001-12-27 Akim Demaille <akim@epita.fr>
1584
1585 * src/bison.hairy: Formatting/comment changes.
1586 ANSIfy.
1587 Remove `register' indications.
1588 Add plenty of `static'.
1589
7742ddeb
AD
15902001-12-27 Akim Demaille <akim@epita.fr>
1591
1592 * src/output.c (prepare): Drop the muscle `ntbase' which
1593 duplicates ntokens.
1594 * src/bison.simple: Formatting/comment changes.
1595 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1596 is an undocumented synonym.
1597
1fa14068
AD
15982001-12-22 Akim Demaille <akim@epita.fr>
1599
1600 * src/output.c (output_table_data): Change the prototype to use
1601 `int' for array ranges: some invocations do pass an int, not a
1602 short.
1603 Reported by Wayne Green.
1604
b9752825
AD
16052001-12-22 Akim Demaille <akim@epita.fr>
1606
1607 Some actions of web2c.y are improperly triggered.
1608 Reported by Mike Castle.
1609
1610 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1611 * tests/regression.at (Web2c): Rename as...
1612 (Web2c Report): this.
1613 (Web2c Actions): New.
1614
776209d6
AD
16152001-12-22 Akim Demaille <akim@epita.fr>
1616
1617 Reductions in web2c.y are improperly reported.
1618 Reported by Mike Castle.
1619
1620 * src/conflicts.c (print_reductions): Fix.
1621 * tests/regression.at (Web2c): New.
1622
275fc3ad
AD
16232001-12-18 Akim Demaille <akim@epita.fr>
1624
1625 Some host fail on `assert (!"foo")', which expands to
1626 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1627 Reported by Nelson Beebee.
1628
1629 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1630 `#define it_succeeded 0' and `assert (it_succeeded)'.
1631
897668ee
MA
16322001-12-17 Marc Autret <autret_m@epita.fr>
1633
1634 * src/bison.simple: Don't hard code the skeleton line and filename.
1635 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1636 New line counter 'skeleton_line' (skeleton-line muscle).
1637
ab3399e0
PE
16382001-12-17 Paul Eggert <eggert@twinsun.com>
1639
1640 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1641 YYDEBUG must be defined to a nonzero value.
1642
1643 * src/bison.simple (yytname): Do not assume that the user defines
1644 YYDEBUG to a properly parenthesized expression.
1645
3877f72b
AD
16462001-12-17 Akim Demaille <akim@epita.fr>
1647
1648 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1649 nlookaheads is a new member.
1650 Adjust all users.
1651 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1652 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1653 state.
776209d6 1654
331dbc1b
AD
16552001-12-17 Akim Demaille <akim@epita.fr>
1656
1657 * src/files.h, src/files.c (open_files, close_files): Remove.
1658 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1659 let...
1660 * src/reader.c (reader): Do it.
776209d6 1661
be750e4c
AD
16622001-12-17 Akim Demaille <akim@epita.fr>
1663
1664 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1665
709ae8c6
AD
16662001-12-17 Akim Demaille <akim@epita.fr>
1667
1668 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1669 (flush_reduce): New.
1670 (resolve_sr_conflict): Adjust.
776209d6 1671
f87685c3
AD
16722001-12-17 Akim Demaille <akim@epita.fr>
1673
1674 * src/output.c (output_obstack): Be static and rename as...
1675 (format_obstack): this, to avoid any confusion with files.c's
1676 output_obstack.
1677 * src/reader.h (muscle_obstack): Move to...
1678 * src/output.h: here, since it's defined in output.c.
1679
837491d8
AD
16802001-12-17 Akim Demaille <akim@epita.fr>
1681
1682 * src/output.c (action_row, save_column, default_goto)
1683 (sort_actions, matching_state, pack_vector): Better variable
1684 locality.
1685
796d61fb
AD
16862001-12-17 Akim Demaille <akim@epita.fr>
1687
1688 * src/output.c: Various formatting changes.
776209d6 1689
64d15509
AD
16902001-12-17 Akim Demaille <akim@epita.fr>
1691
1692 * src/files.c (output_files): Free the output_obstack.
1693 * src/main.c (main): Call print and print_graph conditionally.
1694 * src/print.c (print): Work unconditionally.
1695 * src/print_graph.c (print_graph): Work unconditionally.
1696 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1697
fbc8ecb7
MA
16982001-12-16 Marc Autret <autret_m@epita.fr>
1699
1700 * src/output.c (actions_output): Fix. When we use %no-lines,
1701 there is one less line per action.
1702
f0440388
MA
17032001-12-16 Marc Autret <autret_m@epita.fr>
1704
1705 * src/bison.simple: Remove a useless #line directive.
1706 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1707 * src/output.c (get_lines_number): New.
776209d6 1708 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1709 output muscles.
1710 Fix line numbering.
1711 (actions_output): Computes the number of lines taken by actions.
1712 (output_master_parser): Insert new skeleton which is the name of
1713 the output parser file name.
1714
a79986b8
MA
17152001-12-15 Marc Autret <autret_m@epita.fr>
1716
1717 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1718
4ec8e00f
MA
17192001-12-15 Marc Autret <autret_m@epita.fr>
1720
1721 * src/output.c (output_gram): Keep track of the hairy one.
1722
1a4648ff
AD
17232001-12-15 Akim Demaille <akim@epita.fr>
1724
1725 Make `make distcheck' work.
1726
1727 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1728 system.h which uses libgettext.h.
1729
9c2c67e6
AD
17302001-12-15 Akim Demaille <akim@epita.fr>
1731
1732 * src/nullable.c (set_nullable): Useless rules must be skipped,
1733 otherwise, since we range over their symbols, we might look at a
1734 nonterminal which no longer ``exists'', i.e., it is not counted in
1735 `nvars', hence we overflow our arrays.
1736
93ede233
AD
17372001-12-15 Akim Demaille <akim@epita.fr>
1738
1739 The header can also be produced directly, without any obstack!
1740 Yahoo!
1741
1742 * src/files.c, src/files.h (defines_obstack): Remove.
1743 (compute_header_macro): Global.
1744 (defines_obstack_save): Remove.
1745 * src/reader.c (parse_union_decl): No longer output to
1746 defines_obstack: its content can be found in the `stype' muscle
1747 anyway.
1748 (output_token_translations): Merge into...
1749 (symbols_output): this.
1750 Rename as...
1751 (symbols_save): this.
1752 (reader): Adjust.
1753 * src/output.c (header_output): New.
1754 (output): Call it.
1755
2666f928
AD
17562001-12-15 Akim Demaille <akim@epita.fr>
1757
1758 * src/reader.c (parse_union_decl): Instead of handling two obstack
1759 simultaneously, use one to define the `stype' muscle, and use the
1760 value of the latter to fill defines_obstack.
1761 (copy_comment): Remove.
1762 (copy_comment2): Work for a single obstack.
1763 Rename as...
1764 (copy_comment): this.
1765
428046f8
AD
17662001-12-15 Akim Demaille <akim@epita.fr>
1767
1768 * src/lex.c, src/lex.h (xgetc): No longer static.
1769 * src/reader.c (parse_union_decl): Revamp.
1770
ea52d706
AD
17712001-12-15 Akim Demaille <akim@epita.fr>
1772
1773 Still making progress in separating Bison into (i) input, (ii)
1774 process, (iii) output: now we can directly output the parser file
1775 without using table_obstack at all.
1776
1777 * src/files.c, src/files.h (table_obstack): Bye bye.
1778 (parser_file_name): New.
1779 * src/files.c (compute_output_file_names): Compute it.
1780 * src/output.c (actions_output, output_parser)
1781 (output_master_parser): To a file instead of an obstack.
1782
3f96f4dc
AD
17832001-12-15 Akim Demaille <akim@epita.fr>
1784
1785 Attach actions to rules, instead of pre-outputting them to
1786 actions_obstack.
1787
1788 * src/gram.h (rule_t): action and action_line are new members.
1789 * src/reader.c (symbol_list): Likewise.
1790 (copy_action): Save the actions within the rule.
1791 (packgram): Save them in rule_table.
1792 * src/output.c (actions_output): New.
1793 (output_parser): Use it on `%%actions'.
1794 (output_rule_data): Don't free rule_table.
1795 (output): Do it.
1796 (prepare): Don't save the `action' muscle.
1797 * src/bison.simple: s/%%action/%%actions/.
1798
51576fb3
AD
17992001-12-15 Akim Demaille <akim@epita.fr>
1800
1801 * src/reader.c (copy_action): When --yacc, don't append a `;'
1802 to the user action: let it fail if lacking.
dee049eb 1803 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1804
2648a72d
AD
18052001-12-14 Akim Demaille <akim@epita.fr>
1806
1807 * src/lex.c (literalchar): Simply return the char you decoded, non
1808 longer mess around with obstacks and int pointers.
1809 Adjust all callers.
1810
92790e5b
AD
18112001-12-14 Akim Demaille <akim@epita.fr>
1812
1813 * src/lex.c (literalchar): Don't escape the special characters,
1814 just decode them, and keep them as char (before, eol was output as
1815 the 2 char string `\n' etc.).
1816 * src/output.c (output_rule_data): Use quotearg to output the
1817 token strings.
1818
927c1557
PE
18192001-12-13 Paul Eggert <eggert@twinsun.com>
1820
1821 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1822 Do not infringe on the global user namespace when using C++.
1823 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1824 All uses of `fprintf' and `stderr' changed.
1825
1826 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1827
ed8e1f68
AD
18282001-12-13 Akim Demaille <akim@epita.fr>
1829
1830 The computation of nullable is broken: it doesn't handle empty
1831 RHS's properly.
1832
1833 * tests/torture.at (GNU AWK Grammar): New.
1834 * tests/sets.at (Nullable): New.
1835 * src/nullable.c (set_nullable): Instead of blindly looping over
1836 `ritems', loop over the rules, and then over their rhs's.
1837
1838 Work around Autotest bugs.
1839
1840 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1841 frame, because Autotest understand lines starting with a `+' as
1842 traces from the shell. Then, they are not processed properly.
1843 Admittedly an Autotest bug, but we don't have time to wait for
1844 Autotest to catch up.
1845 * tests/regression.at (Broken Closure): Adjust to the new table
1846 frames.
1847 Move to...
1848 * tests/sets.at: here.
1849
cb581495
AD
18502001-12-13 Akim Demaille <akim@epita.fr>
1851
1852 * src/closure.c (closure): Use nrules instead of playing tricks
1853 with BITS_PER_WORD.
1854
2e729273
AD
18552001-12-13 Akim Demaille <akim@epita.fr>
1856
1857 * src/print.c (print_actions): Output the handling of `$' as the
1858 traces do: shifting the token EOF. Before EOF was treated as a
1859 nonterminal.
1860 * tests/regression.at: Adjust some tests.
1861 * src/print_graph.c (print_core): Complete the set of items via
1862 closure. The next-to-final and final states are still unsatisfying,
1863 but that's to be addressed elsewhere.
1864 No longer output the rule numbers, but do output the state number.
1865 A single loop for the shifts + gotos is enough, but picked a
1866 distinct color for each.
1867 (print_graph): Initialize and finalize closure.
1868
107f7dfb
AD
18692001-12-13 Akim Demaille <akim@epita.fr>
1870
1871 * src/reader.c (readgram): Remove dead code, an strip useless
1872 braces.
1873 (get_type): Remove, unused.
1874
9b53a24f
AD
18752001-12-12 Akim Demaille <akim@epita.fr>
1876
1877 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1878 on that of lib/error.c.
1879
dbfb6dcd
AD
18802001-12-12 Akim Demaille <akim@epita.fr>
1881
1882 Some hosts don't like `/' in includes.
1883
1884 * src/system.h: Include libgettext.h without qualifying the path.
1885 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1886 $(top_srcdir).
1887
c25fb648
MA
18882001-12-11 Marc Autret <autret_m@epita.fr>
1889
1890 * src/output.c (output_parser): Remove useless muscle.
1891
710ddc4f
MA
18922001-12-11 Marc Autret <autret_m@epita.fr>
1893
1894 * src/bison.simple: Remove #line just before %%epilogue. It
1895 is now handled in ...
1896 * src/reader.c (read_additionnal_code): Add the output of a
1897 #line for the epilogue.
1898
e83d80b8
MA
18992001-12-10 Marc Autret <autret_m@epita.fr>
1900
927c1557 1901 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1902 replace precedent remove.
1903 * src/bison.simple: Remove #line before %%prologue because
1904 %%input-line is wrong at this time.
1905
971d5158
MA
19062001-12-10 Marc Autret <autret_m@epita.fr>
1907
1908 * src/reader.c (symbols_output): Clean up.
927c1557 1909 * src/output.c (output_gram, output): Clean up.
971d5158 1910
5edafffd
AD
19112001-12-10 Akim Demaille <akim@epita.fr>
1912
1913 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1914 * src/LR0.c (set_state_table): here.
1915 * src/lalr.c (lalr): Call it.
1916
0279f8e9
AD
19172001-12-10 Akim Demaille <akim@epita.fr>
1918
1919 * src/state.h (shifts): Remove the `number' member: shifts are
1920 attached to state, hence no longer need to be labelled with a
1921 state number.
1922
190c4f5f
AD
19232001-12-10 Akim Demaille <akim@epita.fr>
1924
1925 Now that states have a complete set of members, the linked list of
1926 shifts is useless: just fill directly the state's shifts member.
1927
1928 * src/state.h (shifts): Remove the `next' member.
1929 * src/LR0.c (first_state, last_state): Remove.
1930 Adjust the callers.
1931 (augment_automaton): Don't look for the shifts that must be added
1932 a shift on EOF: it is those of the state we looked for! But now,
1933 since shifts are attached, it is no longer needed to looking
1934 merely by its id: its number.
1935
2a73b93d
AD
19362001-12-10 Akim Demaille <akim@epita.fr>
1937
1938 * src/LR0.c (augment_automaton): Better variable locality.
1939 Remove an impossible branch: if there is a state corresponding to
1940 the start symbol being shifted, then there is shift for the start
1941 symbol from the initial state.
1942
74392f6a
AD
19432001-12-10 Akim Demaille <akim@epita.fr>
1944
1945 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1946 only when appropriate: when insert_start_shifting_state' is not
1947 invoked.
1948 * tests/regression.at (Rule Line Numbers): Adjust.
1949
37c82725
AD
19502001-12-10 Akim Demaille <akim@epita.fr>
1951
1952 * src/LR0.c (augment_automaton): Now that all states have shifts,
1953 merge the two cases addition shifts to the initial state.
1954
6a164e0c
AD
19552001-12-10 Akim Demaille <akim@epita.fr>
1956
1957 * src/lalr.c (set_state_table): Move to...
1958 * src/LR0.c: here.
1959 * src/lalr.c (lalr): Don't call it...
1960 * src/LR0.c (generate_states): do it.
1961 * src/LR0.h (first_state): Remove, only the table is used.
1962
7215de24
AD
19632001-12-10 Akim Demaille <akim@epita.fr>
1964
1965 * src/LR0.h (first_shift, first_reduction): Remove.
1966 * src/lalr.c: Don't use first_shift: find shifts through the
1967 states.
1968
80e25d4d
AD
19692001-12-10 Akim Demaille <akim@epita.fr>
1970
1971 * src/LR0.c: Attach shifts to states as soon as they are
1972 computed.
1973 * src/lalr.c (set_state_table): Instead of assigning shifts to
1974 state, just assert that the mapping was properly done.
1975
0ab3728b
AD
19762001-12-10 Akim Demaille <akim@epita.fr>
1977
1978 * src/LR0.c (insert_start_shift): Rename as...
1979 (insert_start_shifting_state): this.
1980 (insert_eof_shifting_state, insert_accepting_state): New.
1981 (augment_automaton): Adjust.
1982 Better locality of the variables.
1983 When looking if the start_symbol is shifted from the initial
1984 state, using `while (... symbol != start_symbol ...)' sounds
1985 better than `while (... symbol < start_symbol ...)': If fail
1986 to see how the order between symbols could be relevant!
1987
78af9bbc
AD
19882001-12-10 Akim Demaille <akim@epita.fr>
1989
1990 * src/getargs.h: Don't declare `spec_name_prefix' and
1991 `spec_file_prefix', declared by src/files.h.
1992 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1993 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1994 * src/output.c (prepare): Adjust.
1995 * src/reader.c (symbols_output): Likewise.
1996 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1997
bdef2a41
AD
19982001-12-10 Akim Demaille <akim@epita.fr>
1999
2000 * src/muscle_tab.c (muscle_init): NULL is a better default than
2001 `"0"'.
2002
3735969c
AD
20032001-12-10 Akim Demaille <akim@epita.fr>
2004
2005 * src/reader.c (reader): Calling symbols_output once is enough.
2006
49701457
AD
20072001-12-10 Akim Demaille <akim@epita.fr>
2008
2009 Now that states have a complete set of members, the linked list of
2010 reductions is useless: just fill directly the state's reductions
2011 member.
2012
2013 * src/state.h (struct reductions): Remove member `number' and
2014 `next'.
2015 * src/LR0.c (first_reduction, last_reduction): Remove.
2016 (save_reductions): Don't link the new reductions, store them in
2017 this_state.
2018 * src/lalr.c (set_state_table): No need to attach reductions to
2019 states, it's already done.
2020 * src/output.c (output_actions): No longer free the shifts, then
2021 the reductions, then the states: free all the states and their
2022 members.
2023
0edad749
AD
20242001-12-10 Akim Demaille <akim@epita.fr>
2025
2026 * src/options.c (OPTN, DRTV, BOTH): New.
2027 (option_table): Use them.
2028
0edad749
AD
2029 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2030 the job of system.h.
2031 * src/options.c: Don't include stdio.h and xalloc.h for the same
2032 reasons.
2033
5449dd0f
AD
20342001-12-10 Akim Demaille <akim@epita.fr>
2035
2036 * src/output.c (output, prepare): Make sure the values of the
2037 muscles `action' and `prologue' are 0-terminated.
2038
a870c567
AD
20392001-12-10 Akim Demaille <akim@epita.fr>
2040
2041 Clean up GCC warnings.
2042
2043 * src/reader.c (copy_action): `buf' is not used.
2044 (parse_skel_decl): Be static.
2045 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2046 * src/options.h (create_long_option_table): Have a real prototype.
2047 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2048 (hash_delete_at): Return const void *.
2049 Adjust casts to preserve the const.
2050
80df8768
AD
20512001-12-10 Akim Demaille <akim@epita.fr>
2052
2053 * configure.in: Require 2.52g.
2054 M4 is not needed, but AUTOM4TE is.
2055 * m4/m4.m4: Remove.
2056 * tests/Makefile.am: Adjust.
2057
f693ad14
AD
20582001-12-10 Akim Demaille <akim@epita.fr>
2059
2060 One structure for states is enough, even though theoretically
2061 there are LR(0) states and LALR(1) states.
2062
2063 * src/lalr.h (state_t): Remove.
2064 (state_table): Be state_t **, not state_t *.
2065 * src/state.h (core, CORE_ALLOC): Rename as...
2066 (state_t, STATE_ALLOC): this.
2067 Add the LALR(1) members: shifts, reductions, errs.
2068 * src/LR0.c (state_table): Rename as...
2069 (state_hash): this, to avoid name clashes with the global
2070 `state_table'.
2071 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2072 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2073
74ffbcb6
AD
20742001-12-10 Akim Demaille <akim@epita.fr>
2075
2076 Bison dumps core on bash.y.
2077 Reported by Pascal Bart.
2078
2079 * src/warshall.c (bitmatrix_print): New.
2080 (TC): Use it.
2081 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2082 j must be the outer loop.
2083 * tests/regression.at (Broken Closure): New.
2084
07708e19
AD
20852001-12-05 Akim Demaille <akim@epita.fr>
2086
2087 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2088 its argument.
2089