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